-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2/x] Migrate to DocC for API reference docs #257
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 7, 2022
ryanmeisters
approved these changes
Jan 7, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rad
Base automatically changed from
dev/andrewchang-bird/cleanup-release-automation
to
master
January 7, 2022 23:04
Requires running DocC from mainline
andrewchang-bird
force-pushed
the
dev/andrewchang-bird/docc
branch
from
January 7, 2022 23:09
0694871
to
144299b
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Stack:
π #259 [4/x] Bump versions to 0.19.0
π #258 [3/x] Codemod Xcode-generated file header comments
π #257 β [2/x] Migrate to DocC for API reference docs
π #256 [1/x] Clean up automation pipeline
Overview
We currently use Swift Doc to generate the API reference documentation site, which was deprecated after Apple announced their fancy documentation generator at WWDC 2021 called DocC. In addition to producing great looking content pages, DocC supports arbitrary markdown-formatted articles, interactive tutorials, and works well with SwiftPM packages.
DocCβs feature set makes it easy to consolidate our existing documentation, which is scattered across the README, GitHub wiki, and API reference site. There are several benefits as well, including searchability (Google doesnβt index GitHub wiki pages) and the ability to decouple the README contents from releases.
Path Rewriting
The goal is to host the documentation site on a dedicated vanity domain for searchability and memorability. Unfortunately, DocC doesnβt support serving documentation from the root of the site and instead expects
/documentation/mockingbird
for articles and/tutorials/mockingbird
for tutorials. Since weβll only ever show documentation for Mockingbird on the site, it doesnβt make sense to include βmockingbirdβ in the path.The mainline versions of Swift-DocC and Swift-DocC-Render support generating a documentation archive with a custom base path for static hosting compatibility, but this is strictly additive, e.g.
/foo/bar/documentation/mockingbird
(see: swiftlang/swift-docc-render#24, swiftlang/swift-docc#44).To get the desired page paths, Iβve modified the renderer to rewrite URLs in the JSON data to the root. Currently the rewrites are hardcoded to minimize the number of changes since they are applied as a series of patches.
Syntax Highlighting
Swift-DocC-Renderer uses a lightly customized version of highlight.js for syntax highlighting code blocks which differs a bit from GitHub. Iβve patched the highlighting to make the Mockingbird testing API more readable and fix some minor issues (SR-15681).
Test Plan
Documentation archives are built as part of the release GitHub workflow and pulled by the documentation site here: https://mockingbirdswift.com/