Framework
Static Documentation Plugin
A Swift Package Manager plugin for generating static documentation using DocC.
Overview
The plugin integrates with Swift Package Manager to generate static HTML/CSS documentation directly from your package. It expands the swift package command with a subcommand generate-static-documentation that renders pure HTML/CSS documentation.
Setup
Add swift-docc-static as a dependency in your Package.swift:
dependencies: [
.package(url: "https://github.com/mipalgu/swift-docc-static.git", branch: "main"),
]
No additional configuration is needed - the plugin is automatically available.
Usage
Run the plugin from your package directory:
swift package generate-static-documentation
For faster builds, use a custom scratch path:
swift package --scratch-path /tmp/build generate-static-documentation
Output
The plugin generates documentation in .build/documentation by default. Open index.html in a browser to view the documentation:
open .build/documentation/index.html
Features
-
Pure HTML/CSS output - Works as
file://URLs without a server -
Integrated workflow - Uses
swift packagelike other SPM commands -
Automatic symbol graphs - Handles the build process automatically
-
Full DocC support - Articles, tutorials, and API documentation
Topics
Essentials
Add the SPM plugin to your package for integrated documentation generation.
Configure documentation generation with command-line options.
Integration
Generate static documentation from Xcode projects and workspaces.