Quickstart: doc gen
Generate comprehensive documentation from your codebase using AI-powered analysis.
from attune.workflows.document_gen import DocumentGenerationWorkflow
workflow = DocumentGenerationWorkflow()
result = workflow.execute(path="./src")
print(result.output)
Prerequisites
- Python environment with the attune package installed
- Source code directory you want to document
Generate your first documentation
- Create a workflow instance and point it at your source code:
from attune.workflows.document_gen import DocumentGenerationWorkflow
workflow = DocumentGenerationWorkflow()
result = workflow.execute(path="./your-project-directory")
- Review the generated documentation structure:
print(result.output)
# Output includes:
# - Summary: Overview of your codebase
# - Outline: Documentation structure
# - Documentation: Full content with API references
# - Suggestions: Improvement recommendations
- Format the output for human reading:
from attune.workflows.document_gen import format_doc_gen_report
report = format_doc_gen_report(result.raw_data, {"path": "./your-project-directory"})
print(report)
Expected output: A structured markdown document with sections for summary, outline, detailed documentation, and improvement suggestions for your codebase.
Next: Save the generated documentation to a file and integrate it into your project's docs folder.