Skip to content

[FEATURE] Implement automated code documentation extraction and integration #23

@najeed

Description

@najeed

Is your feature request related to a problem? Please describe.
With new source files being added regularly, manually documenting code modules, classes, and functions is becoming time-consuming and error-prone. Documentation often lags behind code changes, leading to outdated or missing API documentation.

Describe the solution you'd like
An automated code documentation extraction system that:

  1. Automated API Documentation

    • Extract docstrings from all Python modules
    • Generate formatted API reference pages
    • Create cross-references between modules
    • Include usage examples from docstrings
  2. Code Analysis and Documentation

    • Generate module dependency graphs
    • Extract and document public interfaces
    • Identify and document configuration options
    • Create class hierarchy documentation
  3. Integration Pipeline

Implementation Approach

# Code documentation extraction
python scripts/extract_code_docs.py --module eval_runner
python scripts/extract_code_docs.py --all-modules
python scripts/generate_api_reference.py

# Integration with main documentation
python scripts/integrate_docs.py --code-docs --guides-docs

Expected Output

/docs/guides/api/
├── modules/
│   ├── eval_runner.md           # Main module documentation
│   ├── agents.md                # Agent interfaces
│   ├── metrics.md               # Metrics system
│   └── utils.md                 # Utility functions
├── classes/
│   ├── EvaluationRunner.md      # Class documentation
│   ├── BaseAgent.md             # Interface documentation
│   └── ScenarioLoader.md        # Component documentation
└── reference/
    ├── configuration.md         # Config options
    ├── exceptions.md            # Error handling
    └── changelog.md             # API changes

Technical Requirements

  • Python AST parsing for code analysis
  • Sphinx-style docstring parsing
  • Markdown generation with cross-references
  • Integration with existing documentation workflow
  • Git integration for change detection

Acceptance Criteria

  • Automated extraction of all public APIs
  • Formatted API reference documentation
  • Cross-references between related modules
  • Integration with main documentation system
  • CI/CD pipeline updates docs automatically
  • Validation of documentation completeness
  • Change detection and incremental updates

Benefits

  • Always current API documentation
  • Reduced manual documentation burden
  • Consistent formatting and structure
  • Better discoverability of APIs
  • Automated validation of documentation completeness

Additional Context
This complements Issue #1 by focusing specifically on code documentation extraction, while Issue #1 handles higher-level guide generation.

Estimated Effort

  • Medium (1 week)

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions