GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — code2docs/examples at main · semcod/code2docs

Expand file tree

/

examples

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

examples

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
01_cli_usage.py
01_cli_usage.py
 
 
02_configuration.py
02_configuration.py
 
 
03_programmatic_api.py
03_programmatic_api.py
 
 
04_sync_and_watch.py
04_sync_and_watch.py
 
 
05_custom_generators.py
05_custom_generators.py
 
 
06_formatters.py
06_formatters.py
 
 
07_web_frameworks.py
07_web_frameworks.py
 
 
README.md
README.md
 
 
advanced_usage.py
advanced_usage.py
 
 
basic_usage.py
basic_usage.py
 
 
class_examples.py
class_examples.py
 
 
entry_points.py
entry_points.py
 
 
quickstart.py
quickstart.py
 
 

README.md

Outline

code2docs Examples

This directory contains runnable examples demonstrating various features of code2docs.

Run any example

python examples/01_cli_usage.py python examples/02_configuration.py

01_cli_usage.py - CLI Usage

Learn how to use code2docs from the command line:

  • Basic documentation generation
  • Dry runs and preview mode
  • Watch mode for auto-regeneration
  • Running CLI programmatically via Python

02_configuration.py - Configuration

Set up code2docs with custom settings:

  • Programmatic configuration
  • YAML configuration files
  • Advanced configuration options

03_programmatic_api.py - Programmatic API

Use code2docs in your Python code:

  • Basic programmatic usage
  • Full documentation pipeline
  • Working with analysis results
  • Conditional documentation generation

04_sync_and_watch.py - Sync and Watch

Keep docs in sync with code changes:

  • Detecting changes
  • Incremental updates
  • File watcher with auto-regeneration
  • Git integration

05_custom_generators.py - Custom Generators

Build your own documentation generators:

  • Creating custom generators
  • Metrics report generator
  • API changelog generator
  • Extending base generator classes

06_formatters.py - Formatters and Utilities

Working with markdown formatting:

  • Markdown formatting utilities
  • Badge generation
  • Table of contents generation
  • Building complex documents

07_web_frameworks.py - Web Framework Integration

Document Flask/FastAPI endpoints:

  • Detecting endpoints
  • Generating API documentation
  • Working with Flask/FastAPI apps

Running Examples

Each example file contains runnable code. Uncomment the function calls at the bottom of each file to run them:

if __name__ == "__main__":
    # Run specific examples
    # detect_changes_example("./my_project")
    # update_docs_incrementally("./my_project")
    pass

Prerequisites

Install code2docs in your environment:

pip install code2docs

Or install from source:

pip install -e .

More Resources

  • Full Documentation
  • API Reference
  • Configuration Guide
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.