Contributing to Documentationο
This guide explains how to contribute to the APIFromAnything documentation.
Documentation Structureο
The documentation is built using Sphinx with the Read the Docs theme. The source files are written in Markdown and are located in the docs/ directory.
Setting Up the Documentation Environmentο
To build the documentation locally, follow these steps:
Install the documentation dependencies:
pip install -e .[docs]
Navigate to the docs directory:
cd docs
Build the documentation:
sphinx-build -b html . _build/html
Open the generated documentation in your browser:
# On Linux/macOS open _build/html/index.html # On Windows start _build/html/index.html
Writing Documentationο
File Formatο
Documentation files are written in Markdown (.md) format. Sphinx uses the MyST parser to convert Markdown to reStructuredText.
Adding a New Pageο
To add a new documentation page:
Create a new Markdown file in the
docs/directory.Add the file to the table of contents in
docs/index.md.
Code Examplesο
Code examples should be formatted with syntax highlighting:
from apifrom import API
app = API(title="Example API")
@app.add_route("/hello/{name}")
def hello(request):
name = request.path_params.get("name", "world")
return {"message": f"Hello, {name}!"}
if __name__ == "__main__":
app.run()
Cross-Referencesο
You can link to other documentation pages using Markdown links:
See the [Getting Started](getting_started.md) guide for more information.
Documentation Deploymentο
The documentation is automatically built and deployed to Read the Docs when changes are pushed to the main branch.
The deployment process is handled by:
GitHub Actions workflow (
.github/workflows/readthedocs.yml) - Builds the documentation and triggers a Read the Docs buildRead the Docs configuration (
.readthedocs.yml) - Configures how Read the Docs builds the documentation
Documentation Style Guideο
Use clear, concise language
Include code examples for complex concepts
Break up long sections with headings
Use lists and tables to organize information
Include diagrams where appropriate
Explain the βwhyβ as well as the βhowβ
Getting Helpο
If you need help with the documentation, please open an issue on GitHub or reach out to the maintainers.