Build and Read Documentation for Swift-DocC

As you may have read in the blog post, work is underway to get documentation for Swift-DocC hosted on swift.org. In the meantime, here are some instructions to build the documentation yourself:

macOS with Xcode 13

Xcode 13 includes the pre-built DocC renderer so you can build documentation using the following instructions:

git clone git@github.com:apple/swift-docc.git
cd swift-docc
export DOCC_HTML_DIR="$(dirname $(xcrun --find docc))/../share/docc/render"
./bin/preview-docs DocC

Linux

For Linux, you’ll want to first build the renderer. For more details, refer to the Swift-DocC README.

git clone git@github.com:apple/swift-docc-render.git
cd swift-docc-render
npm install
npm run build
export DOCC_HTML_DIR="$(PWD)/dist"
cd ..
git clone git@github.com:apple/swift-docc.git
cd swift-docc
./bin/preview-docs DocC
9 Likes
Terms of Service

Privacy Policy

Cookie Policy