This directory contains runnable examples demonstrating various features of code2docs.
# Run any example
python examples/01_cli_usage.py
python examples/02_configuration.py
# etc.Learn how to use code2docs from the command line:
- Basic documentation generation
- Dry runs and preview mode
- Watch mode for auto-regeneration
- Running CLI programmatically via Python
Set up code2docs with custom settings:
- Programmatic configuration
- YAML configuration files
- Advanced configuration options
Use code2docs in your Python code:
- Basic programmatic usage
- Full documentation pipeline
- Working with analysis results
- Conditional documentation generation
Keep docs in sync with code changes:
- Detecting changes
- Incremental updates
- File watcher with auto-regeneration
- Git integration
Build your own documentation generators:
- Creating custom generators
- Metrics report generator
- API changelog generator
- Extending base generator classes
Working with markdown formatting:
- Markdown formatting utilities
- Badge generation
- Table of contents generation
- Building complex documents
Document Flask/FastAPI endpoints:
- Detecting endpoints
- Generating API documentation
- Working with Flask/FastAPI apps
Each example file contains runnable code. Uncomment the function calls at the bottom of each file to run them:
if __name__ == "__main__":
# Run specific examples
# detect_changes_example("./my_project")
# update_docs_incrementally("./my_project")
passInstall code2docs in your environment:
pip install code2docsOr install from source:
pip install -e .