Skip to content

[Feature] Implement auto-generated documentation with versioning and CI/CD publishing #28

Description

@Sinitca-Aleksandr

Problem Statement

Currently, our project lacks comprehensive, up-to-date documentation that automatically reflects code changes. Manual documentation maintenance leads to outdated information, increased onboarding time for new developers, and reduced API discoverability.

Goal

Establish an automated documentation pipeline that:

  • Generates documentation from source code docstrings (Sphinx) with appearance like https://seaborn.pydata.org/tutorial.html
  • Publishes to GitHub Pages via CI/CD
  • Supports multiple versions of the project
  • Provides static pages for non-code content (architecture, guides, etc.)

Acceptance Criteria

Core Requirements

  • Sphinx configuration is set up in repository root
  • Docstrings follow Google or NumPy style guide (documented in CONTRIBUTING.md)
  • CI/CD pipeline triggers documentation build on:
    • Pull request to main branch (preview)
    • Push to release tags (versioned docs)
  • Documentation is published to GitHub Pages (gh-pages branch or /docs folder)
  • Version selector UI is available in generated docs

Technical Requirements

  • Sphinx dependencies pinned in requirements.txt or pyproject.toml
  • .github/workflows/docs.yml workflow file created
  • docs/ directory structure with:
    • conf.py (Sphinx configuration)
    • index.rst (main entry point)
    • versions.rst or _static/versioning.js for version switching
    • api/, guides/, architecture/ subdirectories
  • GitHub Pages enabled in repository settings

Quality Requirements

  • Build fails if documentation generation errors occur (fail-fast)
  • Preview deployment available on PRs (optional: use Netlify/Vercel for faster previews)
  • Linting/checks run on docstring quality (e.g., pydocstyle, flake8-docstrings)

Implementation Plan

Phase 1: Foundation

  1. Install and configure Sphinx in project dependencies
  2. Create basic docs/ directory structure with conf.py
  3. Generate initial API documentation from existing docstrings
  4. Test local build process

Phase 2: CI/CD Integration

  1. Create .github/workflows/docs.yml workflow
  2. Configure GitHub Pages deployment in workflow
  3. Set up version tagging strategy for docs (e.g., based on release/* tags)
  4. Test PR preview and production publish flows

Phase 3: Versioning & Enhancement

  1. Implement version selector using Sphinx-RTD or custom solution
  2. Add static pages for architecture, onboarding guides, API reference
  3. Document contribution guidelines for docstring standards
  4. Final review and stakeholder sign-off

Technical Considerations

Tooling Options

Component Recommended Alternative Notes
Documentation Generator Sphinx MkDocs, Pydoc Sphinx has best versioning support
Versioning Plugin sphinx-multiversion ReadTheDocs RTD offers managed hosting
CI/CD Platform GitHub Actions Already integrated with GH Pages

Versioning Strategy

  • Tag-based: Each release tag (vX.Y.Z) triggers versioned docs build
  • Branch-based: main → latest dev docs; tags → stable versions
  • Storage: All versions published to /docs/{version}/ on GitHub Pages

Docstring Standards

Adopt one of:

  • Google Style (recommended for Python): Clear, readable, widely adopted
  • Document choice in CONTRIBUTING.md with examples

Testing Checklist

  • Local documentation builds without errors
  • CI workflow triggers on PR and tag events
  • GitHub Pages URL accessible (https://.github.io//)
  • Version selector displays correctly across browsers
  • Broken links detected via sphinx-build -W flag
  • Mobile-responsive layout verified

Success Metrics

Metric Target Measurement Method
Documentation build time < 5 minutes CI/CD workflow logs
Docstring coverage > 80% of public API coverage.py + Sphinx
Broken links 0 critical, < 3 minor Link checker tool
Onboarding time reduction 25% faster Survey new developers

Risks & Mitigations

Risk Impact Mitigation
Build failures block releases High Run docs build in separate job; don't fail PRs on doc warnings
Version selector complexity Medium Start with simple RTD theme, enhance later
Docstring quality inconsistency Medium Add pre-commit hook for linting

Notes for Implementer

  1. Start small: Get basic docs working before adding versioning complexity
  2. Document the process: Include setup instructions in README.md or DEVELOPMENT.md
  3. Consider future needs: Will we need multi-language support? Search functionality?
  4. Review existing projects: Look at how similar Python projects handle this (e.g., requests, pytest)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    Status
    Available Items

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions