code2docs 3.0.20__tar.gz → 3.0.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {code2docs-3.0.20 → code2docs-3.0.21}/PKG-INFO +3 -3
- {code2docs-3.0.20 → code2docs-3.0.21}/README.md +2 -2
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/__init__.py +1 -1
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/_registry_adapters.py +158 -4
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/PKG-INFO +3 -3
- {code2docs-3.0.20 → code2docs-3.0.21}/pyproject.toml +1 -1
- {code2docs-3.0.20 → code2docs-3.0.21}/LICENSE +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/__main__.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/analyzers/__init__.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/analyzers/dependency_scanner.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/analyzers/docstring_extractor.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/analyzers/endpoint_detector.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/analyzers/project_scanner.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/base.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/cli.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/config.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/examples/advanced_usage.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/examples/quickstart.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/formatters/__init__.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/formatters/badges.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/formatters/markdown.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/formatters/toc.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/__init__.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/_source_links.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/api_changelog_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/api_reference_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/architecture_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/changelog_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/code2llm_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/config_docs_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/contributing_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/coverage_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/depgraph_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/examples_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/getting_started_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/mkdocs_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/module_docs_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/org_readme_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/generators/readme_gen.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/llm_helper.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/registry.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/sync/__init__.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/sync/differ.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/sync/updater.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/sync/watcher.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/api_module.md.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/architecture.md.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/example_usage.py.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/index.md.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/module_doc.md.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs/templates/readme.md.j2 +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/SOURCES.txt +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/dependency_links.txt +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/entry_points.txt +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/requires.txt +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/code2docs.egg-info/top_level.txt +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/setup.cfg +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_analyzers.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_cli.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_code2docs.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_config.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_formatters.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_generators.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_llm_helper.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_registry.py +0 -0
- {code2docs-3.0.20 → code2docs-3.0.21}/tests/test_sync.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2docs
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.21
|
|
4
4
|
Summary: Auto-generate and sync project documentation from source code analysis
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -50,7 +50,7 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
# code2docs
|
|
52
52
|
|
|
53
|
-
  
|
|
54
54
|
|
|
55
55
|
> Auto-generate and sync project documentation from source code analysis.
|
|
56
56
|
|
|
@@ -190,7 +190,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
190
190
|
```markdown
|
|
191
191
|
<!-- code2docs:start --># code2docs
|
|
192
192
|
|
|
193
|
-
   
|
|
194
194
|
> **276** functions | **57** classes | **51** files | CC̄ = 3.8
|
|
195
195
|
|
|
196
196
|
> Auto-generated project documentation from source code analysis.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# code2docs
|
|
2
2
|
|
|
3
|
-
  
|
|
4
4
|
|
|
5
5
|
> Auto-generate and sync project documentation from source code analysis.
|
|
6
6
|
|
|
@@ -140,7 +140,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
140
140
|
```markdown
|
|
141
141
|
<!-- code2docs:start --># code2docs
|
|
142
142
|
|
|
143
|
-
   
