|
| 1 | +<!-- code2docs:start --># code2docs |
| 2 | + |
| 3 | +    |
| 4 | +> **185** functions | **42** classes | **31** files | CC̄ = 3.8 |
| 5 | +
|
| 6 | +## Installation |
| 7 | + |
| 8 | +```bash |
| 9 | +pip install . |
| 10 | +``` |
| 11 | + |
| 12 | + |
| 13 | +## Quick Start |
| 14 | + |
| 15 | +```python |
| 16 | +# Entry point: registry.GeneratorRegistry.__init__ |
| 17 | +# Entry point: registry.GeneratorRegistry.add |
| 18 | +# Entry point: registry.GeneratorRegistry.run_all |
| 19 | +``` |
| 20 | + |
| 21 | +## API Overview |
| 22 | + |
| 23 | +### Classes |
| 24 | + |
| 25 | +- **`GeneratorRegistry`** — Registry of documentation generators. |
| 26 | +- **`Updater`** — Apply selective documentation updates based on detected changes. |
| 27 | +- **`ChangeInfo`** — Describes a detected change. |
| 28 | +- **`Differ`** — Detect changes between current source and previous state. |
| 29 | +- **`MarkdownFormatter`** — Helper for constructing Markdown documents. |
| 30 | +- **`ReadmeGenerator`** — Generate README.md from AnalysisResult. |
| 31 | +- **`CoverageGenerator`** — Generate docs/coverage.md — docstring coverage report. |
| 32 | +- **`DepGraphGenerator`** — Generate docs/dependency-graph.md with Mermaid diagrams. |
| 33 | +- **`GenerateContext`** — Shared context passed to all generators during a run. |
| 34 | +- **`BaseGenerator`** — Abstract base for all documentation generators. |
| 35 | +- **`ChangelogEntry`** — A single changelog entry. |
| 36 | +- **`ChangelogGenerator`** — Generate CHANGELOG.md from git log and analysis diff. |
| 37 | +- **`ApiReferenceGenerator`** — Generate docs/api/ — per-module API reference from signatures. |
| 38 | +- **`ModuleDocsGenerator`** — Generate docs/modules/ — detailed per-module documentation. |
| 39 | +- **`MkDocsGenerator`** — Generate mkdocs.yml from the docs/ directory structure. |
| 40 | +- **`ExamplesGenerator`** — Generate examples/ — usage examples from public API signatures. |
| 41 | +- **`ReadmeGeneratorAdapter`** |
| 42 | +- **`ApiReferenceAdapter`** |
| 43 | +- **`ModuleDocsAdapter`** |
| 44 | +- **`ArchitectureAdapter`** |
| 45 | +- **`DepGraphAdapter`** |
| 46 | +- **`CoverageAdapter`** |
| 47 | +- **`ApiChangelogAdapter`** |
| 48 | +- **`ExamplesAdapter`** |
| 49 | +- **`MkDocsAdapter`** |
| 50 | +- **`ArchitectureGenerator`** — Generate docs/architecture.md — architecture overview with diagrams. |
| 51 | +- **`ApiChange`** — A single API change between two analysis snapshots. |
| 52 | +- **`ApiChangelogGenerator`** — Generate API changelog by diffing current analysis with a saved snapshot. |
| 53 | +- **`DefaultGroup`** — Click Group that routes unknown subcommands to 'generate'. |
| 54 | +- **`ReadmeConfig`** — Configuration for README generation. |
| 55 | +- **`DocsConfig`** — Configuration for docs/ generation. |
| 56 | +- **`ExamplesConfig`** — Configuration for examples/ generation. |
| 57 | +- **`SyncConfig`** — Configuration for synchronization. |
| 58 | +- **`Code2DocsConfig`** — Main configuration for code2docs. |
| 59 | +- **`ProjectScanner`** — Wraps code2llm's ProjectAnalyzer with code2docs-specific defaults. |
| 60 | +- **`DocstringInfo`** — Parsed docstring with sections. |
| 61 | +- **`DocstringExtractor`** — Extract and parse docstrings from AnalysisResult. |
| 62 | +- **`DependencyInfo`** — Information about a project dependency. |
| 63 | +- **`ProjectDependencies`** — All detected project dependencies. |
| 64 | +- **`DependencyScanner`** — Scan and parse project dependency files. |
| 65 | +- **`Endpoint`** — Represents a detected web endpoint. |
| 66 | +- **`EndpointDetector`** — Detects web endpoints from decorator patterns in source code. |
| 67 | + |
| 68 | +### Functions |
| 69 | + |
| 70 | +- `start_watcher(project_path, config)` — Start watching project for file changes and auto-resync docs. |
| 71 | +- `generate_badges(project_name, badge_types, stats, deps)` — Generate shields.io badge Markdown strings. |
| 72 | +- `generate_toc(markdown_content, max_depth)` — Generate a table of contents from Markdown headings. |
| 73 | +- `extract_headings(content, max_depth)` — Extract headings from Markdown content. |
| 74 | +- `generate_readme(project_path, output, sections, sync_markers, config)` — Convenience function to generate a README. |
| 75 | +- `generate_docs(project_path, config)` — High-level function to generate all documentation. |
| 76 | +- `main()` — code2docs — Auto-generate project documentation from source code. |
| 77 | +- `generate(project_path, config_path, readme_only, sections, output, verbose, dry_run)` — Generate documentation (default command). |
| 78 | +- `sync(project_path, config_path, verbose, dry_run)` — Synchronize documentation with source code changes. |
| 79 | +- `watch(project_path, config_path, verbose)` — Watch for file changes and auto-regenerate docs. |
| 80 | +- `init(project_path, output)` — Initialize code2docs.yaml configuration file. |
| 81 | +- `analyze_and_document(project_path, config)` — Convenience function: analyze a project in one call. |
| 82 | + |
| 83 | +## Project Structure |
| 84 | + |
| 85 | +📄 `__main__` |
| 86 | +📦 `analyzers` |
| 87 | +📄 `analyzers.dependency_scanner` (6 functions, 3 classes) |
| 88 | +📄 `analyzers.docstring_extractor` (10 functions, 2 classes) |
| 89 | +📄 `analyzers.endpoint_detector` (3 functions, 2 classes) |
| 90 | +📄 `analyzers.project_scanner` (4 functions, 1 classes) |
| 91 | +📄 `base` (3 functions, 2 classes) |
| 92 | +📄 `cli` (10 functions, 1 classes) |
| 93 | +📦 `code2docs` (1 functions) |
| 94 | +📄 `config` (2 functions, 5 classes) |
| 95 | +📦 `formatters` |
| 96 | +📄 `formatters.badges` (2 functions) |
| 97 | +📄 `formatters.markdown` (13 functions, 1 classes) |
| 98 | +📄 `formatters.toc` (3 functions) |
| 99 | +📦 `generators` (1 functions) |
| 100 | +📄 `generators._registry_adapters` (18 functions, 9 classes) |
| 101 | +📄 `generators.api_changelog_gen` (9 functions, 2 classes) |
| 102 | +📄 `generators.api_reference_gen` (11 functions, 1 classes) |
| 103 | +📄 `generators.architecture_gen` (6 functions, 1 classes) |
| 104 | +📄 `generators.changelog_gen` (6 functions, 2 classes) |
| 105 | +📄 `generators.coverage_gen` (7 functions, 1 classes) |
| 106 | +📄 `generators.depgraph_gen` (9 functions, 1 classes) |
| 107 | +📄 `generators.examples_gen` (12 functions, 1 classes) |
| 108 | +📄 `generators.mkdocs_gen` (4 functions, 1 classes) |
| 109 | +📄 `generators.module_docs_gen` (17 functions, 1 classes) |
| 110 | +📄 `generators.readme_gen` (14 functions, 1 classes) |
| 111 | +📄 `registry` (4 functions, 1 classes) |
| 112 | +📦 `sync` |
| 113 | +📄 `sync.differ` (7 functions, 2 classes) |
| 114 | +📄 `sync.updater` (2 functions, 1 classes) |
| 115 | +📄 `sync.watcher` (1 functions) |
| 116 | + |
| 117 | + |
| 118 | +<!-- code2docs:end --> |
0 commit comments