Generating the Python API Reference (pdoc)
The API reference documentation for Python projects in the Firestone ecosystem (like firestone and firestone-lib) is generated using pdoc. pdoc automatically creates clean, modern, and readable documentation from your Python docstrings and type hints.
Generation Workflow
The website project contains a Makefile command to automate this process. The command runs pdoc on the firestone source code and places the output directly into the correct location for the Hugo build system.
How to Run the Generator
-
Navigate to the
websitedirectory:cd website/ -
Run the
makecommand:make prepare-firestone-api
What This Command Does
This command executes a script that performs the following steps:
- Invokes
pdoctargeting thefirestonePython package. - Specifies an output directory:
docs/site/content/api-reference/. - Tells
pdocto output in Markdown format, which is suitable for Hugo. - The generated markdown will likely be a file named
reference.md, which contains the documentation for all modules in thefirestonepackage.
As CLAUDE.md notes, this process is optional if pdoc is not installed, but it is the standard way to keep the API reference up-to-date.
Prerequisites
For the generation to work, you must have the necessary tools installed.
- Poetry: The Python projects are managed with Poetry.
pdocwill be run within the project's Poetry environment to ensure it has access to the source code and all its dependencies. pdoc: Thepdocpackage must be installed in the relevant Python environment. It is listed as a development dependency in thefirestoneproject'spyproject.toml. Runningpoetry installin thefirestone/directory should install it for you.
Previewing the API Reference
After you run make prepare-firestone-api, you can preview the generated documentation by running the Hugo server:
# Still in the website/ directory
make serve
Navigate to http://localhost:1313 and find the "API Reference" section in the documentation to see the rendered output. This allows you to verify that your docstrings and type hints have been rendered correctly before you commit your changes.