standardize packaging, tooling, docs, CI, and licensing
This commit is contained in:
@@ -16,7 +16,8 @@ The renderer ensures a consistent documentation structure by:
|
||||
"""
|
||||
|
||||
from pathlib import Path
|
||||
from docforge.models import Project, Module
|
||||
|
||||
from docforge.models import Module, Project
|
||||
|
||||
|
||||
class MkDocsRenderer:
|
||||
@@ -65,8 +66,7 @@ class MkDocsRenderer:
|
||||
|
||||
# Detect packages (modules with children)
|
||||
packages = {
|
||||
p for p in paths
|
||||
if any(other.startswith(p + ".") for other in paths)
|
||||
p for p in paths if any(other.startswith(p + ".") for other in paths)
|
||||
}
|
||||
|
||||
for module in modules:
|
||||
@@ -127,12 +127,12 @@ class MkDocsRenderer:
|
||||
str(root_module.docstring),
|
||||
)
|
||||
|
||||
content = (
|
||||
f"# {project.name}\n\n"
|
||||
f"{doc.strip()}\n"
|
||||
)
|
||||
content = f"# {project.name}\n\n" f"{doc.strip()}\n"
|
||||
|
||||
if not readme_path.exists() or readme_path.read_text(encoding="utf-8") != content:
|
||||
if (
|
||||
not readme_path.exists()
|
||||
or readme_path.read_text(encoding="utf-8") != content
|
||||
):
|
||||
readme_path.write_text(
|
||||
content,
|
||||
encoding="utf-8",
|
||||
@@ -231,10 +231,7 @@ class MkDocsRenderer:
|
||||
str:
|
||||
Markdown source containing a mkdocstrings directive.
|
||||
"""
|
||||
return (
|
||||
f"# {title}\n\n"
|
||||
f"::: {module_path}\n"
|
||||
)
|
||||
return f"# {title}\n\n" f"::: {module_path}\n"
|
||||
|
||||
def _ensure_root_index(
|
||||
self,
|
||||
@@ -255,8 +252,7 @@ class MkDocsRenderer:
|
||||
|
||||
if not root_index.exists():
|
||||
root_index.write_text(
|
||||
f"# {project.name}\n\n"
|
||||
"## Modules\n\n",
|
||||
f"# {project.name}\n\n" "## Modules\n\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user