Skip to main content

Auto-documentation tool that generates comprehensive README and HTML docs for any codebase.

Project description

DocGenie

Auto-documentation tool that generates README.md and HTML docs for a codebase.

Quick Guide

Installation

python3 -m pip install "docgenie"

Requirements: Python 3.10+

Setup (from source)

git clone https://github.com/ch1kim0n1/DocGenie.git
cd DocGenie
python3 -m pip install -e "."

Usage

Generate Markdown README

docgenie generate /path/to/project --format markdown

Generate HTML Documentation

docgenie generate /path/to/project --format html

Generate Both Formats

docgenie generate /path/to/project --format both

Convert Existing README to HTML

docgenie html README.md --source readme --output docs.html
# or, using the legacy convenience command:
docgenie-html README.md --source readme --output docs.html

Programmatic Usage (Python API)

from docgenie.core import CodebaseAnalyzer
from docgenie.html_generator import HTMLGenerator

analyzer = CodebaseAnalyzer('/path/to/project')
data = analyzer.analyze()

html_generator = HTMLGenerator()
html_content = html_generator.generate_from_analysis(data, "output.html")

Troubleshooting

  • Ensure all dependencies are installed
  • Check write permissions for output directory
  • Use UTF-8 encoding for source files

License

MIT License. See LICENSE file for details.

What DocGenie Analyzes

  • Project Structure: Directory tree and file organization
  • Source Code: Functions, classes, methods, and documentation
  • Dependencies: Package files (requirements.txt, package.json, etc.)
  • Configuration: Config files and project settings
  • Documentation: Existing docs and README files
  • Git Information: Repository details, branches, contributors
  • Statistics: Language distribution, code metrics
  • Version Diffs: Git ref/tag aware file-level changes
  • File Reviews: Risk-scored file and folder review cards
  • Output Links: Heuristic source-to-output file tracing
  • Impact Graph: HTML visualization of file dependency and output impact
  • Trust Badges: Section-level trust markers with source citations

Example Output

DocGenie generates README files with:

  • Project Overview: Auto-generated description and features
  • Installation Instructions: Detected from your dependency files
  • Usage Examples: Based on your code structure
  • API Documentation: Extracted from functions and classes
  • Project Structure: Visual directory tree
  • Dependencies: Organized by package manager
  • Contributing Guidelines: Standard open-source templates

Advanced Usage

Command Line Options

# Basic usage
docgenie --help                                 # Show help
docgenie generate . --verbose                   # Enable detailed output
docgenie generate . --force                     # Overwrite existing files

# Format options
docgenie generate . --format markdown           # README.md only
docgenie generate . --format html               # HTML documentation only
docgenie generate . --format both               # Generate both README.md and HTML (default)

# Output options
docgenie generate . --output custom_path        # Custom output location
docgenie generate . --preview                   # Preview without saving

# HTML converter
docgenie html README.md --source readme         # Convert README to HTML
docgenie html . --source codebase               # Generate HTML from code

# Analysis tools
docgenie analyze . --format json                # Output analysis as JSON
docgenie diff . --from-ref v1.0.0 --to-ref HEAD --format json
docgenie pr-summary . --from-ref v1.0.0 --to-ref HEAD --format markdown
docgenie init                                   # Create basic README template

# Pro documentation controls
docgenie generate . --from-ref v1.0.0 --to-ref HEAD --include-diffs
docgenie generate . --strict-readme
docgenie generate . --template-profile pro

Configuration

Create a .docgenie.yaml file in your project root:

ignore_patterns:
  - "*.log"
  - "temp/*"
  - "private/"

template_customizations:
  include_api_docs: true
  include_directory_tree: true
  max_functions_documented: 20
  include_trust_badges: true

Architecture

DocGenie consists of several key components:

  • CodebaseAnalyzer: Multi-language code analysis engine with caching and concurrency
  • ParserRegistry: Pluggable parsers (AST, tree-sitter, regex fallback) per language
  • ReadmeGenerator: Jinja2-based template rendering system for markdown
  • HTMLGenerator: Beautiful HTML documentation generator with responsive design
  • CLI Interface: Typer + Rich powered user experience

Contributing

We welcome contributions! Here's how to get started:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes and add tests
  4. Run the test suite (pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

Development Setup

git clone https://github.com/ch1kim0n1/DocGenie.git
cd DocGenie
pip install -e ".[dev]"
pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Thanks to all contributors who help improve DocGenie
  • Inspired by the need for better automated documentation tools
  • Built for the open-source community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docgenie_cli-1.1.7.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docgenie_cli-1.1.7-py3-none-any.whl (56.4 kB view details)

Uploaded Python 3

File details

Details for the file docgenie_cli-1.1.7.tar.gz.

File metadata

  • Download URL: docgenie_cli-1.1.7.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for docgenie_cli-1.1.7.tar.gz
Algorithm Hash digest
SHA256 3567b0c8af33fe2de94c6e430427cbdbca7018fdb34afd30af74bea8f8c27bc3
MD5 84427ffc290f31789abaffd217a75612
BLAKE2b-256 c5263555041a13a4cbe92a9fc69e4bddc10c36903e728e7178768082ebe35562

See more details on using hashes here.

File details

Details for the file docgenie_cli-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: docgenie_cli-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 56.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for docgenie_cli-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4b2d6cb62d4cf2a7df34f605a36ba32cfdefe84e09e7ff95e1872b15210c3887
MD5 95d4dc13fa337322b70a37a26144456f
BLAKE2b-256 f123abcffb9818ea4b3698076f21916292b53951af0a25c196fc07eae89cfb5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page