|
|
144
144
|
> **276** functions | **57** classes | **51** files | CC̄ = 3.8
|
|
145
145
|
|
|
146
146
|
> Auto-generated project documentation from source code analysis.
|
|
@@ -5,7 +5,7 @@ Uses code2llm's AnalysisResult to produce human-readable documentation:
|
|
|
5
5
|
README.md, API references, module docs, examples, and architecture diagrams.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "3.0.
|
|
8
|
+
__version__ = "3.0.21"
|
|
9
9
|
__author__ = "Tom Sapletta"
|
|
10
10
|
|
|
11
11
|
from .config import Code2DocsConfig
|
|
@@ -250,25 +250,178 @@ class OrgReadmeAdapter(BaseGenerator):
|
|
|
250
250
|
|
|
251
251
|
def run(self, ctx: GenerateContext) -> Optional[str]:
|
|
252
252
|
from .org_readme_gen import OrgReadmeGenerator
|
|
253
|
-
|
|
253
|
+
|
|
254
254
|
org_name = getattr(self.config, 'org_name', '')
|
|
255
255
|
if not org_name:
|
|
256
256
|
return None
|
|
257
|
-
|
|
257
|
+
|
|
258
258
|
gen = OrgReadmeGenerator(self.config, str(ctx.project), org_name)
|
|
259
259
|
content = gen.generate()
|
|
260
|
-
|
|
260
|
+
|
|
261
261
|
if ctx.dry_run:
|
|
262
262
|
click.echo(f"\n--- {org_name} README ({len(content)} chars) ---")
|
|
263
263
|
preview = content[:500] + "..." if len(content) > 500 else content
|
|
264
264
|
click.echo(preview)
|
|
265
265
|
return None
|
|
266
|
-
|
|
266
|
+
|
|
267
267
|
readme_path = ctx.docs_dir / "README.md"
|
|
268
268
|
gen.write(str(readme_path), content)
|
|
269
269
|
return f"✅ {readme_path.relative_to(ctx.project)}"
|
|
270
270
|
|
|
271
271
|
|
|
272
|
+
class IndexHtmlAdapter(BaseGenerator):
|
|
273
|
+
"""Adapter for generating index.html for GitHub Pages browsing."""
|
|
274
|
+
name = "index_html"
|
|
275
|
+
|
|
276
|
+
def should_run(self, *, readme_only: bool = False) -> bool:
|
|
277
|
+
return not readme_only
|
|
278
|
+
|
|
279
|
+
def run(self, ctx: GenerateContext) -> Optional[str]:
|
|
280
|
+
if ctx.dry_run:
|
|
281
|
+
return "[dry-run] docs/index.html"
|
|
282
|
+
|
|
283
|
+
content = self._generate_html(ctx)
|
|
284
|
+
(ctx.docs_dir / "index.html").write_text(content, encoding="utf-8")
|
|
285
|
+
return "✅ docs/index.html"
|
|
286
|
+
|
|
287
|
+
def _generate_html(self, ctx: GenerateContext) -> str:
|
|
288
|
+
project_name = self.config.project_name or ctx.project.name
|
|
289
|
+
repo_url = self.config.repo_url
|
|
290
|
+
|
|
291
|
+
files = []
|
|
292
|
+
if (ctx.docs_dir / "README.md").exists():
|
|
293
|
+
files.append(("README.md", "Project Overview", "📖"))
|
|
294
|
+
if (ctx.docs_dir / "getting-started.md").exists():
|
|
295
|
+
files.append(("getting-started.md", "Getting Started", "🚀"))
|
|
296
|
+
if (ctx.docs_dir / "api.md").exists():
|
|
297
|
+
files.append(("api.md", "API Reference", "📚"))
|
|
298
|
+
if (ctx.docs_dir / "modules.md").exists():
|
|
299
|
+
files.append(("modules.md", "Module Documentation", "📦"))
|
|
300
|
+
if (ctx.docs_dir / "architecture.md").exists():
|
|
301
|
+
files.append(("architecture.md", "Architecture", "🏗️"))
|
|
302
|
+
if (ctx.docs_dir / "dependency-graph.md").exists():
|
|
303
|
+
files.append(("dependency-graph.md", "Dependency Graph", "🔗"))
|
|
304
|
+
if (ctx.docs_dir / "coverage.md").exists():
|
|
305
|
+
files.append(("coverage.md", "Code Coverage", "📊"))
|
|
306
|
+
if (ctx.docs_dir / "api-changelog.md").exists():
|
|
307
|
+
files.append(("api-changelog.md", "API Changelog", "📝"))
|
|
308
|
+
if (ctx.docs_dir / "configuration.md").exists():
|
|
309
|
+
files.append(("configuration.md", "Configuration", "⚙️"))
|
|
310
|
+
if (ctx.docs_dir / "CONTRIBUTING.md").exists():
|
|
311
|
+
files.append(("CONTRIBUTING.md", "Contributing Guide", "🤝"))
|
|
312
|
+
if (ctx.docs_dir / "examples").is_dir():
|
|
313
|
+
files.append(("examples/", "Examples", "💡"))
|
|
314
|
+
|
|
315
|
+
github_link = f'<a href="{repo_url}" class="github-link" target="_blank" rel="noopener">View on GitHub</a>' if repo_url else ""
|
|
316
|
+
|
|
317
|
+
files_html = "\n".join(
|
|
318
|
+
f'<a href="{href}" class="doc-card"><span class="icon">{icon}</span><span class="title">{title}</span></a>'
|
|
319
|
+
for href, title, icon in files
|
|
320
|
+
)
|
|
321
|
+
|
|
322
|
+
return f'''<!DOCTYPE html>
|
|
323
|
+
<html lang="en">
|
|
324
|
+
<head>
|
|
325
|
+
<meta charset="UTF-8">
|
|
326
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
327
|
+
<title>{project_name} - Documentation</title>
|
|
328
|
+
<style>
|
|
329
|
+
* {{ margin: 0; padding: 0; box-sizing: border-box; }}
|
|
330
|
+
body {{
|
|
331
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
|
|
332
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
333
|
+
min-height: 100vh;
|
|
334
|
+
padding: 40px 20px;
|
|
335
|
+
}}
|
|
336
|
+
.container {{
|
|
337
|
+
max-width: 900px;
|
|
338
|
+
margin: 0 auto;
|
|
339
|
+
}}
|
|
340
|
+
.header {{
|
|
341
|
+
text-align: center;
|
|
342
|
+
margin-bottom: 40px;
|
|
343
|
+
color: white;
|
|
344
|
+
}}
|
|
345
|
+
.header h1 {{
|
|
346
|
+
font-size: 2.5rem;
|
|
347
|
+
margin-bottom: 10px;
|
|
348
|
+
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
|
349
|
+
}}
|
|
350
|
+
.header p {{
|
|
351
|
+
font-size: 1.1rem;
|
|
352
|
+
opacity: 0.9;
|
|
353
|
+
}}
|
|
354
|
+
.github-link {{
|
|
355
|
+
display: inline-block;
|
|
356
|
+
margin-top: 15px;
|
|
357
|
+
padding: 10px 20px;
|
|
358
|
+
background: rgba(255,255,255,0.2);
|
|
359
|
+
color: white;
|
|
360
|
+
text-decoration: none;
|
|
361
|
+
border-radius: 25px;
|
|
362
|
+
transition: background 0.3s;
|
|
363
|
+
}}
|
|
364
|
+
.github-link:hover {{ background: rgba(255,255,255,0.3); }}
|
|
365
|
+
.docs-grid {{
|
|
366
|
+
display: grid;
|
|
367
|
+
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
|
|
368
|
+
gap: 20px;
|
|
369
|
+
}}
|
|
370
|
+
.doc-card {{
|
|
371
|
+
background: white;
|
|
372
|
+
border-radius: 12px;
|
|
373
|
+
padding: 25px;
|
|
374
|
+
text-decoration: none;
|
|
375
|
+
color: #333;
|
|
376
|
+
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
|
|
377
|
+
transition: transform 0.2s, box-shadow 0.2s;
|
|
378
|
+
display: flex;
|
|
379
|
+
align-items: center;
|
|
380
|
+
gap: 15px;
|
|
381
|
+
}}
|
|
382
|
+
.doc-card:hover {{
|
|
383
|
+
transform: translateY(-3px);
|
|
384
|
+
box-shadow: 0 8px 25px rgba(0,0,0,0.15);
|
|
385
|
+
}}
|
|
386
|
+
.doc-card .icon {{
|
|
387
|
+
font-size: 2rem;
|
|
388
|
+
flex-shrink: 0;
|
|
389
|
+
}}
|
|
390
|
+
.doc-card .title {{
|
|
391
|
+
font-size: 1.1rem;
|
|
392
|
+
font-weight: 600;
|
|
393
|
+
}}
|
|
394
|
+
.footer {{
|
|
395
|
+
text-align: center;
|
|
396
|
+
margin-top: 40px;
|
|
397
|
+
color: rgba(255,255,255,0.7);
|
|
398
|
+
font-size: 0.9rem;
|
|
399
|
+
}}
|
|
400
|
+
@media (max-width: 600px) {{
|
|
401
|
+
.header h1 {{ font-size: 1.8rem; }}
|
|
402
|
+
.docs-grid {{ grid-template-columns: 1fr; }}
|
|
403
|
+
}}
|
|
404
|
+
</style>
|
|
405
|
+
</head>
|
|
406
|
+
<body>
|
|
407
|
+
<div class="container">
|
|
408
|
+
<div class="header">
|
|
409
|
+
<h1>{project_name}</h1>
|
|
410
|
+
<p>Generated Documentation</p>
|
|
411
|
+
{github_link}
|
|
412
|
+
</div>
|
|
413
|
+
<div class="docs-grid">
|
|
414
|
+
{files_html}
|
|
415
|
+
</div>
|
|
416
|
+
<div class="footer">
|
|
417
|
+
Generated with <a href="https://github.com/wronai/code2docs" style="color: rgba(255,255,255,0.9);">code2docs</a>
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</body>
|
|
421
|
+
</html>'''
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
|
|
272
425
|
ALL_ADAPTERS = [
|
|
273
426
|
ReadmeGeneratorAdapter,
|
|
274
427
|
ApiReferenceAdapter,
|
|
@@ -284,4 +437,5 @@ ALL_ADAPTERS = [
|
|
|
284
437
|
MkDocsAdapter,
|
|
285
438
|
Code2LlmAdapter,
|
|
286
439
|
OrgReadmeAdapter,
|
|
440
|
+
IndexHtmlAdapter,
|
|
287
441
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2docs
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.21
|
|
4
4
|
Summary: Auto-generate and sync project documentation from source code analysis
|
|
5
5
|
Author-email: Tom Sapletta <tom@sapletta.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -50,7 +50,7 @@ Dynamic: license-file
|
|
|
50
50
|
|
|
51
51
|
# code2docs
|
|
52
52
|
|
|
53
|
-
  
|
|
54
54
|
|
|
55
55
|
> Auto-generate and sync project documentation from source code analysis.
|
|
56
56
|
|
|
@@ -190,7 +190,7 @@ code2docs can update only specific sections of an existing README using markers:
|
|
|
190
190
|
```markdown
|
|
191
191
|
<!-- code2docs:start --># code2docs
|
|
192
192
|
|
|
193
|
-
   
|
|
194
194
|
> **276** functions | **57** classes | **51** files | CC̄ = 3.8
|
|
195
195
|
|
|
196
196
|
> Auto-generated project documentation from source code analysis.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|