Build Documentation¶
This guide shows you how to build the Sunflare documentation locally.
Prerequisites¶
Make sure you have installed Sunflare with development dependencies.
Build with Material for MkDocs¶
You can build the documentation by running the following command from the project root:
The built documentation will be in the site/ directory. Open site/index.html in your browser to view it.
Serve Documentation Locally¶
For development, you can serve the documentation with live reload:
This will start a local server at http://localhost:8000 and automatically rebuild the documentation when you make changes.
Deploy Versioned Documentation¶
Sunflare uses mike for multi-version documentation. To deploy a new version:
# Deploy version 0.8.0 and tag it as 'latest'
uv run mike deploy 0.8.0 latest --update-aliases
# Set the default version
uv run mike set-default latest
# List all deployed versions
uv run mike list
# Serve all versions locally
uv run mike serve
The versioned documentation is deployed to the gh-pages branch and hosted on GitHub Pages.
Troubleshooting¶
Missing Dependencies¶
If you get errors about missing dependencies, make sure you've installed the development dependencies:
Port Already in Use¶
If port 8000 is already in use, you can specify a different port:
Cross-Reference Warnings¶
If you see warnings about missing cross-reference targets during build, verify that:
- The Python module/class/function exists in the codebase
- The docstring format is correct (NumPy style)
- The mkdocstrings configuration in
mkdocs.ymlis correct
Next Steps¶
- Learn how to run tests
- Read about Sunflare's architecture