This directory contains the Sphinx documentation for ArrayRecord.
Install the documentation dependencies:
pip install -r requirements.txt# Using Sphinx directly
sphinx-build -b html . _build/html
# Or using the Makefile
make htmlThe generated HTML documentation will be in _build/html/. Open _build/html/index.html in your browser to view it.
For development with live reload:
# Install additional development dependencies
pip install sphinx-autobuild
# Start live reload server
sphinx-autobuild . _build/htmlThis will start a local server (usually at http://127.0.0.1:8000) that automatically rebuilds and reloads when you make changes.
Build PDF documentation (requires LaTeX):
make latexpdfCheck for broken links:
make linkcheckdocs/
├── conf.py # Sphinx configuration
├── index.rst # Main documentation index
├── installation.md # Installation guide
├── quickstart.md # Quick start guide
├── core_concepts.md # Core concepts explanation
├── performance.md # Performance optimization guide
├── examples.md # Comprehensive examples
├── beam_integration.md # Apache Beam integration guide
├── contributing.md # Contribution guidelines
├── changelog.md # Version changelog
├── python_reference.rst # Python API reference
├── beam_reference.rst # Beam API reference
├── cpp_reference.rst # C++ API reference
├── requirements.txt # Documentation dependencies
├── Makefile # Build automation
└── README.md # This file
- Use Markdown (.md) for user guides, tutorials, and narrative documentation
- Use reStructuredText (.rst) for API references and when you need advanced Sphinx features
- Use clear, concise language
- Include code examples for all features
- Provide context for when to use different options
- Link between related sections
- Keep examples up-to-date with the current API
Always include working code examples:
from array_record.python import array_record_module
# Create a writer
writer = array_record_module.ArrayRecordWriter('example.array_record')
writer.write(b'Hello, ArrayRecord!')
writer.close()Use Sphinx cross-references to link between sections:
:doc:installation`` - Link to installation.md:ref:section-label`` - Link to a labeled section:class:array_record.python.array_record_module.ArrayRecordWriter`` - Link to class
API documentation is auto-generated from docstrings. Ensure all public APIs have comprehensive docstrings:
def my_function(param1: str, param2: int = 0) -> bool:
"""Brief description of the function.
Longer description with more details about the function's behavior,
use cases, and any important considerations.
Args:
param1: Description of the first parameter.
param2: Description of the second parameter. Defaults to 0.
Returns:
Description of what the function returns.
Raises:
ValueError: Description of when this exception is raised.
Example:
>>> result = my_function("test", 42)
>>> print(result)
True
"""
pass- Check existing documentation before adding new content
- Follow the style guidelines above
- Test your changes by building the documentation locally
- Update the table of contents if adding new pages
- Check for broken links using
make linkcheck
- Create the new file (
.mdor.rst) - Add it to the appropriate
toctreeinindex.rst - Update cross-references as needed
- Test the build
API documentation is automatically generated from docstrings. To update:
- Modify the docstrings in the source code
- Rebuild the documentation
- Check that the changes appear correctly
- Import errors during build: Ensure ArrayRecord is installed in your environment
- Missing dependencies: Install requirements with
pip install -r requirements.txt - Build warnings: Address warnings as they often indicate real issues
- Broken links: Use
make linkcheckto identify and fix broken links
If you encounter issues, try a clean build:
make clean
make htmlEnable verbose output to debug issues:
sphinx-build -v -b html . _build/htmlThe documentation is typically built and deployed automatically via CI/CD. For manual deployment:
- Build the documentation:
make html - Upload the
_build/htmldirectory to your web server - Ensure proper permissions and web server configuration