This guide explains how to set up GitHub Pages to automatically publish your pdoc-generated documentation.
- Go to your repository settings:
https://github.com/longcipher/orderly-sdk-py/settings
- Scroll down to the Pages section
- Under Source, select GitHub Actions
- Save the settings
- Go to Settings → Actions → General
- Under Workflow permissions, select Read and write permissions
- Check Allow GitHub Actions to create and approve pull requests
- Save the changes
To enable automatic PyPI publishing when you create releases:
-
Go to your PyPI account and create an API token:
- Visit: https://pypi.org/manage/account/token/
- Create a new token with scope for this project
-
Add the token to your GitHub repository secrets:
- Go to Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
PYPI_API_TOKEN
- Value: Your PyPI API token (starting with
pypi-
)
- Triggers: Push to
master
/main
, PRs, or manual dispatch - What it does:
- Checks out the code
- Sets up Python 3.13 and uv
- Installs dependencies
- Generates documentation with pdoc
- Deploys to GitHub Pages
- Triggers: Version tags (
v*
), releases, or manual dispatch - What it does:
- Builds the Python package
- Runs quality checks
- Publishes to PyPI (if secrets are configured)
After the first successful run, your documentation will be available at:
https://longcipher.github.io/orderly-sdk-py/
The documentation includes:
- Complete API reference for all modules
- Source code links
- Search functionality
- Responsive design with dark/light mode support
- Custom styling optimized for API documentation
Edit .pdoc.yml
to customize documentation generation:
- Change docstring format
- Enable/disable source code display
- Modify search settings
- Add custom footer text
Add custom CSS in .github/pdoc_templates/custom.css
for:
- Brand colors and fonts
- Layout modifications
- Additional responsive breakpoints
- Enhanced code highlighting
Modify .github/workflows/docs.yml
to:
- Change trigger conditions
- Add quality checks before deployment
- Integrate with other documentation tools
- Add notification steps
- Documentation Quality: Add comprehensive docstrings to all public methods and classes
- Version Control: Tag releases properly (
git tag v0.3.1
) to trigger publishing - Testing: Use workflow dispatch to test documentation generation manually
- Monitoring: Check the Actions tab to monitor workflow runs
Documentation not updating?
- Check if GitHub Pages is enabled and set to "GitHub Actions"
- Verify workflow permissions are set correctly
- Look at the Actions tab for error logs
PyPI publishing failing?
- Ensure
PYPI_API_TOKEN
secret is set correctly - Check if the token has the right scope
- Verify the package version is not already published
Styling not applied?
- Check if custom CSS files exist in the expected locations
- Verify HTML generation completes successfully
- Look for CSS-related errors in workflow logs
- Check workflow logs in the Actions tab
- Review pdoc documentation: https://pdoc.dev
- Open an issue if you encounter persistent problems