Planning for hosting documentation archives for all packages #1590
Replies: 3 comments 1 reply
-
This is super exciting. A couple initial thoughts/questions/etc
|
Beta Was this translation helpful? Give feedback.
-
Hi @daveverwer, @Sherlouk! This is really exciting work indeed. Regarding the build workflow you’re proposing, note that you can use the Regarding other questions you might have regarding Swift-DocC, I would love for us to discuss further in the Swift Forums where the Swift-DocC community can pitch in. Cheers! |
Beta Was this translation helpful? Give feedback.
-
So this thread has not been kept up to date (but you should see the DM conversation between Sven and me on this topic! 😂), but here's where we are and what we're going to ship soon:
This is a "v1" release of the feature and is the entire scope of what we'll make public in the next couple of weeks. But I also wanted to detail what we've discussed about a more complete version of this feature: We want to prioritise tagged release documentation rather than default branch documentation. URLs are more stable for tagged releases, and it's much clearer what is actually being documented if it's built from a release. So, we will make the following changes after shipping the v1 feature.
Key points:
|
Beta Was this translation helpful? Give feedback.
-
I’ve done some very preliminary tests with DocC on how we might approach mass-generating documentation for all Swift packages in the index.
So, taking a
docbuild
command like this:xcrun xcodebuild docbuild -scheme Lindenmayer-Package -derivedDataPath ~/Desktop/Lindenmayer-DocC -destination platform=macOS, arch=arm64
We end up with a
Build
directory that includes severaldoccarchive
files. In the case of the Lindenmayer package, we have five:I also don’t fully understand why we need the
-destination platform=macOS, arch=arm64
parameter, but we do. This needs more investigation.We also need to make use of these enhancements coming with Swift 5.6. They are already in the open-source DocC project and after a quick chat with @macdevnet he also advised we could potentially combine the documentation build process with the conversion to a static site and do everything in one step. For now, we have this command which should convert a single
doccarchive
:To run this, you also need to set an environment variable
DOCC_HTML_DIR
to the template generated as the output from this project. I haven’t managed to get this working yet but @macdevnet has been extremely helpful with figuring out what we have so far.What packages should we generate documentation for?
I was half hoping that a package without any documentation comments would cause
docs
ordocbuild
to fail so we’d know which packages had any docs at all.Taking a package like the trusty old LeftPad the
docbuild
command gives a triumphant** BUILD DOCUMENTATION SUCCEEDED **
and generates a valid DocC bundle, but of course that bundle is effectively empty:Maybe that’s OK, and we should host that type of documentation in the hope it will inspire people to start adding documentation comments as a first step. That said. If we launch this feature with a huge set of mostly blank documentation, it won’t look great.
Hosting
Ideally, we would host package documentation under the SPI package URL. For example https://swiftpackageindex.com/daveverwer/LeftPad/documentation.
There are some significant advantages to this approach, including having navigation and context as people browse package documentation. If someone ends up in some hosted documentation via a Google search (which is likely), they’ll easily be able to navigate to package metadata if we have a site header and navigation back to a package page available. It’s likely that if we manage to get the static transform mentioned above working that we could host the docs inside an
iframe
element, similar to what we do with README files.Other notes
We will probably want to:
xcodebuild docbuild
command.Next Steps
destination
parameter.doccarchive
files in the Build directory for a package and how the output of each relates.docc
tool.Beta Was this translation helpful? Give feedback.
All reactions