@@ -139,6 +139,189 @@ Content outside the markers is preserved when regenerating. Enable this with `sy
139139
140140## Architecture
141141
142+ ```
143+ code2docs/
144+ ├── registry├── llm_helper├── code2docs/ ├── updater├── sync/ ├── watcher ├── differ ├── quickstart ├── advanced_usage ├── markdown ├── badges├── base├── formatters/ ├── toc ├── coverage_gen ├── _source_links ├── readme_gen ├── depgraph_gen ├── config_docs_gen ├── getting_started_gen ├── changelog_gen├── generators/ ├── code2llm_gen ├── module_docs_gen ├── api_reference_gen ├── mkdocs_gen ├── examples_gen ├── _registry_adapters ├── api_changelog_gen ├── contributing_gen ├── architecture_gen├── analyzers/├── cli├── config ├── project_scanner ├── dependency_scanner ├── docstring_extractor ├── endpoint_detector```
145+
146+ ## API Overview
147+
148+ ### Classes
149+
150+ - **`GeneratorRegistry`** — Registry of documentation generators.
151+ - **`LLMHelper`** — Thin wrapper around litellm for documentation generation.
152+ - **`Updater`** — Apply selective documentation updates based on detected changes.
153+ - **`ChangeInfo`** — Describes a detected change.
154+ - **`Differ`** — Detect changes between current source and previous state.
155+ - **`MarkdownFormatter`** — Helper for constructing Markdown documents.
156+ - **`GenerateContext`** — Shared context passed to all generators during a run.
157+ - **`BaseGenerator`** — Abstract base for all documentation generators.
158+ - **`CoverageGenerator`** — Generate docs/coverage.md — docstring coverage report.
159+ - **`SourceLinker`** — Build source-code links (relative paths + optional GitHub/GitLab URLs).
160+ - **`ReadmeGenerator`** — Generate README.md from AnalysisResult.
161+ - **`DepGraphGenerator`** — Generate docs/dependency-graph.md with Mermaid diagrams.
162+ - **`ConfigDocsGenerator`** — Generate docs/configuration.md from Code2DocsConfig dataclass.
163+ - **`GettingStartedGenerator`** — Generate docs/getting-started.md from entry points and dependencies.
164+ - **`ChangelogEntry`** — A single changelog entry.
165+ - **`ChangelogGenerator`** — Generate CHANGELOG.md from git log and analysis diff.
166+ - **`Code2LlmGenerator`** — Generate code2llm analysis files in project/ directory.
167+ - **`ModuleDocsGenerator`** — Generate docs/modules.md — consolidated module documentation.
168+ - **`ApiReferenceGenerator`** — Generate docs/api.md — consolidated API reference.
169+ - **`MkDocsGenerator`** — Generate mkdocs.yml from the docs/ directory structure.
170+ - **`ExamplesGenerator`** — Generate examples/ — usage examples from public API signatures.
171+ - **`ReadmeGeneratorAdapter`** — —
172+ - **`ApiReferenceAdapter`** — —
173+ - **`ModuleDocsAdapter`** — —
174+ - **`ArchitectureAdapter`** — —
175+ - **`DepGraphAdapter`** — —
176+ - **`CoverageAdapter`** — —
177+ - **`ApiChangelogAdapter`** — —
178+ - **`ExamplesAdapter`** — —
179+ - **`MkDocsAdapter`** — —
180+ - **`GettingStartedAdapter`** — —
181+ - **`ConfigDocsAdapter`** — —
182+ - **`ContributingAdapter`** — —
183+ - **`Code2LlmAdapter`** — Adapter for code2llm analysis generation.
184+ - **`ApiChange`** — A single API change between two analysis snapshots.
185+ - **`ApiChangelogGenerator`** — Generate API changelog by diffing current analysis with a saved snapshot.
186+ - **`ContributingGenerator`** — Generate CONTRIBUTING.md by detecting dev tools from pyproject.toml.
187+ - **`ArchitectureGenerator`** — Generate docs/architecture.md — architecture overview with diagrams.
188+ - **`DefaultGroup`** — Click Group that routes unknown subcommands to 'generate'.
189+ - **`ReadmeConfig`** — Configuration for README generation.
190+ - **`DocsConfig`** — Configuration for docs/ generation.
191+ - **`ExamplesConfig`** — Configuration for examples/ generation.
192+ - **`SyncConfig`** — Configuration for synchronization.
193+ - **`Code2LlmConfig`** — Configuration for code2llm analysis generation.
194+ - **`LLMConfig`** — Configuration for optional LLM-assisted documentation generation.
195+ - **`Code2DocsConfig`** — Main configuration for code2docs.
196+ - **`ProjectScanner`** — Wraps code2llm's ProjectAnalyzer with code2docs-specific defaults.
197+ - **`DependencyInfo`** — Information about a project dependency.
198+ - **`ProjectDependencies`** — All detected project dependencies.
199+ - **`DependencyScanner`** — Scan and parse project dependency files.
200+ - **`DocstringInfo`** — Parsed docstring with sections.
201+ - **`DocstringExtractor`** — Extract and parse docstrings from AnalysisResult.
202+ - **`Endpoint`** — Represents a detected web endpoint.
203+ - **`EndpointDetector`** — Detects web endpoints from decorator patterns in source code.
204+
205+ ### Functions
206+
207+ - `start_watcher(project_path, config)` — Start watching project for file changes and auto-resync docs.
208+ - `generate_badges(project_name, badge_types, stats, deps)` — Generate shields.io badge Markdown strings.
209+ - `generate_toc(markdown_content, max_depth)` — Generate a table of contents from Markdown headings.
210+ - `extract_headings(content, max_depth)` — Extract headings from Markdown content.
211+ - `generate_readme(project_path, output, sections, sync_markers)` — Convenience function to generate a README.
212+ - `generate_docs(project_path, config)` — High-level function to generate all documentation.
213+ - `parse_gitignore(project_path)` — Parse .gitignore file and return list of patterns to exclude.
214+ - `generate_code2llm_analysis(project_path, config)` — Convenience function to generate code2llm analysis.
215+ - `main()` — code2docs — Auto-generate project documentation from source code.
216+ - `generate(project_path, config_path, readme_only, sections)` — Generate documentation (default command).
217+ - `sync(project_path, config_path, verbose, dry_run)` — Synchronize documentation with source code changes.
218+ - `watch(project_path, config_path, verbose)` — Watch for file changes and auto-regenerate docs.
219+ - `init(project_path, output)` — Initialize code2docs.yaml configuration file.
220+ - `check(project_path, config_path, target)` — Health check — verify documentation completeness.
221+ - `diff(project_path, config_path)` — Preview what would change without writing anything.
222+ - `analyze_and_document(project_path, config)` — Convenience function: analyze a project in one call.
223+
224+
225+ ## Project Structure
226+
227+ 📄 `__main__`
228+ 📦 `analyzers`
229+ 📄 `analyzers.dependency_scanner` (6 functions, 3 classes)
230+ 📄 `analyzers.docstring_extractor` (10 functions, 2 classes)
231+ 📄 `analyzers.endpoint_detector` (3 functions, 2 classes)
232+ 📄 `analyzers.project_scanner` (4 functions, 1 classes)
233+ 📄 `base` (3 functions, 2 classes)
234+ 📄 `cli` (14 functions, 1 classes)
235+ 📦 `code2docs` (1 functions)
236+ 📄 `config` (5 functions, 7 classes)
237+ 📄 `examples.advanced_usage`
238+ 📄 `examples.quickstart`
239+ 📦 `formatters`
240+ 📄 `formatters.badges` (2 functions)
241+ 📄 `formatters.markdown` (13 functions, 1 classes)
242+ 📄 `formatters.toc` (3 functions)
243+ 📦 `generators` (1 functions)
244+ 📄 `generators._registry_adapters` (26 functions, 13 classes)
245+ 📄 `generators._source_links` (6 functions, 1 classes)
246+ 📄 `generators.api_changelog_gen` (9 functions, 2 classes)
247+ 📄 `generators.api_reference_gen` (7 functions, 1 classes)
248+ 📄 `generators.architecture_gen` (10 functions, 1 classes)
249+ 📄 `generators.changelog_gen` (6 functions, 2 classes)
250+ 📄 `generators.code2llm_gen` (6 functions, 1 classes)
251+ 📄 `generators.config_docs_gen` (4 functions, 1 classes)
252+ 📄 `generators.contributing_gen` (8 functions, 1 classes)
253+ 📄 `generators.coverage_gen` (7 functions, 1 classes)
254+ 📄 `generators.depgraph_gen` (9 functions, 1 classes)
255+ 📄 `generators.examples_gen` (14 functions, 1 classes)
256+ 📄 `generators.getting_started_gen` (8 functions, 1 classes)
257+ 📄 `generators.mkdocs_gen` (4 functions, 1 classes)
258+ 📄 `generators.module_docs_gen` (9 functions, 1 classes)
259+ 📄 `generators.readme_gen` (18 functions, 1 classes)
260+ 📄 `llm_helper` (7 functions, 1 classes)
261+ 📄 `registry` (4 functions, 1 classes)
262+ 📦 `sync`
263+ 📄 `sync.differ` (7 functions, 2 classes)
264+ 📄 `sync.updater` (2 functions, 1 classes)
265+ 📄 `sync.watcher` (1 functions)
266+
267+ ## Requirements
268+
269+
270+
271+ ## Contributing
272+
273+ **Contributors:**
274+ - Tom Softreck <tom@sapletta.com>
275+ - Tom Sapletta <tom-sapletta-com@users.noreply.github.com>
276+
277+ We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
278+
279+ ### Development Setup
280+
281+ ```bash
282+ # Clone the repository
283+ git clone https://github.com/wronai/code2docs
284+ cd code2docs
285+
286+ # Install in development mode
287+ pip install -e ".[dev]"
288+
289+ # Run tests
290+ pytest
291+ ```
292+
293+ ## Documentation
294+
295+ - 📖 [ Full Documentation] ( https://github.com/wronai/code2docs/tree/main/docs ) — API reference, module docs, architecture
296+ - 🚀 [ Getting Started] ( https://github.com/wronai/code2docs/blob/main/docs/getting-started.md ) — Quick start guide
297+ - 📚 [ API Reference] ( https://github.com/wronai/code2docs/blob/main/docs/api.md ) — Complete API documentation
298+ - 🔧 [ Configuration] ( https://github.com/wronai/code2docs/blob/main/docs/configuration.md ) — Configuration options
299+ - 💡 [ Examples] ( ./examples ) — Usage examples and code samples
300+
301+ ### Generated Files
302+
303+ | Output | Description | Link |
304+ | --------| -------------| ------|
305+ | ` README.md ` | Project overview (this file) | — |
306+ | ` docs/api.md ` | Consolidated API reference | [ View] ( ./docs/api.md ) |
307+ | ` docs/modules.md ` | Module reference with metrics | [ View] ( ./docs/modules.md ) |
308+ | ` docs/architecture.md ` | Architecture with diagrams | [ View] ( ./docs/architecture.md ) |
309+ | ` docs/dependency-graph.md ` | Dependency graphs | [ View] ( ./docs/dependency-graph.md ) |
310+ | ` docs/coverage.md ` | Docstring coverage report | [ View] ( ./docs/coverage.md ) |
311+ | ` docs/getting-started.md ` | Getting started guide | [ View] ( ./docs/getting-started.md ) |
312+ | ` docs/configuration.md ` | Configuration reference | [ View] ( ./docs/configuration.md ) |
313+ | ` docs/api-changelog.md ` | API change tracking | [ View] ( ./docs/api-changelog.md ) |
314+ | ` CONTRIBUTING.md ` | Contribution guidelines | [ View] ( ./CONTRIBUTING.md ) |
315+ | ` examples/ ` | Usage examples | [ Browse] ( ./examples ) |
316+ | ` mkdocs.yml ` | MkDocs configuration | — |
317+
318+ <!-- code2docs:end -->
319+ ```
320+
321+ Content outside the markers is preserved when regenerating. Enable this with `sync_markers: true` in your configuration.
322+
323+ ## Architecture
324+
142325```
143326code2docs/
144327├── registry├── llm_helper├── code2docs/ ├── updater├── sync/ ├── watcher ├── differ ├── quickstart ├── advanced_usage ├── markdown ├── badges ├── toc├── formatters/├── base ├── readme_gen ├── coverage_gen ├── _ source_links ├── depgraph_gen ├── getting_started_gen ├── config_docs_gen ├── changelog_gen├── generators/ ├── code2llm_gen ├── module_docs_gen ├── api_reference_gen ├── mkdocs_gen ├── _ registry_adapters ├── examples_gen ├── api_changelog_gen ├── contributing_gen ├── architecture_gen├── analyzers/├── cli├── config ├── project_scanner ├── docstring_extractor ├── dependency_scanner ├── endpoint_detector```
0 commit comments