Using Jazzy with Swift Package Manager packages

Jazzy is a documentation generation tool for Swift and Objective-C. I am using it to generate the API documentation for OysterKit, but I hit a few bumps in the road when using it with the Swift Package Manager generated Xcode project.

It seems like it should be simple enough. To get started you should be able to generate the Xcode project (Jazzy requires this) and just run the Jazzy command to get a default set of documents in a doc directory.

However, the way that Swift Package Manager creates the Xcode project means that it doesn't know what to build documentation for. Here are the commands to both generate the project and documentation. They should be run from the root of your package.

swift package generate-xcodeproj
jazzy -x -scheme,OysterKit-Package -m OysterKit

Now that last command is specific for OysterKit. The general rule with $around$ around the name of your library product

jazzy -x -scheme,$product-name$-Package -m $product-name$

And that's it! Jazzy does a great job with the comments you add to enrich your Quick Help.