Documentation
This directory contains the Sphinx documentation for the tzst library.
Setup
Install documentation dependencies:
pip install -r requirements.txt
Install the tzst package in development mode (required for autodoc):
pip install -e ..
Building Documentation
Local Development
Build the documentation locally:
# On Unix/macOS
make html
# On Windows
make.bat html
The built documentation will be in _build/html/. Open _build/html/index.html in your browser.
Live Reload (Recommended for Development)
For automatic rebuilding when files change:
# Install sphinx-autobuild if not already installed
pip install sphinx-autobuild
# Start live reload server
make livehtml
# or
sphinx-autobuild . _build/html
This will start a local server (usually at http://localhost:8000) that automatically rebuilds and refreshes when you save changes.
Other Build Targets
# Check documentation coverage
make coverage
# Check for broken links
make linkcheck
# Build PDF (requires LaTeX)
make latexpdf
# Clean build directory
make clean
Documentation Structure
index.md- Main documentation homepagequickstart.md- Quick start guide for new usersexamples.md- Practical examples and use casesapi/- API reference documentationindex.md- API overviewcore.md- Core functionality documentationcli.md- CLI documentationexceptions.md- Exception classes documentation
Writing Documentation
Markdown vs reStructuredText
This documentation uses MyST parser, which allows you to write in Markdown with some reStructuredText features. You can use either .md or .rst files.
Adding New Pages
Create a new
.mdfile in the appropriate directoryAdd it to the relevant
toctreedirective in the parent index fileUse proper Markdown headers and cross-references
API Documentation
API documentation is automatically generated from docstrings using Sphinx autodoc. To document a new module:
Add the module to the appropriate API file (e.g.,
api/core.md)Use autodoc directives like
automodule,autoclass,autofunction
Code Examples
Use fenced code blocks with language specification:
```python
from tzst import TzstArchive
with TzstArchive("example.tzst", "w") as archive:
archive.add("file.txt")
```
Cross-References
Link to other documentation pages:
See the {doc}`quickstart` guide for more information.
Link to API documentation:
Use the {class}`tzst.TzstArchive` class.
Automated Deployment
Documentation is automatically built and deployed to GitHub Pages when changes are pushed to the main branch. The workflow is defined in .github/workflows/publish_docs.yml.
Local Testing of Deployment
To test the deployment process locally:
Build the documentation:
make htmlServe the built files:
python -m http.server 8000 -d _build/htmlVisit http://localhost:8000
Troubleshooting
Import Errors
If you get import errors when building documentation:
Make sure the tzst package is installed:
pip install -e ..Check that all dependencies are installed:
pip install -r requirements.txtVerify your Python path includes the src directory
Theme Issues
If the RTD theme isn’t working:
Install the theme:
pip install sphinx-rtd-themeCheck that it’s listed in
requirements.txtVerify the theme configuration in
conf.py
Build Warnings
Address all Sphinx warnings to ensure high-quality documentation:
Fix broken cross-references
Add missing docstrings
Resolve autodoc import issues
Fix malformed markup
Contributing
When contributing to documentation:
Follow the existing style and structure
Test your changes locally before submitting
Add examples for new features
Update the changelog if appropriate
Ensure all links work correctly