We’re happy to share that we’re working on bringing documentation for the Swift standard library to Swift.org.
Purpose and impact:
With this change, you’ll be able to browse documentation for the Swift standard library on Swift.org. Furthermore, you’ll be able to contribute to the documentation. The documentation for each symbol — protocols, methods, properties, and so on — come from triple-slash (///) comments above each symbol’s declaration in the source. When you use the DocC syntax in these comments, you can provide abstracts and discussions, code snippets, links to other symbols, and more. And since the doc comments are in code, maintaining the documentation follows the same process as any other code change: make changes in a pull request, incorporate any feedback on the PR, and merge the PR.
To learn more about authoring docs with DocC, see the DocC documentation.
Process:
To enable publishing the Swift standard library documentation, we’ve opened a pull request on the Swift language repository: #88061. This PR adds a DocC documentation catalog, which consists of a top-level .docc directory and a directory structure containing .md curation files. The curation files organize symbols into topics that make them easy to browse, by collecting related child symbols of a given type into topics. Curation also organizes free functions and other symbols not tied to a class, structure, or protocol into semantically-related API collections, making them easier to find.
We’ve also prepared a preview of the stdlib documentation, as generated from this branch.
Once this PR merges, the continuous integration system will be able to start building and publishing the standard library documentation. At first, the documentation will align with the current release, meaning the latest release/ branch. In the future, we hope to allow browsing the documentation for different releases, such as a preview of the next release.
–Chris
Developer Publications