Skip to content

Enhancement: Comprehensive Project Documentation with API Reference Generation #112

@dougborg

Description

@dougborg

Summary

Set up comprehensive documentation generation for the openapi-python-generator project itself using mkdocs or Sphinx to improve developer experience and project maintenance.

Current State

  • Project documentation exists in docs/ folder with mkdocs.yml already configured
  • Documentation includes basic usage guides and tutorials
  • Missing comprehensive API documentation for the Python codebase itself
  • No automated API reference generation from Python docstrings
  • Limited contributor documentation for codebase internals

Motivation

  • Improve developer onboarding and contribution experience
  • Document internal APIs for easier maintenance and extension
  • Provide comprehensive reference for template authors and contributors
  • Establish better documentation practices for the project

Proposed Implementation

Enhance the existing mkdocs setup to include comprehensive API documentation and improve overall documentation structure.

Goals

  1. API Documentation:

    • Generate comprehensive API reference from Python docstrings using mkdocs-gen-files or sphinx-autoapi
    • Document all public classes, functions, and modules
    • Include type hints and parameter descriptions
    • Cover language converters, model generators, and service generators
  2. Enhanced Structure:

    • Reorganize existing documentation for better navigation
    • Add comprehensive developer guide section
    • Include architecture documentation and design decisions
    • Document template system and customization options
  3. Automation:

    • Set up automated documentation builds in CI/CD
    • Generate API docs automatically from source code
    • Ensure documentation stays in sync with code changes
    • Add documentation coverage reporting

Proposed Structure

docs/
├── index.md                    # Enhanced landing page
├── quick_start.md              # Existing user guide
├── tutorial/                   # Existing tutorials
├── user-guide/                 # User-focused documentation
│   ├── authentication.md
│   ├── advanced.md
│   └── template-customization.md
├── api-reference/              # Generated API docs
│   ├── index.md
│   ├── model-generator.md
│   ├── service-generator.md
│   ├── language-converters.md
│   └── common-utilities.md
├── development/                # Developer documentation
│   ├── contributing.md
│   ├── architecture.md
│   ├── testing.md
│   └── release-process.md
└── references/                 # Existing reference material

Technical Approach

  1. mkdocs Enhancement (preferred since mkdocs.yml exists):

    • Add mkdocs-gen-files plugin for API generation
    • Use mkdocs-literate-nav for better navigation
    • Add mkdocs-section-index for landing pages
    • Include mkdocs-material for better theming
  2. Alternative Sphinx Setup:

    • Set up sphinx with autodoc extension
    • Use sphinx-autoapi for comprehensive API docs
    • Configure napoleon for Google/NumPy docstring styles
  3. CI Integration:

    • Add documentation build to GitHub Actions
    • Deploy to GitHub Pages automatically
    • Add documentation linting and link checking

Implementation Steps

  1. Phase 1: Enhance existing mkdocs setup

    • Add API generation plugins
    • Improve existing content organization
    • Set up automated builds
  2. Phase 2: Comprehensive API documentation

    • Add comprehensive docstrings to existing code
    • Generate full API reference
    • Add architectural documentation
  3. Phase 3: Advanced features

    • Add interactive examples
    • Include performance benchmarks
    • Set up documentation metrics

Dependencies

  • mkdocs with plugins (or Sphinx as alternative)
  • CI/CD pipeline updates for automated builds
  • Python docstring improvements across the codebase

Benefits

  • Improved developer experience for contributors
  • Better project maintainability
  • Professional documentation presentation
  • Easier onboarding for new contributors
  • Better discoverability of project features

Open Questions

  1. Should we enhance the existing mkdocs setup or migrate to Sphinx?
  2. What level of API documentation detail is appropriate?
  3. Should we include generated examples in the repository documentation?
  4. How to balance user documentation vs developer documentation?

Related Issues

This would establish openapi-python-generator as a well-documented, professional project and make it easier for contributors to understand and extend the codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions