Trying to compile private symbol graph for DocC on the web

Hi @TaylorLineman – Swift-DocC doesn't fully support contributor documentation for frameworks today. I've definitely heard requests for that, but I'm not actually seeing a GitHub Issue for it so if you have a minute to file one and explain your use-case that would be really appreciated.

In the mean time, it is possible to generate the documentation you're looking for by providing DocC with a symbol graph that includes private symbols. Currently xcodebuild supports this, but not the Swift-DocC Plugin. We're tracking support with [SR-15765] CLI option for choosing level of access to expose when assembling documentation for internal consumption · Issue #11 · apple/swift-docc-plugin · GitHub.

To achieve this with xcodebuild, you can run something like the following:

xcodebuild docbuild -scheme [TargetName] \
-destination generic/platform=macOS \
OTHER_SWIFT_FLAGS='-symbol-graph-minimum-access-level private' \
DOCC_HOSTING_BASE_PATH='[REPOSITORY-NAME]' \
OTHER_DOCC_FLAGS='--disable-indexing'

There's documentation here that explains how to extract the built documentation archive from derived data: Distributing documentation to external developers | Apple Developer Documentation


I also wanted to note that generally I recommend setting the minimum access level to internal, not private when building contributor documentation for frameworks. Setting private may give you more symbols than you're actually looking for.

xcodebuild docbuild -scheme [TargetName] \
-destination generic/platform=macOS \
OTHER_SWIFT_FLAGS='-symbol-graph-minimum-access-level internal' \
DOCC_HOSTING_BASE_PATH='[REPOSITORY-NAME]' \
OTHER_DOCC_FLAGS='--disable-indexing'
2 Likes