diff --git a/libs/doc-forge/site/404.html b/libs/doc-forge/site/404.html index ccb63f2..da59a07 100644 --- a/libs/doc-forge/site/404.html +++ b/libs/doc-forge/site/404.html @@ -77,7 +77,9 @@ - + + + @@ -142,12 +144,19 @@ + + + + + + + @@ -173,134 +182,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -314,10 +195,8 @@ - - - + @@ -360,13 +239,23 @@ - - + + + + + - + + + + + + + + @@ -375,8 +264,9 @@ - - + + + @@ -385,8 +275,14 @@ - - + + + + + + + + @@ -396,27 +292,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -456,13 +331,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -471,8 +360,9 @@ - - + + + @@ -481,8 +371,14 @@ - - + + + + + + + + @@ -492,27 +388,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -598,13 +473,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -613,8 +502,9 @@ - - + + + @@ -623,8 +513,14 @@ - - + + + + + + + + @@ -634,27 +530,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -740,13 +615,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -755,8 +644,9 @@ - - + + + @@ -765,8 +655,14 @@ - - + + + + + + + + @@ -776,27 +672,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -882,13 +757,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -897,8 +788,9 @@ - - + + + @@ -907,8 +799,14 @@ - - + + + + + + + + @@ -918,27 +816,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1073,6 +950,8 @@ + + @@ -1110,7 +989,7 @@ - + diff --git a/libs/doc-forge/site/cli/commands/index.html b/libs/doc-forge/site/cli/commands/index.html index 2d2edfb..fbf3b53 100644 --- a/libs/doc-forge/site/cli/commands/index.html +++ b/libs/doc-forge/site/cli/commands/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -751,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -766,8 +653,9 @@ - - + + + @@ -776,8 +664,14 @@ - - + + + + + + + + @@ -787,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -895,13 +768,26 @@ + + + + + + + + + + + + + + - @@ -911,8 +797,9 @@ - - + + + @@ -921,8 +808,14 @@ - - + + + + + + + + @@ -932,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1044,6 +916,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + build @@ -1073,6 +964,11 @@ + + + + + @@ -1174,6 +1070,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + build @@ -1203,6 +1118,11 @@ + + + + + @@ -1229,7 +1149,7 @@ - docforge.cli.commands + docforge.cli.commands @@ -1245,27 +1165,34 @@ - - +Classes +Functions - - build + + build - -build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None - + +1build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None + - Build documentation (MkDocs site or MCP resources). -This command orchestrates the full build process: -1. Introspects the code (Griffe) -2. Renders sources (MkDocs Markdown or MCP JSON) -3. (MkDocs only) Generates config and runs the final site build. + Build documentation artifacts. +This command performs the full documentation build pipeline: + +Introspects the Python project using Griffe +Generates renderer-specific documentation sources +Optionally builds the final documentation output + +Depending on the selected options, the build can target: + +MkDocs static documentation sites +MCP structured documentation resources + Parameters: @@ -1286,7 +1213,7 @@ - Use the MCP documentation builder. + Enable MCP documentation generation. @@ -1300,7 +1227,7 @@ - Use the MkDocs documentation builder. + Enable MkDocs documentation generation. @@ -1314,7 +1241,8 @@ - Module is the source folder and to be treated as the root folder. + Treat the specified module directory as the +project root. @@ -1328,7 +1256,7 @@ - The dotted path of the module to the document. + Python module import path to document. @@ -1356,7 +1284,7 @@ - (MkDocs) The site display name. Defaults to module name. + Display name for the MkDocs site. @@ -1370,7 +1298,8 @@ - (MkDocs) Target directory for Markdown sources. + Directory where Markdown documentation sources +will be generated. @@ -1384,7 +1313,7 @@ - (MkDocs) Path to the docforge.nav.yml specification. + Path to the navigation specification file. @@ -1398,7 +1327,7 @@ - (MkDocs) Optional custom mkdocs.yml template. + Optional custom MkDocs configuration template. @@ -1412,7 +1341,7 @@ - (MkDocs) Target path for the generated mkdocs.yml. + Output path for the generated MkDocs configuration. @@ -1426,7 +1355,7 @@ - (MCP) Target directory for MCP JSON resources. + Output directory for generated MCP resources. @@ -1436,6 +1365,29 @@ + +Raises: + + + + Type + Description + + + + + + UsageError + + + + If required options are missing or conflicting. + + + + + + @@ -1443,17 +1395,22 @@ - - serve + + serve - -serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None - + +1serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None + - Serve documentation (MkDocs or MCP). + Serve generated documentation locally. +Depending on the selected mode, this command starts either: + +A MkDocs development server for browsing documentation +An MCP server exposing structured documentation resources + Parameters: @@ -1474,7 +1431,7 @@ - Serve MCP resources via an MCP server. + Serve documentation using the MCP server. @@ -1488,7 +1445,7 @@ - Serve the MkDocs site using the built-in development server. + Serve the MkDocs development site. @@ -1502,7 +1459,7 @@ - The dotted path of the module to serve. + Python module import path to serve via MCP. @@ -1516,7 +1473,7 @@ - (MkDocs) Path to the mkdocs.yml configuration. + Path to the MkDocs configuration file. @@ -1530,7 +1487,7 @@ - (MCP) Path to the mcp_docs/ directory. + Root directory containing MCP documentation resources. @@ -1540,6 +1497,29 @@ + +Raises: + + + + Type + Description + + + + + + UsageError + + + + If invalid or conflicting options are provided. + + + + + + @@ -1547,17 +1527,20 @@ - - tree + + tree - -tree(module: str, project_name: Optional[str]) -> None - + +1tree(module: str, project_name: Optional[str]) -> None + - Visualize the project structure in the terminal. + Display the documentation object tree for a module. +This command introspects the specified module and prints a +hierarchical representation of the discovered documentation +objects, including modules, classes, functions, and members. Parameters: @@ -1578,7 +1561,7 @@ - The module import path to recursively introspect. + Python module import path to introspect. @@ -1592,7 +1575,7 @@ - Optional override for the project name shown at the root. + Optional name to display as the project root. @@ -1630,6 +1613,8 @@ + + @@ -1667,7 +1652,7 @@ - + diff --git a/libs/doc-forge/site/cli/index.html b/libs/doc-forge/site/cli/index.html index 2817e80..5c81206 100644 --- a/libs/doc-forge/site/cli/index.html +++ b/libs/doc-forge/site/cli/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -751,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -766,8 +653,9 @@ - - + + + @@ -776,8 +664,14 @@ - - + + + + + + + + @@ -787,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -895,13 +768,26 @@ + + + + + + + + + + + + + + - @@ -911,8 +797,9 @@ - - + + + @@ -921,8 +808,14 @@ - - + + + + + + + + @@ -932,108 +825,6 @@ - - - - - - - - - - - - - - - - - - - - - Cli - - - - - - - - - - - - - Cli - - - - - - - - - - - - - - - - - - Table of contents - - - - - - - cli - - - - - - - - - - CLI Layer - - - - - - - - - - Available Commands - - - - - - - - - - - - - - - - - - - - - - - @@ -1171,27 +962,12 @@ - + - CLI Layer + Typical usage - - - - - - - Available Commands - - - - - - - - @@ -1223,22 +999,33 @@ - docforge.cli + docforge.cli - CLI Layer -The docforge.cli package provides the command-line interface for interacting -with doc-forge. -Available Commands - -build: Build documentation (MkDocs site or MCP resources). -serve: Serve documentation (MkDocs or MCP). -tree: Visualize the introspected project structure. - + Command line interface entry point for doc-forge. +This module exposes the primary CLI entry function used by the +doc-forge command. The actual command implementation resides in +docforge.cli.main, while this module provides a stable import path +for external tools and the package entry point configuration. +The CLI is responsible for orchestrating documentation workflows such as +generating renderer sources, building documentation sites, exporting +machine-readable documentation bundles, and starting development or MCP +servers. + +Typical usage +The CLI is normally invoked through the installed command: +1doc-forge <command> [options] + +Programmatic invocation is also possible: +1 +2from docforge.cli import main +main() + + @@ -1276,6 +1063,8 @@ with doc-forge. + + @@ -1313,7 +1102,7 @@ with doc-forge. - + diff --git a/libs/doc-forge/site/cli/main/index.html b/libs/doc-forge/site/cli/main/index.html index e6866da..b64095e 100644 --- a/libs/doc-forge/site/cli/main/index.html +++ b/libs/doc-forge/site/cli/main/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -751,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -766,8 +653,9 @@ - - + + + @@ -776,8 +664,14 @@ - - + + + + + + + + @@ -787,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -895,13 +768,26 @@ + + + + + + + + + + + + + + - @@ -911,8 +797,9 @@ - - + + + @@ -921,8 +808,14 @@ - - + + + + + + + + @@ -932,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1021,6 +893,16 @@ + + + Functions + + + + + + + main @@ -1032,6 +914,11 @@ + + + + + @@ -1156,6 +1043,16 @@ + + + Functions + + + + + + + main @@ -1167,6 +1064,11 @@ + + + + + @@ -1193,15 +1095,16 @@ - docforge.cli.main + docforge.cli.main - Main entry point for the doc-forge CLI. This module delegates all command -execution to docforge.cli.commands. + Command-line entry point for the doc-forge CLI. +This module exposes the executable entry point that initializes the +Click command group defined in docforge.cli.commands. @@ -1213,22 +1116,25 @@ execution to docforge.cli.commands. - +Functions - - main + + main - -main() -> None - + +1main() -> None + - CLI Entry point. Boots the click application. + Run the doc-forge command-line interface. +This function initializes and executes the Click CLI application. +It is used as the console entry point when invoking doc-forge +from the command line. @@ -1258,6 +1164,8 @@ execution to docforge.cli.commands. + + @@ -1295,7 +1203,7 @@ execution to docforge.cli.commands. - + diff --git a/libs/doc-forge/site/cli/mcp_utils/index.html b/libs/doc-forge/site/cli/mcp_utils/index.html index 0247441..0ea734f 100644 --- a/libs/doc-forge/site/cli/mcp_utils/index.html +++ b/libs/doc-forge/site/cli/mcp_utils/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -751,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -766,8 +653,9 @@ - - + + + @@ -776,8 +664,14 @@ - - + + + + + + + + @@ -787,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -895,13 +768,26 @@ + + + + + + + + + + + + + + - @@ -911,8 +797,9 @@ - - + + + @@ -921,8 +808,14 @@ - - + + + + + + + + @@ -932,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1067,6 +939,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + generate_resources @@ -1087,6 +978,11 @@ + + + + + @@ -1165,6 +1061,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + generate_resources @@ -1185,6 +1100,11 @@ + + + + + @@ -1211,7 +1131,7 @@ - docforge.cli.mcp_utils + docforge.cli.mcp_utils @@ -1227,23 +1147,26 @@ - - +Classes +Functions - - generate_resources + + generate_resources - -generate_resources(module: str, project_name: str | None, out_dir: Path) -> None - + +1generate_resources(module: str, project_name: str | None, out_dir: Path) -> None + - Generate MCP-compatible documentation resources. + Generate MCP documentation resources from a Python module. +The function performs project introspection, builds the internal +documentation model, and renders MCP-compatible JSON resources +to the specified output directory. Parameters: @@ -1264,7 +1187,8 @@ - The dotted path of the primary module to document. + Python module import path used as the entry point for +documentation generation. @@ -1278,7 +1202,8 @@ - Optional override for the project name. + Optional override for the project name used in +generated documentation metadata. @@ -1292,7 +1217,8 @@ - Directory where the MCP JSON resources and nav will be written. + Directory where MCP resources (index.json, nav.json, +and module data) will be written. @@ -1309,17 +1235,19 @@ - - serve + + serve - -serve(module: str, mcp_root: Path) -> None - + +1serve(module: str, mcp_root: Path) -> None + - Serve MCP documentation from a pre-built bundle. + Start an MCP server for a pre-generated documentation bundle. +The server exposes documentation resources such as project metadata, +navigation structure, and module documentation through MCP endpoints. Parameters: @@ -1340,7 +1268,8 @@ - The dotted path of the primary module to serve. + Python module import path used to identify the served +documentation instance. @@ -1354,7 +1283,8 @@ - Path to the directory containing index.json, nav.json, and modules/. + Path to the directory containing the MCP documentation +bundle (index.json, nav.json, and modules/). @@ -1364,6 +1294,30 @@ + +Raises: + + + + Type + Description + + + + + + ClickException + + + + If the MCP documentation bundle is missing +required files or directories. + + + + + + @@ -1392,6 +1346,8 @@ + + @@ -1429,7 +1385,7 @@ - + diff --git a/libs/doc-forge/site/cli/mkdocs_utils/index.html b/libs/doc-forge/site/cli/mkdocs_utils/index.html index 3ecb2a5..40a6873 100644 --- a/libs/doc-forge/site/cli/mkdocs_utils/index.html +++ b/libs/doc-forge/site/cli/mkdocs_utils/index.html @@ -84,7 +84,9 @@ - + + + @@ -149,12 +151,19 @@ + + + + + + + @@ -180,136 +189,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -323,10 +202,8 @@ - - - + @@ -369,13 +246,23 @@ - - + + + + + - + + + + + + + + @@ -384,8 +271,9 @@ - - + + + @@ -394,8 +282,14 @@ - - + + + + + + + + @@ -405,27 +299,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -465,13 +338,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -480,8 +367,9 @@ - - + + + @@ -490,8 +378,14 @@ - - + + + + + + + + @@ -501,27 +395,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -607,13 +480,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -622,8 +509,9 @@ - - + + + @@ -632,8 +520,14 @@ - - + + + + + + + + @@ -643,27 +537,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -749,13 +622,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -764,8 +651,9 @@ - - + + + @@ -774,8 +662,14 @@ - - + + + + + + + + @@ -785,27 +679,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -893,13 +766,26 @@ + + + + + + + + + + + + + + - @@ -909,8 +795,9 @@ - - + + + @@ -919,8 +806,14 @@ - - + + + + + + + + @@ -930,27 +823,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1088,6 +960,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + build @@ -1126,6 +1017,11 @@ + + + + + @@ -1181,6 +1077,25 @@ + + + Classes + + + + + + + + + Functions + + + + + + + build @@ -1219,6 +1134,11 @@ + + + + + @@ -1245,7 +1165,7 @@ - docforge.cli.mkdocs_utils + docforge.cli.mkdocs_utils @@ -1261,23 +1181,25 @@ - - +Classes +Functions - - build + + build - -build(mkdocs_yml: Path) -> None - + +1build(mkdocs_yml: Path) -> None + - Build the documentation site using MkDocs. + Build the MkDocs documentation site. +This function loads the MkDocs configuration and runs the MkDocs +build command to generate the final static documentation site. Parameters: @@ -1298,7 +1220,7 @@ - Path to the mkdocs.yml configuration file. + Path to the mkdocs.yml configuration file. @@ -1308,6 +1230,29 @@ + +Raises: + + + + Type + Description + + + + + + ClickException + + + + If the configuration file does not exist. + + + + + + @@ -1315,17 +1260,20 @@ - - generate_config + + generate_config - -generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None - + +1generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None + - Generate an mkdocs.yml configuration file. + Generate an mkdocs.yml configuration file. +The configuration is created by combining a template configuration +with a navigation structure derived from the docforge navigation +specification. Parameters: @@ -1346,7 +1294,7 @@ - Path to the directory containing documentation Markdown files. + Directory containing generated documentation Markdown files. @@ -1360,7 +1308,7 @@ - Path to the docforge.nav.yml specification. + Path to the docforge.nav.yml navigation specification. @@ -1374,7 +1322,8 @@ - Optional path to an mkdocs.yml template (overrides built-in). + Optional path to a custom MkDocs configuration template. +If not provided, a built-in template will be used. @@ -1388,7 +1337,8 @@ - Path where the final mkdocs.yml will be written. + Destination path where the generated mkdocs.yml file +will be written. @@ -1402,7 +1352,7 @@ - The display name for the documentation site. + Display name for the generated documentation site. @@ -1412,6 +1362,30 @@ + +Raises: + + + + Type + Description + + + + + + FileError + + + + If the navigation specification or template +file cannot be found. + + + + + + @@ -1419,17 +1393,20 @@ - - generate_sources + + generate_sources - -generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None - + +1generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None + - Generate Markdown source files for the specified module. + Generate MkDocs Markdown sources for a Python module. +This function introspects the specified module, builds the internal +documentation model, and renders Markdown documentation files for +use with MkDocs. Parameters: @@ -1450,27 +1427,14 @@ - The dotted path of the primary module to document. + Python module import path used as the entry point for +documentation generation. required - - project_name - - str | None - - - - Optional override for the project name. - - - - None - - docs_dir @@ -1485,6 +1449,21 @@ required + + project_name + + str | None + + + + Optional override for the project name used in +documentation metadata. + + + + None + + module_is_source @@ -1492,7 +1471,8 @@ - Module is the source folder and to be treated as the root folder. + If True, treat the specified module directory as +the project root rather than a nested module. @@ -1509,17 +1489,19 @@ - - serve + + serve - -serve(mkdocs_yml: Path) -> None - + +1serve(mkdocs_yml: Path) -> None + - Serve the documentation site with live-reload using MkDocs. + Start an MkDocs development server with live reload. +The server watches documentation files and automatically reloads +the site when changes are detected. Parameters: @@ -1540,7 +1522,7 @@ - Path to the mkdocs.yml configuration file. + Path to the mkdocs.yml configuration file. @@ -1550,6 +1532,29 @@ + +Raises: + + + + Type + Description + + + + + + ClickException + + + + If the configuration file does not exist. + + + + + + @@ -1578,6 +1583,8 @@ + + @@ -1615,7 +1622,7 @@ - + diff --git a/libs/doc-forge/site/index.html b/libs/doc-forge/site/index.html index aec0057..f8c8af4 100644 --- a/libs/doc-forge/site/index.html +++ b/libs/doc-forge/site/index.html @@ -84,7 +84,9 @@ - + + + @@ -149,12 +151,19 @@ + + + + + + + @@ -180,136 +189,6 @@ - - - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -323,10 +202,8 @@ - - - + @@ -405,67 +282,6 @@ - - - - doc-forge - - - - - - - - - - Core Philosophy - - - - - - - - - Documentation Design - - - - - - - - - - For Humans (Readability & Structure) - - - - - - - - - For LLMs (AI-Native Knowledge) - - - - - - - - - - - - - - Available Commands - - - - - @@ -478,40 +294,161 @@ - Quick Start - - - - - - - - - - - - - - Build MCP resources + Quick start - + - Serve MCP documentation + Core concepts - + + + + + + Architecture + + + + + + + + + Rendering pipeline + + + + + + + + + CLI usage + + + + + + + + + Public API + + + + + + + + + Google-Styled Doc-Forge Convention (GSDFC) + + + + - + - Project Structure + General rules + + + + + + + + + Package docstrings + + + + + + + + + Module docstrings + + + + + + + + + Class docstrings + + + + + + + + + Function and method docstrings + + + + + + + + + Property docstrings + + + + + + + + + Attribute documentation + + + + + + + + + Notes subsection grouping + + + + + + + + + Example formatting + + + + + + + + + Separator rules + + + + + + + + + Parsing guarantees @@ -522,6 +459,16 @@ + + + + Classes + + + + + + @@ -533,6 +480,16 @@ + + + Functions + + + + + + + load_module @@ -553,6 +510,11 @@ + + + + + @@ -566,6 +528,16 @@ + + + Functions + + + + + + + generate_sources @@ -577,6 +549,11 @@ + + + + + @@ -589,6 +566,25 @@ + + + + Functions + + + + + + + + + + generate_readme + + + + + @@ -603,6 +599,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -615,6 +631,11 @@ + + + + + @@ -633,13 +654,23 @@ - - + + + + + - + + + + + + + + @@ -648,8 +679,9 @@ - - + + + @@ -658,8 +690,14 @@ - - + + + + + + + + @@ -669,27 +707,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -729,13 +746,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -744,8 +775,9 @@ - - + + + @@ -754,8 +786,14 @@ - - + + + + + + + + @@ -765,27 +803,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -871,13 +888,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -886,8 +917,9 @@ - - + + + @@ -896,8 +928,14 @@ - - + + + + + + + + @@ -907,27 +945,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -1013,13 +1030,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -1028,8 +1059,9 @@ - - + + + @@ -1038,8 +1070,14 @@ - - + + + + + + + + @@ -1049,27 +1087,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -1155,13 +1172,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1170,8 +1203,9 @@ - - + + + @@ -1180,8 +1214,14 @@ - - + + + + + + + + @@ -1191,27 +1231,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1348,67 +1367,6 @@ - - - - doc-forge - - - - - - - - - - Core Philosophy - - - - - - - - - Documentation Design - - - - - - - - - - For Humans (Readability & Structure) - - - - - - - - - For LLMs (AI-Native Knowledge) - - - - - - - - - - - - - - Available Commands - - - - - @@ -1421,40 +1379,161 @@ - Quick Start - - - - - - - - - - - - - - Build MCP resources + Quick start - + - Serve MCP documentation + Core concepts - + + + + + + Architecture + + + + + + + + + Rendering pipeline + + + + + + + + + CLI usage + + + + + + + + + Public API + + + + + + + + + Google-Styled Doc-Forge Convention (GSDFC) + + + + - + - Project Structure + General rules + + + + + + + + + Package docstrings + + + + + + + + + Module docstrings + + + + + + + + + Class docstrings + + + + + + + + + Function and method docstrings + + + + + + + + + Property docstrings + + + + + + + + + Attribute documentation + + + + + + + + + Notes subsection grouping + + + + + + + + + Example formatting + + + + + + + + + Separator rules + + + + + + + + + Parsing guarantees @@ -1465,6 +1544,16 @@ + + + + Classes + + + + + + @@ -1476,6 +1565,16 @@ + + + Functions + + + + + + + load_module @@ -1496,6 +1595,11 @@ + + + + + @@ -1509,6 +1613,16 @@ + + + Functions + + + + + + + generate_sources @@ -1520,6 +1634,11 @@ + + + + + @@ -1532,6 +1651,25 @@ + + + + Functions + + + + + + + + + + generate_readme + + + + + @@ -1546,6 +1684,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1558,6 +1716,11 @@ + + + + + @@ -1584,95 +1747,735 @@ - docforge + docforge - doc-forge -doc-forge is a renderer-agnostic Python documentation compiler designed for -speed, flexibility, and beautiful output. It decouples the introspection of -your code from the rendering process, allowing you to generate documentation -for various platforms (starting with MkDocs) from a single internal models. -Core Philosophy -doc-forge operates on two fundamental principles: - -The Atomic Unit is a Python Import Path: Documentation is organized around the semantic structure of your code (e.g., mypackage.utils), not the filesystem. -The Documentation Compiler Paradigm: We separate documentation into three distinct phases: -Front-end (Introspection): Static analysis of source code and docstrings. -Middle-end (Semantic Model): A renderer-neutral internal representation. -Back-end (Renderers): Generation of human-facing (MkDocs) or machine-facing (MCP) outputs. - - - -Documentation Design -doc-forge is an "AI-Native" documentation compiler. To get the most out of it, design your docstrings with both humans and LLMs in mind: -For Humans (Readability & Structure) - -__init__.py as Landing Pages: Use the docstring of your package's __init__.py as the home page. Include overviews, installation instructions, and high-level examples here. -Single Source of Truth: Keep all technical details in docstrings. This ensures your MkDocs/Sphinx sites stay in sync with the code. -Semantic Hierarchy: Use standard Markdown headers to structure complex module documentation. - -For LLMs (AI-Native Knowledge) - -Model Context Protocol (MCP): doc-forge exports your docs as structured JSON. This allows AI agents to "understand" your API surface area without layout noise. -Canonical Paths: Use dotted import paths as primary identifiers. AI tools use these to link code usage to documentation. -Type Annotations: While not in docstrings, doc-forge (via Griffe) extracts signatures. Clean type hints dramatically improve an LLM's ability to generate correct code using your library. - -Available Commands - -build: Build documentation (MkDocs site or MCP resources). -serve: Serve documentation (MkDocs or MCP). -tree: Visualize the introspected project structure. - + Renderer-agnostic Python documentation compiler that converts Python docstrings +into structured documentation for both humans (MkDocs) and machines (MCP / AI agents). +doc-forge statically analyzes source code, builds a semantic model of modules, +classes, functions, and attributes, and renders that model into documentation +outputs without executing user code. + Installation -Install using pip with the optional mkdocs dependencies for a complete setup: -pip install doc-forge - -Quick Start - - -Build Documentation: - Introspect your package and generate documentation in one step: - ```bash - # Build MkDocs site - doc-forge build --mkdocs --module my_package --site-name "My Docs" -Build MCP resources -doc-forge build --mcp --module my_package -``` - - -Define Navigation: - Create a docforge.nav.yml to organize your documentation: - yaml - home: my_package/index.md - groups: - Core API: - - my_package/core/*.md - Utilities: - - my_package/utils.md - - -Preview: - ```bash - # Serve MkDocs site - doc-forge serve --mkdocs -Serve MCP documentation -doc-forge serve --mcp -``` - - -Project Structure +Install using pip: +1pip install doc-forge + + +Quick start +Generate a MkDocs site from a Python package: +1doc-forge build --mkdocs --module my_package + +Generate MCP JSON documentation: +1doc-forge build --mcp --module my_package + +Serve documentation locally: +1doc-forge serve --mkdocs --module my_package + + +Core concepts +Loader +Extracts symbols, signatures, and docstrings using static analysis. +Semantic model +Structured, renderer-agnostic representation of the API. +Renderer +Converts the semantic model into output formats such as MkDocs or MCP JSON. +Symbol +Any documentable object: +1 +2 +3 +4 +5 +6- module +- class +- function +- method +- property +- attribute + + +Architecture +doc-forge follows a compiler architecture: +Front-end: +1Static analysis of modules, classes, functions, type hints, and docstrings. + +Middle-end: +1Builds a semantic model describing symbols and relationships. + +Back-end: +1Renders documentation using interchangeable renderers. + +This architecture ensures deterministic documentation generation. + +Rendering pipeline +Typical flow: +1 +2 +3 +4 +5 +6 +7 +8 +9Python package + ↓ +Loader (static analysis) + ↓ +Semantic model + ↓ +Renderer + ↓ +MkDocs site or MCP JSON + + +CLI usage +Build MkDocs documentation: +1doc-forge build --mkdocs --module my_package + +Build MCP documentation: +1doc-forge build --mcp --module my_package + +Serve MkDocs locally: +1doc-forge serve --module my_package + + +Public API +Loaders: +1 +2GriffeLoader +discover_module_paths + +Renderers: +1 +2MkDocsRenderer +MCPRenderer + +CLI: +1main + +Models: +1models + + +Google-Styled Doc-Forge Convention (GSDFC) +GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling. -docforge.loaders: Introspects source code using static analysis (griffe). -docforge.models: The internal representation of your project, modules, and objects. -docforge.renderers: Converters that turn the models into physical files. -docforge.nav: Managers for logical-to-physical path mapping and navigation. +Docstrings are the single source of truth. +doc-forge compiles docstrings but does not generate documentation content. +Documentation follows the Python import hierarchy. +Every public symbol should have a complete and accurate docstring. + + +General rules + +Use Markdown headings at package and module level. +Use Google-style structured sections at class, function, and method level. +Indent section contents using four spaces. +Use type hints in signatures instead of duplicating types in prose. +Write summaries in imperative form. +Sections are separated by --- + + +Package docstrings + +Package docstrings act as the documentation home page. + +Recommended sections: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10## Summary +## Installation +## Quick start +## Core concepts +## Architecture +## Rendering pipeline +## CLI usage +## Public API +## Examples +## Notes + + + + + Example + Package Doc String: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32''' +Foo-bar processing framework. + +Provides tools for defining Foo objects and executing Bar pipelines. + +--- + +# Installation + + pip install foo-bar + +--- + +# Quick start + + from foobar import Foo, BarEngine + + foo = Foo("example") + engine = BarEngine([foo]) + + result = engine.run() + +--- + +# Public API + + Foo + Bar + BarEngine + +--- +''' + + +Module docstrings + +Module docstrings describe a subsystem. + +Recommended sections: +1 +2 +3 +4## Summary +## Examples +## Notes +## Public API + + + + + Example + Module Doc String: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19''' +Foo execution subsystem. + +Provides utilities for executing Foo objects through Bar stages. + +--- + +Example: + + from foobar.engine import BarEngine + from foobar.foo import Foo + + foo = Foo("example") + + engine = BarEngine([foo]) + engine.run() + +--- +''' + + +Class docstrings + +Class docstrings define object responsibility, lifecycle, and attributes. + +Recommended sections: +1 +2 +3 +4Attributes: +Notes: +Example: +Raises: + + + + + Example + Simple Foo: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27class Foo: + ''' + Represents a unit of work. + + Attributes: + name (str): + Identifier of the foo instance. + + value (int): + Numeric value associated with foo. + + Notes: + Guarantees: + + - instances are immutable after creation + + Lifecycle: + + - create instance + - pass to processing engine + + Example: + Create and inspect a Foo: + + foo = Foo("example", value=42) + print(foo.name) + ''' + +Complex Bar: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22class BarEngine: + ''' + Executes Foo objects through Bar stages. + + Attributes: + foos (tuple[Foo, ...]): + Foo instances managed by the engine. + + Notes: + Guarantees: + + - deterministic execution order + + Example: + Run engine: + + foo1 = Foo("a") + foo2 = Foo("b") + + engine = BarEngine([foo1, foo2]) + engine.run() + ''' + + +Function and method docstrings + +Function docstrings define API contracts. + +Recommended sections: +1 +2 +3 +4 +5 +6Args: +Returns: +Raises: +Yields: +Notes: +Example: + + + + + Example + Simple process method: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32def process(foo: Foo, multiplier: int) -> int: + ''' + Process a Foo instance. + + Args: + foo (Foo): + Foo instance to process. + + multiplier (int): + Value used to scale foo. + + Returns: + int: + Processed result. + + Raises: + ValueError: + If multiplier is negative. + + Notes: + Guarantees: + + - foo is not modified + + Example: + Process foo: + + foo = Foo("example", value=10) + + result = process(foo, multiplier=2) + print(result) + ''' + +Multiple Examples: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28def combine(foo_a: Foo, foo_b: Foo) -> Foo: + ''' + Combine two Foo instances. + + Args: + foo_a (Foo): + First foo. + + foo_b (Foo): + Second foo. + + Returns: + Foo: + Combined foo. + + Example: + Basic usage: + + foo1 = Foo("a") + foo2 = Foo("b") + + combined = combine(foo1, foo2) + + Pipeline usage: + + engine = BarEngine([foo1, foo2]) + engine.run() + ''' + + +Property docstrings + +Properties must document return values. + + Example + Property Doc String: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14@property +def foos(self) -> tuple[Foo, ...]: + ''' + Return contained Foo instances. + + Returns: + tuple[Foo, ...]: + Stored foo objects. + + Example: + container = FooContainer() + + foos = container.foos + ''' + + +Attribute documentation + +Document attributes in class docstrings using Attributes:. + + + + + Example + Attribute Doc String: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10''' +Represents a processing stage. + +Attributes: + id (str): + Unique identifier. + + enabled (bool): + Whether the stage is active. +''' + + +Notes subsection grouping + +Group related information using labeled subsections. + + + + + Example + Notes Example: + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13Notes: + **Guarantees:** + + - deterministic behavior + + **Lifecycle:** + + - created during initialization + - reused across executions + + **Thread safety:** + + - safe for concurrent reads + + +Example formatting + +Use indentation for examples. + + + + + Example + Single example: +1 +2 +3 +4Example: + + foo = Foo("example") + process(foo, multiplier=2) + +Multiple examples: +1 +2 +3 +4 +5 +6 +7 +8 +9Example: + Create foo: + + foo = Foo("example") + + Run engine: + + engine = BarEngine([foo]) + engine.run() + + Avoid fenced code blocks inside structured sections. + +Separator rules +Use horizontal separators only at docstring root level to separate sections: +1--- + +Allowed locations: + +package docstrings +module docstrings +major documentation sections + +Do not use separators inside code sections. + +Parsing guarantees +GSDFC ensures doc-forge can deterministically extract: + +symbol kind (module, class, function, property, attribute) +symbol name +parameters +return values +attributes +examples +structured Notes subsections + +This enables: + +reliable MkDocs rendering +deterministic MCP export +accurate AI semantic interpretation + + + + + + Notes + +doc-forge never executes analyzed modules. +Documentation is generated entirely through static analysis. + + + @@ -1681,26 +2484,31 @@ for various platforms (starting with MkDocs) from a single internal models. - +Classes - - GriffeLoader + + GriffeLoader - -GriffeLoader() - + +1GriffeLoader() + - Loads Python modules and extracts documentation using the Griffe introspection engine. + Load Python modules using Griffe and convert them into doc-forge models. +This loader uses the Griffe introspection engine to analyze Python source +code and transform the extracted information into Project, Module, +and DocObject instances used by doc-forge. - Initialize the GriffeLoader. + Initialize the Griffe-backed loader. +Creates an internal Griffe loader instance with dedicated collections +for modules and source lines. @@ -1713,22 +2521,24 @@ for various platforms (starting with MkDocs) from a single internal models. - +Functions - - load_module + + load_module - -load_module(path: str) -> Module - + +1load_module(path: str) -> Module + - Load a single module and convert its introspection data into the docforge models. + Load and convert a single Python module. +The module is introspected using Griffe and then transformed into +a doc-forge Module model. Parameters: @@ -1749,7 +2559,7 @@ for various platforms (starting with MkDocs) from a single internal models. - The dotted path of the module to load. + Dotted import path of the module. @@ -1775,7 +2585,7 @@ for various platforms (starting with MkDocs) from a single internal models. - A Module instance. + A populated Module instance. @@ -1789,17 +2599,20 @@ for various platforms (starting with MkDocs) from a single internal models. - - load_project + + load_project - -load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project - + +1load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project + - Load multiple modules and combine them into a single Project models. + Load multiple modules and assemble them into a Project model. +Each module path is introspected and converted into a Module +instance. All modules are then aggregated into a single Project +object. Parameters: @@ -1820,7 +2633,7 @@ for various platforms (starting with MkDocs) from a single internal models. - A list of dotted paths to the modules to load. + List of dotted module import paths to load. @@ -1834,7 +2647,8 @@ for various platforms (starting with MkDocs) from a single internal models. - Optional name for the project. Defaults to the first module name. + Optional override for the project name. Defaults +to the top-level name of the first module. @@ -1848,7 +2662,8 @@ for various platforms (starting with MkDocs) from a single internal models. - If True, modules that fail to import will be skipped. + If True, modules that fail to load will be +skipped instead of raising an error. @@ -1874,7 +2689,41 @@ for various platforms (starting with MkDocs) from a single internal models. - A Project instance containing the loaded modules. + A populated Project instance containing the loaded modules. + + + + + + + +Raises: + + + + Type + Description + + + + + + ValueError + + + + If no module paths are provided. + + + + + + ImportError + + + + If a module fails to load and +skip_import_errors is False. @@ -1897,17 +2746,20 @@ for various platforms (starting with MkDocs) from a single internal models. - - MCPRenderer + + MCPRenderer - + - Renderer that emits MCP-native JSON resources from docforge models. + Renderer that generates MCP-compatible documentation resources. +This renderer converts doc-forge project models into structured JSON +resources suitable for consumption by systems implementing the Model +Context Protocol (MCP). @@ -1920,22 +2772,24 @@ for various platforms (starting with MkDocs) from a single internal models. - +Functions - - generate_sources + + generate_sources - -generate_sources(project: Project, out_dir: Path) -> None - + +1generate_sources(project: Project, out_dir: Path) -> None + - Generate MCP-compatible JSON resources and navigation for the project. + Generate MCP documentation resources for a project. +The renderer serializes each module into a JSON resource and produces +supporting metadata files such as nav.json and index.json. Parameters: @@ -1956,7 +2810,7 @@ for various platforms (starting with MkDocs) from a single internal models. - The project model to render. + Documentation project model to render. @@ -1970,7 +2824,7 @@ for various platforms (starting with MkDocs) from a single internal models. - Target directory for the generated JSON files. + Directory where MCP resources will be written. @@ -1996,18 +2850,19 @@ for various platforms (starting with MkDocs) from a single internal models. - - MkDocsRenderer + + MkDocsRenderer - + - Renderer that generates Markdown source files formatted for the MkDocs -'mkdocstrings' plugin. + Renderer that produces Markdown documentation for MkDocs. +Generated pages use mkdocstrings directives to reference Python modules, +allowing MkDocs to render API documentation dynamically. @@ -2020,23 +2875,28 @@ for various platforms (starting with MkDocs) from a single internal models. - +Functions - - generate_sources + + generate_readme - -generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None - + +1generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None + - Produce a set of Markdown files in the output directory based on the -provided Project models. + Generate a README.md file from the root module docstring. +Behavior: + +If module_is_source is True, README.md is written to the + project root directory. +If False, README generation is currently not implemented. + Parameters: @@ -2057,7 +2917,7 @@ provided Project models. - The project models to render. + Project model containing documentation metadata. @@ -2065,13 +2925,13 @@ provided Project models. - out_dir + docs_dir Path - Target directory for documentation files. + Directory containing generated documentation sources. @@ -2085,7 +2945,88 @@ provided Project models. - Module is the source folder and to be treated as the root folder. + Whether the module is treated as the project +source root. + + + + None + + + + + + + + + + + + + + generate_sources + + + +1generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None + + + + + Generate Markdown documentation files for a project. +This method renders a documentation structure from the provided +project model and writes the resulting Markdown files to the +specified output directory. + + +Parameters: + + + + Name + Type + Description + Default + + + + + project + + Project + + + + Project model containing modules to document. + + + + required + + + + out_dir + + Path + + + + Directory where generated Markdown files will be written. + + + + required + + + + module_is_source + + bool | None + + + + If True, treat the specified module as the +documentation root rather than nesting it inside a folder. @@ -2106,26 +3047,30 @@ provided Project models. - +Functions - - discover_module_paths + + discover_module_paths - -discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] - + +1discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] + - Discover all Python modules under a package via filesystem traversal. -Rules: -- Directory with init.py is treated as a package. -- Any .py file is treated as a module. -- All paths are converted to dotted module paths. + Discover Python modules within a package directory. +The function scans the filesystem for .py files inside the specified +package and converts them into dotted module import paths. +Discovery rules: + +Directories containing __init__.py are treated as packages. +Each .py file is treated as a module. +Results are returned as dotted import paths. + Parameters: @@ -2146,7 +3091,7 @@ provided Project models. - The name of the package to discover. + Top-level package name to discover modules from. @@ -2160,7 +3105,8 @@ provided Project models. - The root directory of the project. Defaults to current working directory. + Root directory used to resolve module paths. If not +provided, the current working directory is used. @@ -2186,7 +3132,30 @@ provided Project models. - A sorted list of dotted module paths. + A sorted list of unique dotted module import paths. + + + + + + + +Raises: + + + + Type + Description + + + + + + FileNotFoundError + + + + If the specified package directory does not exist. @@ -2221,6 +3190,8 @@ provided Project models. + + @@ -2258,7 +3229,7 @@ provided Project models. - + diff --git a/libs/doc-forge/site/loaders/griffe_loader/index.html b/libs/doc-forge/site/loaders/griffe_loader/index.html index c11d133..b038ec3 100644 --- a/libs/doc-forge/site/loaders/griffe_loader/index.html +++ b/libs/doc-forge/site/loaders/griffe_loader/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -372,6 +249,14 @@ + + + + + + + + @@ -379,7 +264,6 @@ - @@ -389,8 +273,9 @@ - - + + + @@ -399,8 +284,14 @@ - - + + + + + + + + @@ -410,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -499,6 +369,16 @@ + + + Classes + + + + + + + GriffeLoader @@ -509,6 +389,16 @@ + + + Functions + + + + + + + load_module @@ -531,6 +421,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -543,6 +453,11 @@ + + + + + @@ -569,13 +484,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -584,8 +513,9 @@ - - + + + @@ -594,8 +524,14 @@ - - + + + + + + + + @@ -605,27 +541,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -711,13 +626,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -726,8 +655,9 @@ - - + + + @@ -736,8 +666,14 @@ - - + + + + + + + + @@ -747,27 +683,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -853,13 +768,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -868,8 +797,9 @@ - - + + + @@ -878,8 +808,14 @@ - - + + + + + + + + @@ -889,27 +825,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -995,13 +910,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1010,8 +941,9 @@ - - + + + @@ -1020,8 +952,14 @@ - - + + + + + + + + @@ -1031,27 +969,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1189,6 +1106,16 @@ + + + Classes + + + + + + + GriffeLoader @@ -1199,6 +1126,16 @@ + + + Functions + + + + + + + load_module @@ -1221,6 +1158,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1233,6 +1190,11 @@ + + + + + @@ -1259,15 +1221,17 @@ - docforge.loaders.griffe_loader + docforge.loaders.griffe_loader - This module provides the GriffeLoader, which uses the 'griffe' library to -introspect Python source code and populate the doc-forge Project models. + Utilities for loading and introspecting Python modules using Griffe. +This module provides the GriffeLoader class and helper utilities used to +discover Python modules, introspect their structure, and convert the results +into doc-forge documentation models. @@ -1278,26 +1242,31 @@ introspect Python source code and populate the doc-forge Project models. - +Classes - - GriffeLoader + + GriffeLoader - -GriffeLoader() - + +1GriffeLoader() + - Loads Python modules and extracts documentation using the Griffe introspection engine. + Load Python modules using Griffe and convert them into doc-forge models. +This loader uses the Griffe introspection engine to analyze Python source +code and transform the extracted information into Project, Module, +and DocObject instances used by doc-forge. - Initialize the GriffeLoader. + Initialize the Griffe-backed loader. +Creates an internal Griffe loader instance with dedicated collections +for modules and source lines. @@ -1310,22 +1279,24 @@ introspect Python source code and populate the doc-forge Project models. - +Functions - - load_module + + load_module - -load_module(path: str) -> Module - + +1load_module(path: str) -> Module + - Load a single module and convert its introspection data into the docforge models. + Load and convert a single Python module. +The module is introspected using Griffe and then transformed into +a doc-forge Module model. Parameters: @@ -1346,7 +1317,7 @@ introspect Python source code and populate the doc-forge Project models. - The dotted path of the module to load. + Dotted import path of the module. @@ -1372,7 +1343,7 @@ introspect Python source code and populate the doc-forge Project models. - A Module instance. + A populated Module instance. @@ -1386,17 +1357,20 @@ introspect Python source code and populate the doc-forge Project models. - - load_project + + load_project - -load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project - + +1load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project + - Load multiple modules and combine them into a single Project models. + Load multiple modules and assemble them into a Project model. +Each module path is introspected and converted into a Module +instance. All modules are then aggregated into a single Project +object. Parameters: @@ -1417,7 +1391,7 @@ introspect Python source code and populate the doc-forge Project models. - A list of dotted paths to the modules to load. + List of dotted module import paths to load. @@ -1431,7 +1405,8 @@ introspect Python source code and populate the doc-forge Project models. - Optional name for the project. Defaults to the first module name. + Optional override for the project name. Defaults +to the top-level name of the first module. @@ -1445,7 +1420,8 @@ introspect Python source code and populate the doc-forge Project models. - If True, modules that fail to import will be skipped. + If True, modules that fail to load will be +skipped instead of raising an error. @@ -1471,7 +1447,41 @@ introspect Python source code and populate the doc-forge Project models. - A Project instance containing the loaded modules. + A populated Project instance containing the loaded modules. + + + + + + + +Raises: + + + + Type + Description + + + + + + ValueError + + + + If no module paths are provided. + + + + + + ImportError + + + + If a module fails to load and +skip_import_errors is False. @@ -1489,26 +1499,30 @@ introspect Python source code and populate the doc-forge Project models. - +Functions - - discover_module_paths + + discover_module_paths - -discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] - + +1discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] + - Discover all Python modules under a package via filesystem traversal. -Rules: -- Directory with init.py is treated as a package. -- Any .py file is treated as a module. -- All paths are converted to dotted module paths. + Discover Python modules within a package directory. +The function scans the filesystem for .py files inside the specified +package and converts them into dotted module import paths. +Discovery rules: + +Directories containing __init__.py are treated as packages. +Each .py file is treated as a module. +Results are returned as dotted import paths. + Parameters: @@ -1529,7 +1543,7 @@ introspect Python source code and populate the doc-forge Project models. - The name of the package to discover. + Top-level package name to discover modules from. @@ -1543,7 +1557,8 @@ introspect Python source code and populate the doc-forge Project models. - The root directory of the project. Defaults to current working directory. + Root directory used to resolve module paths. If not +provided, the current working directory is used. @@ -1569,7 +1584,30 @@ introspect Python source code and populate the doc-forge Project models. - A sorted list of dotted module paths. + A sorted list of unique dotted module import paths. + + + + + + + +Raises: + + + + Type + Description + + + + + + FileNotFoundError + + + + If the specified package directory does not exist. @@ -1604,6 +1642,8 @@ introspect Python source code and populate the doc-forge Project models. + + @@ -1641,7 +1681,7 @@ introspect Python source code and populate the doc-forge Project models. - + diff --git a/libs/doc-forge/site/loaders/index.html b/libs/doc-forge/site/loaders/index.html index b2208f3..94cb51c 100644 --- a/libs/doc-forge/site/loaders/index.html +++ b/libs/doc-forge/site/loaders/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -372,6 +249,14 @@ + + + + + + + + @@ -379,7 +264,6 @@ - @@ -389,8 +273,9 @@ - - + + + @@ -399,8 +284,14 @@ - - + + + + + + + + @@ -410,150 +301,6 @@ - - - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - Table of contents - - - - - - - loaders - - - - - - - - - - Loader Layer - - - - - - - - - - Core Features - - - - - - - - - - - - - - GriffeLoader - - - - - - - - - - load_module - - - - - - - - - load_project - - - - - - - - - - - - - - discover_module_paths - - - - - - - - - - - - - - - - - - @@ -593,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -608,8 +369,9 @@ - - + + + @@ -618,8 +380,14 @@ - - + + + + + + + + @@ -629,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -735,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -750,8 +511,9 @@ - - + + + @@ -760,8 +522,14 @@ - - + + + + + + + + @@ -771,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -877,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -892,8 +653,9 @@ - - + + + @@ -902,8 +664,14 @@ - - + + + + + + + + @@ -913,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -1019,13 +766,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1034,8 +797,9 @@ - - + + + @@ -1044,8 +808,14 @@ - - + + + + + + + + @@ -1055,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1213,28 +962,23 @@ - + - Loader Layer + Overview - - + - + - Core Features + Classes - - - - - - + + @@ -1247,6 +991,16 @@ + + + Functions + + + + + + + load_module @@ -1269,6 +1023,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1281,6 +1055,11 @@ + + + + + @@ -1307,25 +1086,30 @@ - docforge.loaders + docforge.loaders - Loader Layer -The docforge.loaders package is responsible for discovering Python source files -and extracting their documentation using static analysis. -Core Features + Loader layer for doc-forge. +The docforge.loaders package is responsible for discovering Python modules +and extracting documentation data using static analysis. + +Overview +This layer converts Python source code into an intermediate documentation +model used by doc-forge. It performs module discovery, introspection, and +initial filtering before the data is passed to the core documentation models. +Core capabilities include: -Discovery: Automatically find all modules and packages in a project - directory. -Introspection: Uses griffe to parse docstrings, signatures, and - hierarchical relationships without executing the code. -Filtering: Automatically excludes private members (prefixed with _) to - ensure clean public documentation. +Module discovery – Locate Python modules and packages within a project. +Static introspection – Parse docstrings, signatures, and object + hierarchies using the griffe library without executing the code. +Public API filtering – Exclude private members (names prefixed with + _) to produce clean public documentation structures. + @@ -1336,26 +1120,31 @@ and extracting their documentation using static analysis. - +Classes - - GriffeLoader + + GriffeLoader - -GriffeLoader() - + +1GriffeLoader() + - Loads Python modules and extracts documentation using the Griffe introspection engine. + Load Python modules using Griffe and convert them into doc-forge models. +This loader uses the Griffe introspection engine to analyze Python source +code and transform the extracted information into Project, Module, +and DocObject instances used by doc-forge. - Initialize the GriffeLoader. + Initialize the Griffe-backed loader. +Creates an internal Griffe loader instance with dedicated collections +for modules and source lines. @@ -1368,22 +1157,24 @@ and extracting their documentation using static analysis. - +Functions - - load_module + + load_module - -load_module(path: str) -> Module - + +1load_module(path: str) -> Module + - Load a single module and convert its introspection data into the docforge models. + Load and convert a single Python module. +The module is introspected using Griffe and then transformed into +a doc-forge Module model. Parameters: @@ -1404,7 +1195,7 @@ and extracting their documentation using static analysis. - The dotted path of the module to load. + Dotted import path of the module. @@ -1430,7 +1221,7 @@ and extracting their documentation using static analysis. - A Module instance. + A populated Module instance. @@ -1444,17 +1235,20 @@ and extracting their documentation using static analysis. - - load_project + + load_project - -load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project - + +1load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project + - Load multiple modules and combine them into a single Project models. + Load multiple modules and assemble them into a Project model. +Each module path is introspected and converted into a Module +instance. All modules are then aggregated into a single Project +object. Parameters: @@ -1475,7 +1269,7 @@ and extracting their documentation using static analysis. - A list of dotted paths to the modules to load. + List of dotted module import paths to load. @@ -1489,7 +1283,8 @@ and extracting their documentation using static analysis. - Optional name for the project. Defaults to the first module name. + Optional override for the project name. Defaults +to the top-level name of the first module. @@ -1503,7 +1298,8 @@ and extracting their documentation using static analysis. - If True, modules that fail to import will be skipped. + If True, modules that fail to load will be +skipped instead of raising an error. @@ -1529,7 +1325,41 @@ and extracting their documentation using static analysis. - A Project instance containing the loaded modules. + A populated Project instance containing the loaded modules. + + + + + + + +Raises: + + + + Type + Description + + + + + + ValueError + + + + If no module paths are provided. + + + + + + ImportError + + + + If a module fails to load and +skip_import_errors is False. @@ -1547,26 +1377,30 @@ and extracting their documentation using static analysis. - +Functions - - discover_module_paths + + discover_module_paths - -discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] - + +1discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] + - Discover all Python modules under a package via filesystem traversal. -Rules: -- Directory with init.py is treated as a package. -- Any .py file is treated as a module. -- All paths are converted to dotted module paths. + Discover Python modules within a package directory. +The function scans the filesystem for .py files inside the specified +package and converts them into dotted module import paths. +Discovery rules: + +Directories containing __init__.py are treated as packages. +Each .py file is treated as a module. +Results are returned as dotted import paths. + Parameters: @@ -1587,7 +1421,7 @@ and extracting their documentation using static analysis. - The name of the package to discover. + Top-level package name to discover modules from. @@ -1601,7 +1435,8 @@ and extracting their documentation using static analysis. - The root directory of the project. Defaults to current working directory. + Root directory used to resolve module paths. If not +provided, the current working directory is used. @@ -1627,7 +1462,30 @@ and extracting their documentation using static analysis. - A sorted list of dotted module paths. + A sorted list of unique dotted module import paths. + + + + + + + +Raises: + + + + Type + Description + + + + + + FileNotFoundError + + + + If the specified package directory does not exist. @@ -1662,6 +1520,8 @@ and extracting their documentation using static analysis. + + @@ -1699,7 +1559,7 @@ and extracting their documentation using static analysis. - + diff --git a/libs/doc-forge/site/models/index.html b/libs/doc-forge/site/models/index.html index eaac0b5..be12b48 100644 --- a/libs/doc-forge/site/models/index.html +++ b/libs/doc-forge/site/models/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -468,6 +341,18 @@ + + + + + + + + + + + + @@ -475,7 +360,6 @@ - @@ -485,8 +369,9 @@ - - + + + @@ -495,8 +380,14 @@ - - + + + + + + + + @@ -506,243 +397,6 @@ - - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - Table of contents - - - - - - - models - - - - - - - - - - Model Layer - - - - - - - - - - Key Components - - - - - - - - - - - - - - DocObject - - - - - - - - - - add_member - - - - - - - - - get_all_members - - - - - - - - - get_member - - - - - - - - - - - - - - Module - - - - - - - - - - add_object - - - - - - - - - get_all_objects - - - - - - - - - get_object - - - - - - - - - - - - - - Project - - - - - - - - - - add_module - - - - - - - - - get_all_modules - - - - - - - - - get_module - - - - - - - - - get_module_list - - - - - - - - - - - - - - - - - - - - - - - @@ -828,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -843,8 +511,9 @@ - - + + + @@ -853,8 +522,14 @@ - - + + + + + + + + @@ -864,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -970,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -985,8 +653,9 @@ - - + + + @@ -995,8 +664,14 @@ - - + + + + + + + + @@ -1006,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -1112,13 +766,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1127,8 +797,9 @@ - - + + + @@ -1137,8 +808,14 @@ - - + + + + + + + + @@ -1148,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1306,28 +962,23 @@ - + - Model Layer + Overview - - + - + - Key Components + Classes - - - - - - + + @@ -1340,6 +991,16 @@ + + + Functions + + + + + + + add_member @@ -1369,6 +1030,11 @@ + + + + + @@ -1382,6 +1048,16 @@ + + + Functions + + + + + + + add_object @@ -1411,6 +1087,11 @@ + + + + + @@ -1424,6 +1105,16 @@ + + + Functions + + + + + + + add_module @@ -1467,6 +1158,16 @@ + + + + + + + + + + @@ -1493,24 +1194,34 @@ - docforge.models + docforge.models - Model Layer -The docforge.models package provides the core data structures used to represent -Python source code in a documentation-focused hierarchy. -Key Components + Model layer for doc-forge. +The docforge.models package defines the core data structures used to +represent Python source code as a structured documentation model. + +Overview +The model layer forms the central intermediate representation used throughout +doc-forge. Python modules and objects discovered during introspection are +converted into a hierarchy of documentation models that can later be rendered +into different documentation formats. +Key components: -Project: The root container for all documented modules. -Module: Represents a Python module or package, containing members. -DocObject: A recursive structure for classes, functions, and attributes. +Project – Root container representing an entire documented codebase. +Module – Representation of a Python module or package containing + documented members. +DocObject – Recursive structure representing Python objects such as + classes, functions, methods, and attributes. -These classes are designed to be renderer-agnostic, allowing the same internal -representation to be transformed into various output formats (currently MkDocs). +These models are intentionally renderer-agnostic, allowing the same +documentation structure to be transformed into multiple output formats +(e.g., MkDocs, MCP, or other renderers). + @@ -1521,24 +1232,27 @@ representation to be transformed into various output formats (currently MkDocs). - +Classes - - DocObject + + DocObject - -DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) - + +1DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) + - Represents a documented Python object (class, function, method, etc.). + Representation of a documented Python object. +A DocObject models a single Python entity discovered during +introspection. Objects may contain nested members, allowing the structure +of modules, classes, and other containers to be represented recursively. Attributes: @@ -1569,7 +1283,8 @@ representation to be transformed into various output formats (currently MkDocs). - Type of object (e.g., 'class', 'function', 'attribute'). + Type of object (for example class, function, +method, or attribute). @@ -1580,7 +1295,7 @@ representation to be transformed into various output formats (currently MkDocs). - Full dotted import path to the object. + Fully qualified dotted path to the object. @@ -1591,7 +1306,7 @@ representation to be transformed into various output formats (currently MkDocs). - Callable signature, if applicable. + Callable signature if the object represents a callable. @@ -1602,7 +1317,7 @@ representation to be transformed into various output formats (currently MkDocs). - Raw docstring content extracted from the source. + Raw docstring text extracted from the source code. @@ -1613,14 +1328,14 @@ representation to be transformed into various output formats (currently MkDocs). - Dictionary mapping member names to their DocObject representations. + Mapping of member names to child DocObject instances. - Initialize a new DocObject. + Initialize a DocObject instance. Parameters: @@ -1641,7 +1356,7 @@ representation to be transformed into various output formats (currently MkDocs). - The local name of the object. + Local name of the object. @@ -1655,7 +1370,7 @@ representation to be transformed into various output formats (currently MkDocs). - The kind of object (e.g., 'class', 'function'). + Object type identifier (for example class or function). @@ -1669,7 +1384,7 @@ representation to be transformed into various output formats (currently MkDocs). - The full dotted path to the object. + Fully qualified dotted path of the object. @@ -1683,7 +1398,7 @@ representation to be transformed into various output formats (currently MkDocs). - The object's signature (for callable objects). + Callable signature if applicable. @@ -1697,7 +1412,7 @@ representation to be transformed into various output formats (currently MkDocs). - The object's docstring, if any. + Documentation string associated with the object. @@ -1718,22 +1433,24 @@ representation to be transformed into various output formats (currently MkDocs). - +Functions - - add_member + + add_member - -add_member(obj: DocObject) -> None - + +1add_member(obj: DocObject) -> None + - Add a child member to this object (e.g., a method to a class). + Add a child documentation object. +This is typically used when attaching methods to classes or +nested objects to their parent containers. Parameters: @@ -1754,7 +1471,7 @@ representation to be transformed into various output formats (currently MkDocs). - The child DocObject to add. + Documentation object to add as a member. @@ -1771,17 +1488,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_all_members + + get_all_members - -get_all_members() -> Iterable[DocObject] - + +1get_all_members() -> Iterable[DocObject] + - Get all members of this object. + Return all child members of the object. Returns: @@ -1799,7 +1516,7 @@ representation to be transformed into various output formats (currently MkDocs). - An iterable of child DocObject instances. + An iterable of DocObject instances representing nested members. @@ -1813,17 +1530,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_member + + get_member - -get_member(name: str) -> DocObject - + +1get_member(name: str) -> DocObject + - Retrieve a child member by name. + Retrieve a member object by name. Parameters: @@ -1844,7 +1561,7 @@ representation to be transformed into various output formats (currently MkDocs). - The name of the member. + Name of the member to retrieve. @@ -1870,7 +1587,30 @@ representation to be transformed into various output formats (currently MkDocs). - The requested DocObject. + The corresponding DocObject instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If the member does not exist. @@ -1893,18 +1633,21 @@ representation to be transformed into various output formats (currently MkDocs). - - Module + + Module - -Module(path: str, docstring: Optional[str] = None) - + +1Module(path: str, docstring: Optional[str] = None) + - Represents a documented Python module or package. + Representation of a documented Python module or package. +A Module stores metadata about the module itself and maintains a +collection of top-level documentation objects discovered during +introspection. Attributes: @@ -1935,7 +1678,7 @@ representation to be transformed into various output formats (currently MkDocs). - Module-level docstring content. + Module-level documentation string, if present. @@ -1946,14 +1689,15 @@ representation to be transformed into various output formats (currently MkDocs). - Dictionary mapping object names to their DocObject representations. + Mapping of object names to their corresponding +DocObject representations. - Initialize a new Module. + Initialize a Module instance. Parameters: @@ -1974,7 +1718,7 @@ representation to be transformed into various output formats (currently MkDocs). - The dotted path of the module. + Dotted import path identifying the module. @@ -1988,7 +1732,7 @@ representation to be transformed into various output formats (currently MkDocs). - The module's docstring, if any. + Module-level documentation text, if available. @@ -2009,18 +1753,18 @@ representation to be transformed into various output formats (currently MkDocs). - +Functions - - add_object + + add_object - -add_object(obj: DocObject) -> None - + +1add_object(obj: DocObject) -> None + @@ -2045,7 +1789,8 @@ representation to be transformed into various output formats (currently MkDocs). - The object to add. + Documentation object to register as a top-level +member of the module. @@ -2062,17 +1807,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_all_objects + + get_all_objects - -get_all_objects() -> Iterable[DocObject] - + +1get_all_objects() -> Iterable[DocObject] + - Get all top-level objects in the module. + Return all top-level documentation objects in the module. Returns: @@ -2090,7 +1835,17 @@ representation to be transformed into various output formats (currently MkDocs). - An iterable of DocObject instances. + An iterable of DocObject instances representing the + + + + + + Iterable[DocObject] + + + + module's public members. @@ -2104,17 +1859,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_object + + get_object - -get_object(name: str) -> DocObject - + +1get_object(name: str) -> DocObject + - Retrieve a member object by name. + Retrieve a documented object by name. Parameters: @@ -2135,7 +1890,7 @@ representation to be transformed into various output formats (currently MkDocs). - The name of the object. + Name of the object to retrieve. @@ -2161,7 +1916,30 @@ representation to be transformed into various output formats (currently MkDocs). - The requested DocObject. + The corresponding DocObject instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If no object with the given name exists. @@ -2184,18 +1962,20 @@ representation to be transformed into various output formats (currently MkDocs). - - Project + + Project - -Project(name: str) - + +1Project(name: str) + - Represents a documentation project, serving as a container for modules. + Representation of a documentation project. +A Project serves as the root container for all modules discovered during +introspection. Each module is stored by its dotted import path. Attributes: @@ -2226,14 +2006,14 @@ representation to be transformed into various output formats (currently MkDocs). - Dictionary mapping module paths to Module instances. + Mapping of module paths to Module instances. - Initialize a new Project. + Initialize a Project instance. Parameters: @@ -2254,7 +2034,7 @@ representation to be transformed into various output formats (currently MkDocs). - The name of the project. + Name used to identify the documentation project. @@ -2275,22 +2055,22 @@ representation to be transformed into various output formats (currently MkDocs). - +Functions - - add_module + + add_module - -add_module(module: Module) -> None - + +1add_module(module: Module) -> None + - Add a module to the project. + Register a module in the project. Parameters: @@ -2311,7 +2091,7 @@ representation to be transformed into various output formats (currently MkDocs). - The module to add. + Module instance to add to the project. @@ -2328,17 +2108,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_all_modules + + get_all_modules - -get_all_modules() -> Iterable[Module] - + +1get_all_modules() -> Iterable[Module] + - Get all modules in the project. + Return all modules contained in the project. Returns: @@ -2356,7 +2136,7 @@ representation to be transformed into various output formats (currently MkDocs). - An iterable of Module objects. + An iterable of Module instances. @@ -2370,13 +2150,13 @@ representation to be transformed into various output formats (currently MkDocs). - - get_module + + get_module - -get_module(path: str) -> Module - + +1get_module(path: str) -> Module + @@ -2401,7 +2181,7 @@ representation to be transformed into various output formats (currently MkDocs). - The dotted path of the module (e.g., 'pkg.mod'). + Fully qualified dotted module path (for example pkg.module). @@ -2427,7 +2207,30 @@ representation to be transformed into various output formats (currently MkDocs). - The requested Module. + The corresponding Module instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If the module does not exist in the project. @@ -2441,17 +2244,17 @@ representation to be transformed into various output formats (currently MkDocs). - - get_module_list + + get_module_list - -get_module_list() -> list[str] - + +1get_module_list() -> list[str] + - Get the list of all module dotted paths. + Return the list of module import paths. Returns: @@ -2469,7 +2272,7 @@ representation to be transformed into various output formats (currently MkDocs). - A list of module paths. + A list containing the dotted paths of all modules in the project. @@ -2513,6 +2316,8 @@ representation to be transformed into various output formats (currently MkDocs). + + @@ -2550,7 +2355,7 @@ representation to be transformed into various output formats (currently MkDocs). - + diff --git a/libs/doc-forge/site/models/module/index.html b/libs/doc-forge/site/models/module/index.html index aa0f705..8aefbe5 100644 --- a/libs/doc-forge/site/models/module/index.html +++ b/libs/doc-forge/site/models/module/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -468,6 +341,18 @@ + + + + + + + + + + + + @@ -475,7 +360,6 @@ - @@ -485,8 +369,9 @@ - - + + + @@ -495,8 +380,14 @@ - - + + + + + + + + @@ -506,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -595,6 +465,16 @@ + + + Classes + + + + + + + Module @@ -605,6 +485,16 @@ + + + Functions + + + + + + + add_object @@ -639,6 +529,16 @@ + + + + + + + + + + @@ -711,13 +611,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -726,8 +640,9 @@ - - + + + @@ -736,8 +651,14 @@ - - + + + + + + + + @@ -747,27 +668,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -853,13 +753,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -868,8 +782,9 @@ - - + + + @@ -878,8 +793,14 @@ - - + + + + + + + + @@ -889,27 +810,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -995,13 +895,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1010,8 +926,9 @@ - - + + + @@ -1020,8 +937,14 @@ - - + + + + + + + + @@ -1031,27 +954,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1189,6 +1091,16 @@ + + + Classes + + + + + + + Module @@ -1199,6 +1111,16 @@ + + + Functions + + + + + + + add_object @@ -1233,6 +1155,16 @@ + + + + + + + + + + @@ -1259,16 +1191,18 @@ - docforge.models.module + docforge.models.module - This module defines the Module class, which represents a Python module or package -in the doc-forge documentation models. It acts as a container for top-level -documented objects. + Documentation model representing a Python module or package. +This module defines the Module class used in the doc-forge documentation +model. A Module acts as a container for top-level documented objects +(classes, functions, variables, and other members) discovered during +introspection. @@ -1279,24 +1213,27 @@ documented objects. - +Classes - - Module + + Module - -Module(path: str, docstring: Optional[str] = None) - + +1Module(path: str, docstring: Optional[str] = None) + - Represents a documented Python module or package. + Representation of a documented Python module or package. +A Module stores metadata about the module itself and maintains a +collection of top-level documentation objects discovered during +introspection. Attributes: @@ -1327,7 +1264,7 @@ documented objects. - Module-level docstring content. + Module-level documentation string, if present. @@ -1338,14 +1275,15 @@ documented objects. - Dictionary mapping object names to their DocObject representations. + Mapping of object names to their corresponding +DocObject representations. - Initialize a new Module. + Initialize a Module instance. Parameters: @@ -1366,7 +1304,7 @@ documented objects. - The dotted path of the module. + Dotted import path identifying the module. @@ -1380,7 +1318,7 @@ documented objects. - The module's docstring, if any. + Module-level documentation text, if available. @@ -1401,18 +1339,18 @@ documented objects. - +Functions - - add_object + + add_object - -add_object(obj: DocObject) -> None - + +1add_object(obj: DocObject) -> None + @@ -1437,7 +1375,8 @@ documented objects. - The object to add. + Documentation object to register as a top-level +member of the module. @@ -1454,17 +1393,17 @@ documented objects. - - get_all_objects + + get_all_objects - -get_all_objects() -> Iterable[DocObject] - + +1get_all_objects() -> Iterable[DocObject] + - Get all top-level objects in the module. + Return all top-level documentation objects in the module. Returns: @@ -1482,7 +1421,17 @@ documented objects. - An iterable of DocObject instances. + An iterable of DocObject instances representing the + + + + + + Iterable[DocObject] + + + + module's public members. @@ -1496,17 +1445,17 @@ documented objects. - - get_object + + get_object - -get_object(name: str) -> DocObject - + +1get_object(name: str) -> DocObject + - Retrieve a member object by name. + Retrieve a documented object by name. Parameters: @@ -1527,7 +1476,7 @@ documented objects. - The name of the object. + Name of the object to retrieve. @@ -1553,7 +1502,30 @@ documented objects. - The requested DocObject. + The corresponding DocObject instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If no object with the given name exists. @@ -1597,6 +1569,8 @@ documented objects. + + @@ -1634,7 +1608,7 @@ documented objects. - + diff --git a/libs/doc-forge/site/models/object/index.html b/libs/doc-forge/site/models/object/index.html index dd2c5ea..5d9886e 100644 --- a/libs/doc-forge/site/models/object/index.html +++ b/libs/doc-forge/site/models/object/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -468,6 +341,18 @@ + + + + + + + + + + + + @@ -475,7 +360,6 @@ - @@ -485,8 +369,9 @@ - - + + + @@ -495,8 +380,14 @@ - - + + + + + + + + @@ -506,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -618,6 +488,16 @@ + + + Classes + + + + + + + DocObject @@ -628,6 +508,16 @@ + + + Functions + + + + + + + add_member @@ -662,6 +552,16 @@ + + + + + + + + + + @@ -711,13 +611,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -726,8 +640,9 @@ - - + + + @@ -736,8 +651,14 @@ - - + + + + + + + + @@ -747,27 +668,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -853,13 +753,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -868,8 +782,9 @@ - - + + + @@ -878,8 +793,14 @@ - - + + + + + + + + @@ -889,27 +810,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -995,13 +895,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1010,8 +926,9 @@ - - + + + @@ -1020,8 +937,14 @@ - - + + + + + + + + @@ -1031,27 +954,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1189,6 +1091,16 @@ + + + Classes + + + + + + + DocObject @@ -1199,6 +1111,16 @@ + + + Functions + + + + + + + add_member @@ -1233,6 +1155,16 @@ + + + + + + + + + + @@ -1259,16 +1191,18 @@ - docforge.models.object + docforge.models.object - This module defines the DocObject class, the fundamental recursive unit of the -doc-forge documentation models. A DocObject represents a single Python entity -(class, function, method, or attribute) and its nested members. + Documentation model representing individual Python objects. +This module defines the DocObject class, the fundamental recursive unit of +the doc-forge documentation model. Each DocObject represents a Python +entity such as a class, function, method, or attribute, and may contain nested +members that form a hierarchical documentation structure. @@ -1279,24 +1213,27 @@ doc-forge documentation models. A DocObject represents a single Python entity - +Classes - - DocObject + + DocObject - -DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) - + +1DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) + - Represents a documented Python object (class, function, method, etc.). + Representation of a documented Python object. +A DocObject models a single Python entity discovered during +introspection. Objects may contain nested members, allowing the structure +of modules, classes, and other containers to be represented recursively. Attributes: @@ -1327,7 +1264,8 @@ doc-forge documentation models. A DocObject represents a single Python entity - Type of object (e.g., 'class', 'function', 'attribute'). + Type of object (for example class, function, +method, or attribute). @@ -1338,7 +1276,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - Full dotted import path to the object. + Fully qualified dotted path to the object. @@ -1349,7 +1287,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - Callable signature, if applicable. + Callable signature if the object represents a callable. @@ -1360,7 +1298,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - Raw docstring content extracted from the source. + Raw docstring text extracted from the source code. @@ -1371,14 +1309,14 @@ doc-forge documentation models. A DocObject represents a single Python entity - Dictionary mapping member names to their DocObject representations. + Mapping of member names to child DocObject instances. - Initialize a new DocObject. + Initialize a DocObject instance. Parameters: @@ -1399,7 +1337,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The local name of the object. + Local name of the object. @@ -1413,7 +1351,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The kind of object (e.g., 'class', 'function'). + Object type identifier (for example class or function). @@ -1427,7 +1365,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The full dotted path to the object. + Fully qualified dotted path of the object. @@ -1441,7 +1379,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The object's signature (for callable objects). + Callable signature if applicable. @@ -1455,7 +1393,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The object's docstring, if any. + Documentation string associated with the object. @@ -1476,22 +1414,24 @@ doc-forge documentation models. A DocObject represents a single Python entity - +Functions - - add_member + + add_member - -add_member(obj: DocObject) -> None - + +1add_member(obj: DocObject) -> None + - Add a child member to this object (e.g., a method to a class). + Add a child documentation object. +This is typically used when attaching methods to classes or +nested objects to their parent containers. Parameters: @@ -1512,7 +1452,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The child DocObject to add. + Documentation object to add as a member. @@ -1529,17 +1469,17 @@ doc-forge documentation models. A DocObject represents a single Python entity - - get_all_members + + get_all_members - -get_all_members() -> Iterable[DocObject] - + +1get_all_members() -> Iterable[DocObject] + - Get all members of this object. + Return all child members of the object. Returns: @@ -1557,7 +1497,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - An iterable of child DocObject instances. + An iterable of DocObject instances representing nested members. @@ -1571,17 +1511,17 @@ doc-forge documentation models. A DocObject represents a single Python entity - - get_member + + get_member - -get_member(name: str) -> DocObject - + +1get_member(name: str) -> DocObject + - Retrieve a child member by name. + Retrieve a member object by name. Parameters: @@ -1602,7 +1542,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - The name of the member. + Name of the member to retrieve. @@ -1628,7 +1568,30 @@ doc-forge documentation models. A DocObject represents a single Python entity - The requested DocObject. + The corresponding DocObject instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If the member does not exist. @@ -1672,6 +1635,8 @@ doc-forge documentation models. A DocObject represents a single Python entity + + @@ -1709,7 +1674,7 @@ doc-forge documentation models. A DocObject represents a single Python entity - + diff --git a/libs/doc-forge/site/models/project/index.html b/libs/doc-forge/site/models/project/index.html index a8fdd85..6e9c046 100644 --- a/libs/doc-forge/site/models/project/index.html +++ b/libs/doc-forge/site/models/project/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -468,6 +341,18 @@ + + + + + + + + + + + + @@ -475,7 +360,6 @@ - @@ -485,8 +369,9 @@ - - + + + @@ -495,8 +380,14 @@ - - + + + + + + + + @@ -506,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -641,6 +511,16 @@ + + + Classes + + + + + + + Project @@ -651,6 +531,16 @@ + + + Functions + + + + + + + add_module @@ -694,6 +584,16 @@ + + + + + + + + + + @@ -720,13 +620,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -735,8 +649,9 @@ - - + + + @@ -745,8 +660,14 @@ - - + + + + + + + + @@ -756,27 +677,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -862,13 +762,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -877,8 +791,9 @@ - - + + + @@ -887,8 +802,14 @@ - - + + + + + + + + @@ -898,27 +819,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -1004,13 +904,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1019,8 +935,9 @@ - - + + + @@ -1029,8 +946,14 @@ - - + + + + + + + + @@ -1040,27 +963,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1198,6 +1100,16 @@ + + + Classes + + + + + + + Project @@ -1208,6 +1120,16 @@ + + + Functions + + + + + + + add_module @@ -1251,6 +1173,16 @@ + + + + + + + + + + @@ -1277,15 +1209,17 @@ - docforge.models.project + docforge.models.project - This module defines the Project class, the top-level container for a documented -project. It aggregates multiple Module instances into a single named entity. + Documentation model representing a project. +This module defines the Project class, the top-level container used by +doc-forge to represent a documented codebase. A Project aggregates multiple +modules and provides access to them through a unified interface. @@ -1296,24 +1230,26 @@ project. It aggregates multiple Module instances into a single named entity. - +Classes - - Project + + Project - -Project(name: str) - + +1Project(name: str) + - Represents a documentation project, serving as a container for modules. + Representation of a documentation project. +A Project serves as the root container for all modules discovered during +introspection. Each module is stored by its dotted import path. Attributes: @@ -1344,14 +1280,14 @@ project. It aggregates multiple Module instances into a single named entity. - Dictionary mapping module paths to Module instances. + Mapping of module paths to Module instances. - Initialize a new Project. + Initialize a Project instance. Parameters: @@ -1372,7 +1308,7 @@ project. It aggregates multiple Module instances into a single named entity. - The name of the project. + Name used to identify the documentation project. @@ -1393,22 +1329,22 @@ project. It aggregates multiple Module instances into a single named entity. - +Functions - - add_module + + add_module - -add_module(module: Module) -> None - + +1add_module(module: Module) -> None + - Add a module to the project. + Register a module in the project. Parameters: @@ -1429,7 +1365,7 @@ project. It aggregates multiple Module instances into a single named entity. - The module to add. + Module instance to add to the project. @@ -1446,17 +1382,17 @@ project. It aggregates multiple Module instances into a single named entity. - - get_all_modules + + get_all_modules - -get_all_modules() -> Iterable[Module] - + +1get_all_modules() -> Iterable[Module] + - Get all modules in the project. + Return all modules contained in the project. Returns: @@ -1474,7 +1410,7 @@ project. It aggregates multiple Module instances into a single named entity. - An iterable of Module objects. + An iterable of Module instances. @@ -1488,13 +1424,13 @@ project. It aggregates multiple Module instances into a single named entity. - - get_module + + get_module - -get_module(path: str) -> Module - + +1get_module(path: str) -> Module + @@ -1519,7 +1455,7 @@ project. It aggregates multiple Module instances into a single named entity. - The dotted path of the module (e.g., 'pkg.mod'). + Fully qualified dotted module path (for example pkg.module). @@ -1545,7 +1481,30 @@ project. It aggregates multiple Module instances into a single named entity. - The requested Module. + The corresponding Module instance. + + + + + + + +Raises: + + + + Type + Description + + + + + + KeyError + + + + If the module does not exist in the project. @@ -1559,17 +1518,17 @@ project. It aggregates multiple Module instances into a single named entity. - - get_module_list + + get_module_list - -get_module_list() -> list[str] - + +1get_module_list() -> list[str] + - Get the list of all module dotted paths. + Return the list of module import paths. Returns: @@ -1587,7 +1546,7 @@ project. It aggregates multiple Module instances into a single named entity. - A list of module paths. + A list containing the dotted paths of all modules in the project. @@ -1631,6 +1590,8 @@ project. It aggregates multiple Module instances into a single named entity. + + @@ -1668,7 +1629,7 @@ project. It aggregates multiple Module instances into a single named entity. - + diff --git a/libs/doc-forge/site/nav/index.html b/libs/doc-forge/site/nav/index.html index 9a2fee3..05a6e27 100644 --- a/libs/doc-forge/site/nav/index.html +++ b/libs/doc-forge/site/nav/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -610,6 +483,18 @@ + + + + + + + + + + + + @@ -617,7 +502,6 @@ - @@ -627,8 +511,9 @@ - - + + + @@ -637,8 +522,14 @@ - - + + + + + + + + @@ -648,207 +539,6 @@ - - - - - - - - - - - - - - - - - - - - - Nav - - - - - - - - - - - - - Nav - - - - - - - - - - - - - - - - - - Table of contents - - - - - - - nav - - - - - - - - - - Navigation Layer - - - - - - - - - - Workflow - - - - - - - - - - - - - - MkDocsNavEmitter - - - - - - - - - - emit - - - - - - - - - - - - - - NavSpec - - - - - - - - - - all_patterns - - - - - - - - - load - - - - - - - - - - - - - - ResolvedNav - - - - - - - - - - all_files - - - - - - - - - - - - - - load_nav_spec - - - - - - - - - resolve_nav - - - - - - - - - - - - - - - - - - @@ -934,13 +624,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -949,8 +653,9 @@ - - + + + @@ -959,8 +664,14 @@ - - + + + + + + + + @@ -970,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -1076,13 +766,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1091,8 +797,9 @@ - - + + + @@ -1101,8 +808,14 @@ - - + + + + + + + + @@ -1112,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1270,16 +962,6 @@ - - - Navigation Layer - - - - - - - Workflow @@ -1288,10 +970,15 @@ - - + + + + Classes + + - + + @@ -1304,6 +991,16 @@ + + + Functions + + + + + + + emit @@ -1315,6 +1012,11 @@ + + + + + @@ -1328,6 +1030,16 @@ + + + Functions + + + + + + + all_patterns @@ -1348,6 +1060,11 @@ + + + + + @@ -1361,6 +1078,16 @@ + + + Functions + + + + + + + all_files @@ -1374,6 +1101,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1395,6 +1142,11 @@ + + + + + @@ -1421,24 +1173,30 @@ - docforge.nav + docforge.nav - Navigation Layer -The docforge.nav package manages the mapping between the logical documentation -structure and the physical files on disk. + Navigation layer for doc-forge. +The docforge.nav package manages the relationship between the logical +documentation structure defined by the user and the physical documentation +files generated on disk. + Workflow -Spec Definition: Users define navigation intent in docforge.nav.yml. -Resolution: resolve_nav matches patterns in the spec to generated .md files. -Emission: MkDocsNavEmitter produces the final YAML structure for mkdocs.yml. +Specification – Users define navigation intent in docforge.nav.yml. +Resolution – resolve_nav expands patterns and matches them against + generated Markdown files. +Emission – MkDocsNavEmitter converts the resolved structure into + the YAML navigation format required by mkdocs.yml. -This abstraction allows doc-forge to support complex grouping and ordering -independently of the source code's physical layout. +This layer separates documentation organization from the underlying source +code layout, enabling flexible grouping, ordering, and navigation structures +independent of module hierarchy. + @@ -1449,24 +1207,25 @@ independently of the source code's physical layout. - +Classes - - MkDocsNavEmitter + + MkDocsNavEmitter - + - Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible -navigation structure. + Emit MkDocs navigation structures from resolved navigation data. +The emitter transforms a ResolvedNav object into the YAML-compatible +list structure expected by the MkDocs nav configuration field. @@ -1479,22 +1238,22 @@ navigation structure. - +Functions - - emit + + emit - -emit(nav: ResolvedNav) -> List[Dict[str, Any]] - + +1emit(nav: ResolvedNav) -> List[Dict[str, Any]] + - Generate a list of navigation entries for mkdocs.yml. + Generate a navigation structure for mkdocs.yml. Parameters: @@ -1515,7 +1274,8 @@ navigation structure. - The resolved navigation data. + Resolved navigation data describing documentation groups +and their associated Markdown files. @@ -1541,7 +1301,27 @@ navigation structure. - A list of dictionary mappings representing the MkDocs navigation. + A list of dictionaries representing the MkDocs navigation layout. + + + + + + List[Dict[str, Any]] + + + + Each dictionary maps a navigation label to a page or a list of + + + + + + List[Dict[str, Any]] + + + + pages. @@ -1564,18 +1344,20 @@ navigation structure. - - NavSpec + + NavSpec - -NavSpec(home: Optional[str], groups: Dict[str, List[str]]) - + +1NavSpec(home: Optional[str], groups: Dict[str, List[str]]) + - Parsed representation of the docforge navigation specification file. + Parsed representation of a navigation specification. +A NavSpec describes the intended documentation navigation layout before +it is resolved against the filesystem. Attributes: @@ -1595,7 +1377,8 @@ navigation structure. - Path to the home document (e.g., 'index.md'). + Relative path to the documentation home page (for example +index.md). @@ -1606,14 +1389,15 @@ navigation structure. - Mapping of group titles to lists of path patterns/globs. + Mapping of navigation group titles to lists of file patterns +or glob expressions. - Initialize a NavSpec. + Initialize a NavSpec instance. Parameters: @@ -1634,7 +1418,7 @@ navigation structure. - The path to the home document. + Relative path to the home document. @@ -1648,7 +1432,8 @@ navigation structure. - A mapping of group names to lists of path patterns (globs). + Mapping of group names to lists of path patterns +(glob expressions). @@ -1669,22 +1454,22 @@ navigation structure. - +Functions - - all_patterns + + all_patterns - -all_patterns() -> List[str] - + +1all_patterns() -> List[str] + - Get all path patterns referenced in the specification. + Return all path patterns referenced by the specification. Returns: @@ -1702,7 +1487,17 @@ navigation structure. - A list of all patterns (home plus all groups). + A list containing the home document (if defined) and all + + + + + + List[str] + + + + group pattern entries. @@ -1716,21 +1511,21 @@ navigation structure. - - load + + load classmethod - -load(path: Path) -> NavSpec - + +1load(path: Path) -> NavSpec + - Load a NavSpec from a YAML file. + Load a navigation specification from a YAML file. Parameters: @@ -1751,7 +1546,7 @@ navigation structure. - The filesystem path to the YAML file. + Filesystem path to the navigation specification file. @@ -1777,7 +1572,7 @@ navigation structure. - A NavSpec instance. + A NavSpec instance representing the parsed configuration. @@ -1800,7 +1595,7 @@ navigation structure. - If the path does not exist. + If the specified file does not exist. @@ -1810,7 +1605,8 @@ navigation structure. - If the file content is not a valid NavSpec mapping. + If the file contents are not a valid navigation +specification. @@ -1833,19 +1629,20 @@ navigation structure. - - ResolvedNav + + ResolvedNav - -ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) - + +1ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) + - Represents a navigation structure where all patterns and paths have been -resolved against the actual filesystem contents. + Resolved navigation structure. +A ResolvedNav represents navigation data after glob patterns have been +expanded and paths validated against the filesystem. Attributes: @@ -1865,7 +1662,7 @@ resolved against the actual filesystem contents. - Resolved relative path to the home page. + Relative path to the documentation home page. @@ -1876,7 +1673,8 @@ resolved against the actual filesystem contents. - Mapping of group titles to lists of absolute or relative Path objects. + Mapping of navigation group titles to lists of resolved +documentation file paths. @@ -1904,7 +1702,7 @@ resolved against the actual filesystem contents. - The relative path to the project home page. + Relative path to the home page within the documentation root. @@ -1918,7 +1716,7 @@ resolved against the actual filesystem contents. - A mapping of group names to their resolved filesystem paths. + Mapping of group titles to resolved documentation file paths. @@ -1932,7 +1730,7 @@ resolved against the actual filesystem contents. - The root documentation directory. + Root directory of the documentation source files. @@ -1953,22 +1751,22 @@ resolved against the actual filesystem contents. - +Functions - - all_files + + all_files - -all_files() -> Iterable[Path] - + +1all_files() -> Iterable[Path] + - Get an iterable of all resolved files in the navigation structure. + Iterate over all files referenced by the navigation structure. Returns: @@ -1986,7 +1784,31 @@ resolved against the actual filesystem contents. - An iterable of Path objects. + An iterable of Path objects representing documentation files. + + + + + + + +Raises: + + + + Type + Description + + + + + + RuntimeError + + + + If the home page is defined but the documentation +root is not available for resolution. @@ -2004,22 +1826,24 @@ resolved against the actual filesystem contents. - +Functions - - load_nav_spec + + load_nav_spec - -load_nav_spec(path: Path) -> NavSpec - + +1load_nav_spec(path: Path) -> NavSpec + - Utility function to load a NavSpec from a file. + Load a navigation specification file. +This helper function reads a YAML navigation file and constructs a +corresponding NavSpec instance. Parameters: @@ -2066,7 +1890,40 @@ resolved against the actual filesystem contents. - A loaded NavSpec instance. + A NavSpec instance representing the parsed specification. + + + + + + + +Raises: + + + + Type + Description + + + + + + FileNotFoundError + + + + If the specification file does not exist. + + + + + + ValueError + + + + If the YAML structure is invalid. @@ -2080,18 +1937,19 @@ resolved against the actual filesystem contents. - - resolve_nav + + resolve_nav - -resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav - + +1resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav + - Create a ResolvedNav by processing a NavSpec against the filesystem. -This expands globs and validates the existence of referenced files. + Resolve a navigation specification against the filesystem. +The function expands glob patterns defined in a NavSpec and verifies +that referenced documentation files exist within the documentation root. Parameters: @@ -2112,7 +1970,7 @@ This expands globs and validates the existence of referenced files. - The navigation specification to resolve. + Navigation specification describing documentation layout. @@ -2126,7 +1984,7 @@ This expands globs and validates the existence of referenced files. - The root directory for documentation files. + Root directory containing documentation Markdown files. @@ -2152,7 +2010,7 @@ This expands globs and validates the existence of referenced files. - A ResolvedNav instance. + A ResolvedNav instance containing validated navigation paths. @@ -2175,7 +2033,8 @@ This expands globs and validates the existence of referenced files. - If a pattern doesn't match any files or the docs_root doesn't exist. + If the documentation root does not exist or a +navigation pattern does not match any files. @@ -2210,6 +2069,8 @@ This expands globs and validates the existence of referenced files. + + @@ -2247,7 +2108,7 @@ This expands globs and validates the existence of referenced files. - + diff --git a/libs/doc-forge/site/nav/mkdocs/index.html b/libs/doc-forge/site/nav/mkdocs/index.html index 2f3e200..1699245 100644 --- a/libs/doc-forge/site/nav/mkdocs/index.html +++ b/libs/doc-forge/site/nav/mkdocs/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -610,6 +483,18 @@ + + + + + + + + + + + + @@ -617,7 +502,6 @@ - @@ -627,8 +511,9 @@ - - + + + @@ -637,8 +522,14 @@ - - + + + + + + + + @@ -648,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -783,6 +653,16 @@ + + + Classes + + + + + + + MkDocsNavEmitter @@ -793,6 +673,16 @@ + + + Functions + + + + + + + emit @@ -809,6 +699,16 @@ + + + + + + + + + + @@ -835,13 +735,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -850,8 +764,9 @@ - - + + + @@ -860,8 +775,14 @@ - - + + + + + + + + @@ -871,27 +792,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -977,13 +877,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -992,8 +908,9 @@ - - + + + @@ -1002,8 +919,14 @@ - - + + + + + + + + @@ -1013,27 +936,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1171,6 +1073,16 @@ + + + Classes + + + + + + + MkDocsNavEmitter @@ -1181,6 +1093,16 @@ + + + Functions + + + + + + + emit @@ -1197,6 +1119,16 @@ + + + + + + + + + + @@ -1223,16 +1155,17 @@ - docforge.nav.mkdocs + docforge.nav.mkdocs - This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance -into the specific YAML-ready list structure expected by the MkDocs 'nav' -configuration. + MkDocs navigation emitter. +This module provides the MkDocsNavEmitter class, which converts a +ResolvedNav instance into the navigation structure required by the +MkDocs nav configuration. @@ -1243,24 +1176,25 @@ configuration. - +Classes - - MkDocsNavEmitter + + MkDocsNavEmitter - + - Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible -navigation structure. + Emit MkDocs navigation structures from resolved navigation data. +The emitter transforms a ResolvedNav object into the YAML-compatible +list structure expected by the MkDocs nav configuration field. @@ -1273,22 +1207,22 @@ navigation structure. - +Functions - - emit + + emit - -emit(nav: ResolvedNav) -> List[Dict[str, Any]] - + +1emit(nav: ResolvedNav) -> List[Dict[str, Any]] + - Generate a list of navigation entries for mkdocs.yml. + Generate a navigation structure for mkdocs.yml. Parameters: @@ -1309,7 +1243,8 @@ navigation structure. - The resolved navigation data. + Resolved navigation data describing documentation groups +and their associated Markdown files. @@ -1335,7 +1270,27 @@ navigation structure. - A list of dictionary mappings representing the MkDocs navigation. + A list of dictionaries representing the MkDocs navigation layout. + + + + + + List[Dict[str, Any]] + + + + Each dictionary maps a navigation label to a page or a list of + + + + + + List[Dict[str, Any]] + + + + pages. @@ -1379,6 +1334,8 @@ navigation structure. + + @@ -1416,7 +1373,7 @@ navigation structure. - + diff --git a/libs/doc-forge/site/nav/resolver/index.html b/libs/doc-forge/site/nav/resolver/index.html index 3771b10..9994b08 100644 --- a/libs/doc-forge/site/nav/resolver/index.html +++ b/libs/doc-forge/site/nav/resolver/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -610,6 +483,18 @@ + + + + + + + + + + + + @@ -617,7 +502,6 @@ - @@ -627,8 +511,9 @@ - - + + + @@ -637,8 +522,14 @@ - - + + + + + + + + @@ -648,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -760,6 +630,16 @@ + + + Classes + + + + + + + ResolvedNav @@ -770,6 +650,16 @@ + + + Functions + + + + + + + all_files @@ -783,6 +673,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -795,6 +705,11 @@ + + + + + @@ -844,13 +759,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -859,8 +788,9 @@ - - + + + @@ -869,8 +799,14 @@ - - + + + + + + + + @@ -880,27 +816,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -986,13 +901,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1001,8 +932,9 @@ - - + + + @@ -1011,8 +943,14 @@ - - + + + + + + + + @@ -1022,27 +960,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1180,6 +1097,16 @@ + + + Classes + + + + + + + ResolvedNav @@ -1190,6 +1117,16 @@ + + + Functions + + + + + + + all_files @@ -1203,6 +1140,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1215,6 +1172,11 @@ + + + + + @@ -1241,16 +1203,16 @@ - docforge.nav.resolver + docforge.nav.resolver - This module contains the logic for resolving a NavSpec against the physical -filesystem. It expands globs and validates that all referenced documents -actually exist on disk. + Navigation resolution utilities. +This module resolves a NavSpec against the filesystem by expanding glob +patterns and validating that referenced documentation files exist. @@ -1261,25 +1223,26 @@ actually exist on disk. - +Classes - - ResolvedNav + + ResolvedNav - -ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) - + +1ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) + - Represents a navigation structure where all patterns and paths have been -resolved against the actual filesystem contents. + Resolved navigation structure. +A ResolvedNav represents navigation data after glob patterns have been +expanded and paths validated against the filesystem. Attributes: @@ -1299,7 +1262,7 @@ resolved against the actual filesystem contents. - Resolved relative path to the home page. + Relative path to the documentation home page. @@ -1310,7 +1273,8 @@ resolved against the actual filesystem contents. - Mapping of group titles to lists of absolute or relative Path objects. + Mapping of navigation group titles to lists of resolved +documentation file paths. @@ -1338,7 +1302,7 @@ resolved against the actual filesystem contents. - The relative path to the project home page. + Relative path to the home page within the documentation root. @@ -1352,7 +1316,7 @@ resolved against the actual filesystem contents. - A mapping of group names to their resolved filesystem paths. + Mapping of group titles to resolved documentation file paths. @@ -1366,7 +1330,7 @@ resolved against the actual filesystem contents. - The root documentation directory. + Root directory of the documentation source files. @@ -1387,22 +1351,22 @@ resolved against the actual filesystem contents. - +Functions - - all_files + + all_files - -all_files() -> Iterable[Path] - + +1all_files() -> Iterable[Path] + - Get an iterable of all resolved files in the navigation structure. + Iterate over all files referenced by the navigation structure. Returns: @@ -1420,7 +1384,31 @@ resolved against the actual filesystem contents. - An iterable of Path objects. + An iterable of Path objects representing documentation files. + + + + + + + +Raises: + + + + Type + Description + + + + + + RuntimeError + + + + If the home page is defined but the documentation +root is not available for resolution. @@ -1438,23 +1426,24 @@ resolved against the actual filesystem contents. - +Functions - - resolve_nav + + resolve_nav - -resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav - + +1resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav + - Create a ResolvedNav by processing a NavSpec against the filesystem. -This expands globs and validates the existence of referenced files. + Resolve a navigation specification against the filesystem. +The function expands glob patterns defined in a NavSpec and verifies +that referenced documentation files exist within the documentation root. Parameters: @@ -1475,7 +1464,7 @@ This expands globs and validates the existence of referenced files. - The navigation specification to resolve. + Navigation specification describing documentation layout. @@ -1489,7 +1478,7 @@ This expands globs and validates the existence of referenced files. - The root directory for documentation files. + Root directory containing documentation Markdown files. @@ -1515,7 +1504,7 @@ This expands globs and validates the existence of referenced files. - A ResolvedNav instance. + A ResolvedNav instance containing validated navigation paths. @@ -1538,7 +1527,8 @@ This expands globs and validates the existence of referenced files. - If a pattern doesn't match any files or the docs_root doesn't exist. + If the documentation root does not exist or a +navigation pattern does not match any files. @@ -1573,6 +1563,8 @@ This expands globs and validates the existence of referenced files. + + @@ -1610,7 +1602,7 @@ This expands globs and validates the existence of referenced files. - + diff --git a/libs/doc-forge/site/nav/spec/index.html b/libs/doc-forge/site/nav/spec/index.html index 76aa0db..de70b48 100644 --- a/libs/doc-forge/site/nav/spec/index.html +++ b/libs/doc-forge/site/nav/spec/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -610,6 +483,18 @@ + + + + + + + + + + + + @@ -617,7 +502,6 @@ - @@ -627,8 +511,9 @@ - - + + + @@ -637,8 +522,14 @@ - - + + + + + + + + @@ -648,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -737,6 +607,16 @@ + + + Classes + + + + + + + NavSpec @@ -747,6 +627,16 @@ + + + Functions + + + + + + + all_patterns @@ -769,6 +659,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -781,6 +691,11 @@ + + + + + @@ -853,13 +768,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -868,8 +797,9 @@ - - + + + @@ -878,8 +808,14 @@ - - + + + + + + + + @@ -889,27 +825,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -995,13 +910,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1010,8 +941,9 @@ - - + + + @@ -1020,8 +952,14 @@ - - + + + + + + + + @@ -1031,27 +969,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1189,6 +1106,16 @@ + + + Classes + + + + + + + NavSpec @@ -1199,6 +1126,16 @@ + + + Functions + + + + + + + all_patterns @@ -1221,6 +1158,26 @@ + + + + + + + + + + + + + + Functions + + + + + + @@ -1233,6 +1190,11 @@ + + + + + @@ -1259,16 +1221,17 @@ - docforge.nav.spec + docforge.nav.spec - This module defines the NavSpec class, which represents the user's intent for -documentation navigation as defined in a YAML specification (usually -docforge.nav.yml). + Navigation specification model. +This module defines the NavSpec class, which represents the navigation +structure defined by the user in the doc-forge navigation specification +(typically docforge.nav.yml). @@ -1279,24 +1242,26 @@ docforge.nav.yml). - +Classes - - NavSpec + + NavSpec - -NavSpec(home: Optional[str], groups: Dict[str, List[str]]) - + +1NavSpec(home: Optional[str], groups: Dict[str, List[str]]) + - Parsed representation of the docforge navigation specification file. + Parsed representation of a navigation specification. +A NavSpec describes the intended documentation navigation layout before +it is resolved against the filesystem. Attributes: @@ -1316,7 +1281,8 @@ docforge.nav.yml). - Path to the home document (e.g., 'index.md'). + Relative path to the documentation home page (for example +index.md). @@ -1327,14 +1293,15 @@ docforge.nav.yml). - Mapping of group titles to lists of path patterns/globs. + Mapping of navigation group titles to lists of file patterns +or glob expressions. - Initialize a NavSpec. + Initialize a NavSpec instance. Parameters: @@ -1355,7 +1322,7 @@ docforge.nav.yml). - The path to the home document. + Relative path to the home document. @@ -1369,7 +1336,8 @@ docforge.nav.yml). - A mapping of group names to lists of path patterns (globs). + Mapping of group names to lists of path patterns +(glob expressions). @@ -1390,22 +1358,22 @@ docforge.nav.yml). - +Functions - - all_patterns + + all_patterns - -all_patterns() -> List[str] - + +1all_patterns() -> List[str] + - Get all path patterns referenced in the specification. + Return all path patterns referenced by the specification. Returns: @@ -1423,7 +1391,17 @@ docforge.nav.yml). - A list of all patterns (home plus all groups). + A list containing the home document (if defined) and all + + + + + + List[str] + + + + group pattern entries. @@ -1437,21 +1415,21 @@ docforge.nav.yml). - - load + + load classmethod - -load(path: Path) -> NavSpec - + +1load(path: Path) -> NavSpec + - Load a NavSpec from a YAML file. + Load a navigation specification from a YAML file. Parameters: @@ -1472,7 +1450,7 @@ docforge.nav.yml). - The filesystem path to the YAML file. + Filesystem path to the navigation specification file. @@ -1498,7 +1476,7 @@ docforge.nav.yml). - A NavSpec instance. + A NavSpec instance representing the parsed configuration. @@ -1521,7 +1499,7 @@ docforge.nav.yml). - If the path does not exist. + If the specified file does not exist. @@ -1531,7 +1509,8 @@ docforge.nav.yml). - If the file content is not a valid NavSpec mapping. + If the file contents are not a valid navigation +specification. @@ -1549,22 +1528,24 @@ docforge.nav.yml). - +Functions - - load_nav_spec + + load_nav_spec - -load_nav_spec(path: Path) -> NavSpec - + +1load_nav_spec(path: Path) -> NavSpec + - Utility function to load a NavSpec from a file. + Load a navigation specification file. +This helper function reads a YAML navigation file and constructs a +corresponding NavSpec instance. Parameters: @@ -1611,7 +1592,40 @@ docforge.nav.yml). - A loaded NavSpec instance. + A NavSpec instance representing the parsed specification. + + + + + + + +Raises: + + + + Type + Description + + + + + + FileNotFoundError + + + + If the specification file does not exist. + + + + + + ValueError + + + + If the YAML structure is invalid. @@ -1646,6 +1660,8 @@ docforge.nav.yml). + + @@ -1683,7 +1699,7 @@ docforge.nav.yml). - + diff --git a/libs/doc-forge/site/objects.inv b/libs/doc-forge/site/objects.inv index 1d5709b..b5d05fb 100644 Binary files a/libs/doc-forge/site/objects.inv and b/libs/doc-forge/site/objects.inv differ diff --git a/libs/doc-forge/site/renderers/base/index.html b/libs/doc-forge/site/renderers/base/index.html index f6529a9..5edcf98 100644 --- a/libs/doc-forge/site/renderers/base/index.html +++ b/libs/doc-forge/site/renderers/base/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -752,6 +625,18 @@ + + + + + + + + + + + + @@ -759,7 +644,6 @@ - @@ -769,8 +653,9 @@ - - + + + @@ -779,8 +664,14 @@ - - + + + + + + + + @@ -790,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -879,6 +749,16 @@ + + + Classes + + + + + + + DocRenderer @@ -889,6 +769,16 @@ + + + Functions + + + + + + + generate_sources @@ -900,6 +790,11 @@ + + + + + @@ -909,6 +804,26 @@ + + + + + + + Functions + + + + + + + + + + + + + @@ -986,13 +901,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1001,8 +932,9 @@ - - + + + @@ -1011,8 +943,14 @@ - - + + + + + + + + @@ -1022,27 +960,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1180,6 +1097,16 @@ + + + Classes + + + + + + + DocRenderer @@ -1190,6 +1117,16 @@ + + + Functions + + + + + + + generate_sources @@ -1201,6 +1138,11 @@ + + + + + @@ -1210,6 +1152,26 @@ + + + + + + + Functions + + + + + + + + + + + + + @@ -1241,16 +1203,17 @@ - docforge.renderers.base + docforge.renderers.base - This module defines the base interfaces and configuration containers for -doc-forge renderers. All renderer implementations should adhere to the -DocRenderer protocol. + Renderer base interfaces and configuration models. +This module defines the base protocol and configuration container used by +doc-forge renderers. Concrete renderer implementations should implement the +DocRenderer protocol. @@ -1261,17 +1224,17 @@ DocRenderer protocol. - +Classes - - DocRenderer + + DocRenderer - + @@ -1280,6 +1243,8 @@ DocRenderer protocol. Protocol defining the interface for documentation renderers. +Implementations of this protocol are responsible for transforming a +Project model into renderer-specific documentation sources. @@ -1292,22 +1257,22 @@ DocRenderer protocol. - +Functions - - generate_sources + + generate_sources - -generate_sources(project: Project, out_dir: Path) -> None - + +1generate_sources(project: Project, out_dir: Path) -> None + - Generate renderer-specific source files for the given project. + Generate renderer-specific documentation sources. Parameters: @@ -1328,7 +1293,7 @@ DocRenderer protocol. - The project models containing modules and objects. + Project model containing modules and documentation objects. @@ -1342,7 +1307,8 @@ DocRenderer protocol. - Target directory for the generated files. + Directory where generated documentation sources +should be written. @@ -1368,18 +1334,58 @@ DocRenderer protocol. - - RendererConfig + + RendererConfig - -RendererConfig(out_dir: Path, project: Project) - + +1RendererConfig(out_dir: Path, project: Project) + Configuration container for documentation renderers. +A RendererConfig instance groups together the project model and the +output directory used during rendering. + + +Attributes: + + + + Name + Type + Description + + + + + out_dir + + Path + + + + Directory where generated documentation files will be written. + + + + + project + + Project + + + + Documentation project model to be rendered. + + + + + + + Initialize a RendererConfig instance. Parameters: @@ -1400,7 +1406,7 @@ DocRenderer protocol. - The directory where documentation files should be written. + Target directory where documentation files should be written. @@ -1414,7 +1420,7 @@ DocRenderer protocol. - The introspected project models to be rendered. + Introspected project model to render. @@ -1435,7 +1441,7 @@ DocRenderer protocol. - +Functions @@ -1470,6 +1476,8 @@ DocRenderer protocol. + + @@ -1507,7 +1515,7 @@ DocRenderer protocol. - + diff --git a/libs/doc-forge/site/renderers/index.html b/libs/doc-forge/site/renderers/index.html index 85596af..9ef4897 100644 --- a/libs/doc-forge/site/renderers/index.html +++ b/libs/doc-forge/site/renderers/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -752,6 +625,18 @@ + + + + + + + + + + + + @@ -759,7 +644,6 @@ - @@ -769,8 +653,9 @@ - - + + + @@ -779,8 +664,14 @@ - - + + + + + + + + @@ -790,165 +681,6 @@ - - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - Table of contents - - - - - - - renderers - - - - - - - - - - Renderers Layer - - - - - - - - - - Current Implementations - - - - - - - - - Extending - - - - - - - - - - - - - - MCPRenderer - - - - - - - - - - generate_sources - - - - - - - - - - - - - - MkDocsRenderer - - - - - - - - - - generate_sources - - - - - - - - - - - - - - - - - - - - - - - @@ -1034,13 +766,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -1049,8 +797,9 @@ - - + + + @@ -1059,8 +808,14 @@ - - + + + + + + + + @@ -1070,27 +825,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1228,19 +962,9 @@ - + - Renderers Layer - - - - - - - - - - Current Implementations + Overview @@ -1255,10 +979,15 @@ - - + + + + Classes + + - + + @@ -1271,6 +1000,16 @@ + + + Functions + + + + + + + generate_sources @@ -1282,6 +1021,11 @@ + + + + + @@ -1294,6 +1038,25 @@ + + + + Functions + + + + + + + + + + generate_readme + + + + + @@ -1311,6 +1074,16 @@ + + + + + + + + + + @@ -1337,26 +1110,33 @@ - docforge.renderers + docforge.renderers - Renderers Layer -The docforge.renderers package handles the transformation of the internal -documentation models into physical files formatted for specific documentation -engines. -Current Implementations + Renderers layer for doc-forge. +The docforge.renderers package transforms the internal documentation +models into files formatted for specific documentation systems. + +Overview +Renderers consume the doc-forge project model and generate output suitable +for documentation tools or machine interfaces. +Current implementations: -MkDocsRenderer: Generates Markdown files utilizing the mkdocstrings - syntax. It automatically handles package/module hierarchy and generates - index.md files for packages. +MkDocsRenderer – Produces Markdown files compatible with MkDocs and + the mkdocstrings plugin. It automatically handles package hierarchy + and generates index.md files for packages. +MCPRenderer – Emits structured JSON resources designed for consumption + by Model Context Protocol (MCP) clients. + Extending -To add a new renderer, implement the DocRenderer protocol defined in -docforge.renderers.base. +New renderers can be added by implementing the DocRenderer protocol +defined in docforge.renderers.base. + @@ -1367,23 +1147,26 @@ engines. - +Classes - - MCPRenderer + + MCPRenderer - + - Renderer that emits MCP-native JSON resources from docforge models. + Renderer that generates MCP-compatible documentation resources. +This renderer converts doc-forge project models into structured JSON +resources suitable for consumption by systems implementing the Model +Context Protocol (MCP). @@ -1396,22 +1179,24 @@ engines. - +Functions - - generate_sources + + generate_sources - -generate_sources(project: Project, out_dir: Path) -> None - + +1generate_sources(project: Project, out_dir: Path) -> None + - Generate MCP-compatible JSON resources and navigation for the project. + Generate MCP documentation resources for a project. +The renderer serializes each module into a JSON resource and produces +supporting metadata files such as nav.json and index.json. Parameters: @@ -1432,7 +1217,7 @@ engines. - The project model to render. + Documentation project model to render. @@ -1446,7 +1231,7 @@ engines. - Target directory for the generated JSON files. + Directory where MCP resources will be written. @@ -1472,18 +1257,19 @@ engines. - - MkDocsRenderer + + MkDocsRenderer - + - Renderer that generates Markdown source files formatted for the MkDocs -'mkdocstrings' plugin. + Renderer that produces Markdown documentation for MkDocs. +Generated pages use mkdocstrings directives to reference Python modules, +allowing MkDocs to render API documentation dynamically. @@ -1496,23 +1282,28 @@ engines. - +Functions - - generate_sources + + generate_readme - -generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None - + +1generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None + - Produce a set of Markdown files in the output directory based on the -provided Project models. + Generate a README.md file from the root module docstring. +Behavior: + +If module_is_source is True, README.md is written to the + project root directory. +If False, README generation is currently not implemented. + Parameters: @@ -1533,7 +1324,7 @@ provided Project models. - The project models to render. + Project model containing documentation metadata. @@ -1541,13 +1332,13 @@ provided Project models. - out_dir + docs_dir Path - Target directory for documentation files. + Directory containing generated documentation sources. @@ -1561,7 +1352,88 @@ provided Project models. - Module is the source folder and to be treated as the root folder. + Whether the module is treated as the project +source root. + + + + None + + + + + + + + + + + + + + generate_sources + + + +1generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None + + + + + Generate Markdown documentation files for a project. +This method renders a documentation structure from the provided +project model and writes the resulting Markdown files to the +specified output directory. + + +Parameters: + + + + Name + Type + Description + Default + + + + + project + + Project + + + + Project model containing modules to document. + + + + required + + + + out_dir + + Path + + + + Directory where generated Markdown files will be written. + + + + required + + + + module_is_source + + bool | None + + + + If True, treat the specified module as the +documentation root rather than nesting it inside a folder. @@ -1608,6 +1480,8 @@ provided Project models. + + @@ -1645,7 +1519,7 @@ provided Project models. - + diff --git a/libs/doc-forge/site/renderers/mcp_renderer/index.html b/libs/doc-forge/site/renderers/mcp_renderer/index.html index 0fe22e1..dd2ad5f 100644 --- a/libs/doc-forge/site/renderers/mcp_renderer/index.html +++ b/libs/doc-forge/site/renderers/mcp_renderer/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -752,6 +625,18 @@ + + + + + + + + + + + + @@ -759,7 +644,6 @@ - @@ -769,8 +653,9 @@ - - + + + @@ -779,8 +664,14 @@ - - + + + + + + + + @@ -790,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -925,6 +795,16 @@ + + + Classes + + + + + + + MCPRenderer @@ -935,6 +815,16 @@ + + + Functions + + + + + + + generate_sources @@ -951,6 +841,16 @@ + + + + + + + + + + @@ -977,13 +877,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -992,8 +908,9 @@ - - + + + @@ -1002,8 +919,14 @@ - - + + + + + + + + @@ -1013,27 +936,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1171,6 +1073,16 @@ + + + Classes + + + + + + + MCPRenderer @@ -1181,6 +1093,16 @@ + + + Functions + + + + + + + generate_sources @@ -1197,6 +1119,16 @@ + + + + + + + + + + @@ -1223,7 +1155,7 @@ - docforge.renderers.mcp_renderer + docforge.renderers.mcp_renderer @@ -1239,23 +1171,26 @@ - +Classes - - MCPRenderer + + MCPRenderer - + - Renderer that emits MCP-native JSON resources from docforge models. + Renderer that generates MCP-compatible documentation resources. +This renderer converts doc-forge project models into structured JSON +resources suitable for consumption by systems implementing the Model +Context Protocol (MCP). @@ -1268,22 +1203,24 @@ - +Functions - - generate_sources + + generate_sources - -generate_sources(project: Project, out_dir: Path) -> None - + +1generate_sources(project: Project, out_dir: Path) -> None + - Generate MCP-compatible JSON resources and navigation for the project. + Generate MCP documentation resources for a project. +The renderer serializes each module into a JSON resource and produces +supporting metadata files such as nav.json and index.json. Parameters: @@ -1304,7 +1241,7 @@ - The project model to render. + Documentation project model to render. @@ -1318,7 +1255,7 @@ - Target directory for the generated JSON files. + Directory where MCP resources will be written. @@ -1365,6 +1302,8 @@ + + @@ -1402,7 +1341,7 @@ - + diff --git a/libs/doc-forge/site/renderers/mkdocs_renderer/index.html b/libs/doc-forge/site/renderers/mkdocs_renderer/index.html index 0170bb1..dd3dfe5 100644 --- a/libs/doc-forge/site/renderers/mkdocs_renderer/index.html +++ b/libs/doc-forge/site/renderers/mkdocs_renderer/index.html @@ -86,7 +86,9 @@ - + + + @@ -151,12 +153,19 @@ + + + + + + + @@ -182,136 +191,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -325,10 +204,8 @@ - - - + @@ -371,13 +248,23 @@ - - + + + + + - + + + + + + + + @@ -386,8 +273,9 @@ - - + + + @@ -396,8 +284,14 @@ - - + + + + + + + + @@ -407,27 +301,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -467,13 +340,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -482,8 +369,9 @@ - - + + + @@ -492,8 +380,14 @@ - - + + + + + + + + @@ -503,27 +397,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -609,13 +482,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -624,8 +511,9 @@ - - + + + @@ -634,8 +522,14 @@ - - + + + + + + + + @@ -645,27 +539,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -752,6 +625,18 @@ + + + + + + + + + + + + @@ -759,7 +644,6 @@ - @@ -769,8 +653,9 @@ - - + + + @@ -779,8 +664,14 @@ - - + + + + + + + + @@ -790,27 +681,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -902,6 +772,16 @@ + + + Classes + + + + + + + MkDocsRenderer @@ -911,6 +791,25 @@ + + + + Functions + + + + + + + + + + generate_readme + + + + + @@ -928,6 +827,16 @@ + + + + + + + + + + @@ -977,13 +886,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -992,8 +917,9 @@ - - + + + @@ -1002,8 +928,14 @@ - - + + + + + + + + @@ -1013,27 +945,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1171,6 +1082,16 @@ + + + Classes + + + + + + + MkDocsRenderer @@ -1180,6 +1101,25 @@ + + + + Functions + + + + + + + + + + generate_readme + + + + + @@ -1197,6 +1137,16 @@ + + + + + + + + + + @@ -1223,20 +1173,23 @@ - docforge.renderers.mkdocs_renderer + docforge.renderers.mkdocs_renderer - MkDocsRenderer -Generates Markdown source files compatible with MkDocs Material -and mkdocstrings, ensuring: + MkDocs renderer implementation. +This module defines the MkDocsRenderer class, which generates Markdown +documentation sources compatible with MkDocs Material and the mkdocstrings +plugin. +The renderer ensures a consistent documentation structure by: -Root index.md always exists -Parent package indexes are created automatically -Child modules are linked in parent index files +Creating a root index.md if one does not exist +Generating package index pages automatically +Linking child modules within parent package pages +Optionally generating README.md from the root package docstring @@ -1248,24 +1201,25 @@ and mkdocstrings, ensuring: - +Classes - - MkDocsRenderer + + MkDocsRenderer - + - Renderer that generates Markdown source files formatted for the MkDocs -'mkdocstrings' plugin. + Renderer that produces Markdown documentation for MkDocs. +Generated pages use mkdocstrings directives to reference Python modules, +allowing MkDocs to render API documentation dynamically. @@ -1278,23 +1232,28 @@ and mkdocstrings, ensuring: - +Functions - - generate_sources + + generate_readme - -generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None - + +1generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None + - Produce a set of Markdown files in the output directory based on the -provided Project models. + Generate a README.md file from the root module docstring. +Behavior: + +If module_is_source is True, README.md is written to the + project root directory. +If False, README generation is currently not implemented. + Parameters: @@ -1315,7 +1274,7 @@ provided Project models. - The project models to render. + Project model containing documentation metadata. @@ -1323,13 +1282,13 @@ provided Project models. - out_dir + docs_dir Path - Target directory for documentation files. + Directory containing generated documentation sources. @@ -1343,7 +1302,88 @@ provided Project models. - Module is the source folder and to be treated as the root folder. + Whether the module is treated as the project +source root. + + + + None + + + + + + + + + + + + + + generate_sources + + + +1generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None + + + + + Generate Markdown documentation files for a project. +This method renders a documentation structure from the provided +project model and writes the resulting Markdown files to the +specified output directory. + + +Parameters: + + + + Name + Type + Description + Default + + + + + project + + Project + + + + Project model containing modules to document. + + + + required + + + + out_dir + + Path + + + + Directory where generated Markdown files will be written. + + + + required + + + + module_is_source + + bool | None + + + + If True, treat the specified module as the +documentation root rather than nesting it inside a folder. @@ -1390,6 +1430,8 @@ provided Project models. + + @@ -1427,7 +1469,7 @@ provided Project models. - + diff --git a/libs/doc-forge/site/search/search_index.json b/libs/doc-forge/site/search/search_index.json index 547001c..d53ff9a 100644 --- a/libs/doc-forge/site/search/search_index.json +++ b/libs/doc-forge/site/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"docforge","text":""},{"location":"#docforge","title":"docforge","text":""},{"location":"#docforge--doc-forge","title":"doc-forge","text":"doc-forge is a renderer-agnostic Python documentation compiler designed for speed, flexibility, and beautiful output. It decouples the introspection of your code from the rendering process, allowing you to generate documentation for various platforms (starting with MkDocs) from a single internal models."},{"location":"#docforge--core-philosophy","title":"Core Philosophy","text":"doc-forge operates on two fundamental principles: The Atomic Unit is a Python Import Path: Documentation is organized around the semantic structure of your code (e.g., mypackage.utils), not the filesystem. The Documentation Compiler Paradigm: We separate documentation into three distinct phases: Front-end (Introspection): Static analysis of source code and docstrings. Middle-end (Semantic Model): A renderer-neutral internal representation. Back-end (Renderers): Generation of human-facing (MkDocs) or machine-facing (MCP) outputs. "},{"location":"#docforge--documentation-design","title":"Documentation Design","text":"doc-forge is an \"AI-Native\" documentation compiler. To get the most out of it, design your docstrings with both humans and LLMs in mind:"},{"location":"#docforge--for-humans-readability-structure","title":"For Humans (Readability & Structure)","text":" __init__.py as Landing Pages: Use the docstring of your package's __init__.py as the home page. Include overviews, installation instructions, and high-level examples here. Single Source of Truth: Keep all technical details in docstrings. This ensures your MkDocs/Sphinx sites stay in sync with the code. Semantic Hierarchy: Use standard Markdown headers to structure complex module documentation. "},{"location":"#docforge--for-llms-ai-native-knowledge","title":"For LLMs (AI-Native Knowledge)","text":" Model Context Protocol (MCP): doc-forge exports your docs as structured JSON. This allows AI agents to \"understand\" your API surface area without layout noise. Canonical Paths: Use dotted import paths as primary identifiers. AI tools use these to link code usage to documentation. Type Annotations: While not in docstrings, doc-forge (via Griffe) extracts signatures. Clean type hints dramatically improve an LLM's ability to generate correct code using your library. "},{"location":"#docforge--available-commands","title":"Available Commands","text":" build: Build documentation (MkDocs site or MCP resources). serve: Serve documentation (MkDocs or MCP). tree: Visualize the introspected project structure. "},{"location":"#docforge--installation","title":"Installation","text":"Install using pip with the optional mkdocs dependencies for a complete setup: pip install doc-forge\n"},{"location":"#docforge--quick-start","title":"Quick Start","text":" Build Documentation: Introspect your package and generate documentation in one step: ```bash # Build MkDocs site doc-forge build --mkdocs --module my_package --site-name \"My Docs\" Define Navigation: Create a docforge.nav.yml to organize your documentation: yaml home: my_package/index.md groups: Core API: - my_package/core/*.md Utilities: - my_package/utils.md Preview: ```bash # Serve MkDocs site doc-forge serve --mkdocs "},{"location":"#docforge--build-mcp-resources","title":"Build MCP resources","text":"doc-forge build --mcp --module my_package ```"},{"location":"#docforge--serve-mcp-documentation","title":"Serve MCP documentation","text":"doc-forge serve --mcp ```"},{"location":"#docforge--project-structure","title":"Project Structure","text":" docforge.loaders: Introspects source code using static analysis (griffe). docforge.models: The internal representation of your project, modules, and objects. docforge.renderers: Converters that turn the models into physical files. docforge.nav: Managers for logical-to-physical path mapping and navigation. "},{"location":"#docforge.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Loads Python modules and extracts documentation using the Griffe introspection engine. Initialize the GriffeLoader."},{"location":"#docforge.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load a single module and convert its introspection data into the docforge models. Parameters: Name Type Description Default path str The dotted path of the module to load. required Returns: Type Description Module A Module instance."},{"location":"#docforge.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and combine them into a single Project models. Parameters: Name Type Description Default module_paths List[str] A list of dotted paths to the modules to load. required project_name Optional[str] Optional name for the project. Defaults to the first module name. None skip_import_errors bool If True, modules that fail to import will be skipped. None Returns: Type Description Project A Project instance containing the loaded modules."},{"location":"#docforge.MCPRenderer","title":"MCPRenderer","text":"Renderer that emits MCP-native JSON resources from docforge models."},{"location":"#docforge.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP-compatible JSON resources and navigation for the project. Parameters: Name Type Description Default project Project The project model to render. required out_dir Path Target directory for the generated JSON files. required"},{"location":"#docforge.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that generates Markdown source files formatted for the MkDocs 'mkdocstrings' plugin."},{"location":"#docforge.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Produce a set of Markdown files in the output directory based on the provided Project models. Parameters: Name Type Description Default project Project The project models to render. required out_dir Path Target directory for documentation files. required module_is_source bool | None Module is the source folder and to be treated as the root folder. None"},{"location":"#docforge.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover all Python modules under a package via filesystem traversal. Rules: - Directory with init.py is treated as a package. - Any .py file is treated as a module. - All paths are converted to dotted module paths. Parameters: Name Type Description Default module_name str The name of the package to discover. required project_root Path | None The root directory of the project. Defaults to current working directory. None Returns: Type Description List[str] A sorted list of dotted module paths."},{"location":"cli/","title":"Cli","text":""},{"location":"cli/#docforge.cli","title":"docforge.cli","text":""},{"location":"cli/#docforge.cli--cli-layer","title":"CLI Layer","text":"The docforge.cli package provides the command-line interface for interacting with doc-forge."},{"location":"cli/#docforge.cli--available-commands","title":"Available Commands","text":" build: Build documentation (MkDocs site or MCP resources). serve: Serve documentation (MkDocs or MCP). tree: Visualize the introspected project structure. "},{"location":"cli/commands/","title":"Commands","text":""},{"location":"cli/commands/#docforge.cli.commands","title":"docforge.cli.commands","text":""},{"location":"cli/commands/#docforge.cli.commands.build","title":"build","text":"build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None\n Build documentation (MkDocs site or MCP resources). This command orchestrates the full build process: 1. Introspects the code (Griffe) 2. Renders sources (MkDocs Markdown or MCP JSON) 3. (MkDocs only) Generates config and runs the final site build. Parameters: Name Type Description Default mcp bool Use the MCP documentation builder. required mkdocs bool Use the MkDocs documentation builder. required module_is_source bool Module is the source folder and to be treated as the root folder. required module Optional[str] The dotted path of the module to the document. required project_name Optional[str] Optional override for the project name. required site_name Optional[str] (MkDocs) The site display name. Defaults to module name. required docs_dir Path (MkDocs) Target directory for Markdown sources. required nav_file Path (MkDocs) Path to the docforge.nav.yml specification. required template Optional[Path] (MkDocs) Optional custom mkdocs.yml template. required mkdocs_yml Path (MkDocs) Target path for the generated mkdocs.yml. required out_dir Path (MCP) Target directory for MCP JSON resources. required"},{"location":"cli/commands/#docforge.cli.commands.serve","title":"serve","text":"serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None\n Serve documentation (MkDocs or MCP). Parameters: Name Type Description Default mcp bool Serve MCP resources via an MCP server. required mkdocs bool Serve the MkDocs site using the built-in development server. required module Optional[str] The dotted path of the module to serve. required mkdocs_yml Path (MkDocs) Path to the mkdocs.yml configuration. required out_dir Path (MCP) Path to the mcp_docs/ directory. required"},{"location":"cli/commands/#docforge.cli.commands.tree","title":"tree","text":"tree(module: str, project_name: Optional[str]) -> None\n Visualize the project structure in the terminal. Parameters: Name Type Description Default module str The module import path to recursively introspect. required project_name Optional[str] Optional override for the project name shown at the root. required"},{"location":"cli/main/","title":"Main","text":""},{"location":"cli/main/#docforge.cli.main","title":"docforge.cli.main","text":"Main entry point for the doc-forge CLI. This module delegates all command execution to docforge.cli.commands."},{"location":"cli/main/#docforge.cli.main.main","title":"main","text":"main() -> None\n CLI Entry point. Boots the click application."},{"location":"cli/mcp_utils/","title":"Mcp Utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils","title":"docforge.cli.mcp_utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.generate_resources","title":"generate_resources","text":"generate_resources(module: str, project_name: str | None, out_dir: Path) -> None\n Generate MCP-compatible documentation resources. Parameters: Name Type Description Default module str The dotted path of the primary module to document. required project_name str | None Optional override for the project name. required out_dir Path Directory where the MCP JSON resources and nav will be written. required"},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.serve","title":"serve","text":"serve(module: str, mcp_root: Path) -> None\n Serve MCP documentation from a pre-built bundle. Parameters: Name Type Description Default module str The dotted path of the primary module to serve. required mcp_root Path Path to the directory containing index.json, nav.json, and modules/. required"},{"location":"cli/mkdocs_utils/","title":"Mkdocs Utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils","title":"docforge.cli.mkdocs_utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.build","title":"build","text":"build(mkdocs_yml: Path) -> None\n Build the documentation site using MkDocs. Parameters: Name Type Description Default mkdocs_yml Path Path to the mkdocs.yml configuration file. required"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_config","title":"generate_config","text":"generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None\n Generate an mkdocs.yml configuration file. Parameters: Name Type Description Default docs_dir Path Path to the directory containing documentation Markdown files. required nav_file Path Path to the docforge.nav.yml specification. required template Path | None Optional path to an mkdocs.yml template (overrides built-in). required out Path Path where the final mkdocs.yml will be written. required site_name str The display name for the documentation site. required"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_sources","title":"generate_sources","text":"generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None\n Generate Markdown source files for the specified module. Parameters: Name Type Description Default module str The dotted path of the primary module to document. required project_name str | None Optional override for the project name. None docs_dir Path Directory where the generated Markdown files will be written. required module_is_source bool | None Module is the source folder and to be treated as the root folder. None"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.serve","title":"serve","text":"serve(mkdocs_yml: Path) -> None\n Serve the documentation site with live-reload using MkDocs. Parameters: Name Type Description Default mkdocs_yml Path Path to the mkdocs.yml configuration file. required"},{"location":"loaders/","title":"Loaders","text":""},{"location":"loaders/#docforge.loaders","title":"docforge.loaders","text":""},{"location":"loaders/#docforge.loaders--loader-layer","title":"Loader Layer","text":"The docforge.loaders package is responsible for discovering Python source files and extracting their documentation using static analysis."},{"location":"loaders/#docforge.loaders--core-features","title":"Core Features","text":" Discovery: Automatically find all modules and packages in a project directory. Introspection: Uses griffe to parse docstrings, signatures, and hierarchical relationships without executing the code. Filtering: Automatically excludes private members (prefixed with _) to ensure clean public documentation. "},{"location":"loaders/#docforge.loaders.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Loads Python modules and extracts documentation using the Griffe introspection engine. Initialize the GriffeLoader."},{"location":"loaders/#docforge.loaders.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load a single module and convert its introspection data into the docforge models. Parameters: Name Type Description Default path str The dotted path of the module to load. required Returns: Type Description Module A Module instance."},{"location":"loaders/#docforge.loaders.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and combine them into a single Project models. Parameters: Name Type Description Default module_paths List[str] A list of dotted paths to the modules to load. required project_name Optional[str] Optional name for the project. Defaults to the first module name. None skip_import_errors bool If True, modules that fail to import will be skipped. None Returns: Type Description Project A Project instance containing the loaded modules."},{"location":"loaders/#docforge.loaders.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover all Python modules under a package via filesystem traversal. Rules: - Directory with init.py is treated as a package. - Any .py file is treated as a module. - All paths are converted to dotted module paths. Parameters: Name Type Description Default module_name str The name of the package to discover. required project_root Path | None The root directory of the project. Defaults to current working directory. None Returns: Type Description List[str] A sorted list of dotted module paths."},{"location":"loaders/griffe_loader/","title":"Griffe Loader","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader","title":"docforge.loaders.griffe_loader","text":"This module provides the GriffeLoader, which uses the 'griffe' library to introspect Python source code and populate the doc-forge Project models."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Loads Python modules and extracts documentation using the Griffe introspection engine. Initialize the GriffeLoader."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load a single module and convert its introspection data into the docforge models. Parameters: Name Type Description Default path str The dotted path of the module to load. required Returns: Type Description Module A Module instance."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and combine them into a single Project models. Parameters: Name Type Description Default module_paths List[str] A list of dotted paths to the modules to load. required project_name Optional[str] Optional name for the project. Defaults to the first module name. None skip_import_errors bool If True, modules that fail to import will be skipped. None Returns: Type Description Project A Project instance containing the loaded modules."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover all Python modules under a package via filesystem traversal. Rules: - Directory with init.py is treated as a package. - Any .py file is treated as a module. - All paths are converted to dotted module paths. Parameters: Name Type Description Default module_name str The name of the package to discover. required project_root Path | None The root directory of the project. Defaults to current working directory. None Returns: Type Description List[str] A sorted list of dotted module paths."},{"location":"models/","title":"Models","text":""},{"location":"models/#docforge.models","title":"docforge.models","text":""},{"location":"models/#docforge.models--model-layer","title":"Model Layer","text":"The docforge.models package provides the core data structures used to represent Python source code in a documentation-focused hierarchy."},{"location":"models/#docforge.models--key-components","title":"Key Components","text":" Project: The root container for all documented modules. Module: Represents a Python module or package, containing members. DocObject: A recursive structure for classes, functions, and attributes. These classes are designed to be renderer-agnostic, allowing the same internal representation to be transformed into various output formats (currently MkDocs)."},{"location":"models/#docforge.models.DocObject","title":"DocObject","text":"DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n Represents a documented Python object (class, function, method, etc.). Attributes: Name Type Description name str Local name of the object. kind str Type of object (e.g., 'class', 'function', 'attribute'). path str Full dotted import path to the object. signature Optional[str] Callable signature, if applicable. docstring Optional[str] Raw docstring content extracted from the source. members Dict[str, DocObject] Dictionary mapping member names to their DocObject representations. Initialize a new DocObject. Parameters: Name Type Description Default name str The local name of the object. required kind str The kind of object (e.g., 'class', 'function'). required path str The full dotted path to the object. required signature Optional[str] The object's signature (for callable objects). None docstring Optional[str] The object's docstring, if any. None"},{"location":"models/#docforge.models.DocObject.add_member","title":"add_member","text":"add_member(obj: DocObject) -> None\n Add a child member to this object (e.g., a method to a class). Parameters: Name Type Description Default obj DocObject The child DocObject to add. required"},{"location":"models/#docforge.models.DocObject.get_all_members","title":"get_all_members","text":"get_all_members() -> Iterable[DocObject]\n Get all members of this object. Returns: Type Description Iterable[DocObject] An iterable of child DocObject instances."},{"location":"models/#docforge.models.DocObject.get_member","title":"get_member","text":"get_member(name: str) -> DocObject\n Retrieve a child member by name. Parameters: Name Type Description Default name str The name of the member. required Returns: Type Description DocObject The requested DocObject."},{"location":"models/#docforge.models.Module","title":"Module","text":"Module(path: str, docstring: Optional[str] = None)\n Represents a documented Python module or package. Attributes: Name Type Description path str Dotted import path of the module. docstring Optional[str] Module-level docstring content. members Dict[str, DocObject] Dictionary mapping object names to their DocObject representations. Initialize a new Module. Parameters: Name Type Description Default path str The dotted path of the module. required docstring Optional[str] The module's docstring, if any. None"},{"location":"models/#docforge.models.Module.add_object","title":"add_object","text":"add_object(obj: DocObject) -> None\n Add a documented object to the module. Parameters: Name Type Description Default obj DocObject The object to add. required"},{"location":"models/#docforge.models.Module.get_all_objects","title":"get_all_objects","text":"get_all_objects() -> Iterable[DocObject]\n Get all top-level objects in the module. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances."},{"location":"models/#docforge.models.Module.get_object","title":"get_object","text":"get_object(name: str) -> DocObject\n Retrieve a member object by name. Parameters: Name Type Description Default name str The name of the object. required Returns: Type Description DocObject The requested DocObject."},{"location":"models/#docforge.models.Project","title":"Project","text":"Project(name: str)\n Represents a documentation project, serving as a container for modules. Attributes: Name Type Description name str Name of the project. modules Dict[str, Module] Dictionary mapping module paths to Module instances. Initialize a new Project. Parameters: Name Type Description Default name str The name of the project. required"},{"location":"models/#docforge.models.Project.add_module","title":"add_module","text":"add_module(module: Module) -> None\n Add a module to the project. Parameters: Name Type Description Default module Module The module to add. required"},{"location":"models/#docforge.models.Project.get_all_modules","title":"get_all_modules","text":"get_all_modules() -> Iterable[Module]\n Get all modules in the project. Returns: Type Description Iterable[Module] An iterable of Module objects."},{"location":"models/#docforge.models.Project.get_module","title":"get_module","text":"get_module(path: str) -> Module\n Retrieve a module by its dotted path. Parameters: Name Type Description Default path str The dotted path of the module (e.g., 'pkg.mod'). required Returns: Type Description Module The requested Module."},{"location":"models/#docforge.models.Project.get_module_list","title":"get_module_list","text":"get_module_list() -> list[str]\n Get the list of all module dotted paths. Returns: Type Description list[str] A list of module paths."},{"location":"models/module/","title":"Module","text":""},{"location":"models/module/#docforge.models.module","title":"docforge.models.module","text":"This module defines the Module class, which represents a Python module or package in the doc-forge documentation models. It acts as a container for top-level documented objects."},{"location":"models/module/#docforge.models.module.Module","title":"Module","text":"Module(path: str, docstring: Optional[str] = None)\n Represents a documented Python module or package. Attributes: Name Type Description path str Dotted import path of the module. docstring Optional[str] Module-level docstring content. members Dict[str, DocObject] Dictionary mapping object names to their DocObject representations. Initialize a new Module. Parameters: Name Type Description Default path str The dotted path of the module. required docstring Optional[str] The module's docstring, if any. None"},{"location":"models/module/#docforge.models.module.Module.add_object","title":"add_object","text":"add_object(obj: DocObject) -> None\n Add a documented object to the module. Parameters: Name Type Description Default obj DocObject The object to add. required"},{"location":"models/module/#docforge.models.module.Module.get_all_objects","title":"get_all_objects","text":"get_all_objects() -> Iterable[DocObject]\n Get all top-level objects in the module. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances."},{"location":"models/module/#docforge.models.module.Module.get_object","title":"get_object","text":"get_object(name: str) -> DocObject\n Retrieve a member object by name. Parameters: Name Type Description Default name str The name of the object. required Returns: Type Description DocObject The requested DocObject."},{"location":"models/object/","title":"Object","text":""},{"location":"models/object/#docforge.models.object","title":"docforge.models.object","text":"This module defines the DocObject class, the fundamental recursive unit of the doc-forge documentation models. A DocObject represents a single Python entity (class, function, method, or attribute) and its nested members."},{"location":"models/object/#docforge.models.object.DocObject","title":"DocObject","text":"DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n Represents a documented Python object (class, function, method, etc.). Attributes: Name Type Description name str Local name of the object. kind str Type of object (e.g., 'class', 'function', 'attribute'). path str Full dotted import path to the object. signature Optional[str] Callable signature, if applicable. docstring Optional[str] Raw docstring content extracted from the source. members Dict[str, DocObject] Dictionary mapping member names to their DocObject representations. Initialize a new DocObject. Parameters: Name Type Description Default name str The local name of the object. required kind str The kind of object (e.g., 'class', 'function'). required path str The full dotted path to the object. required signature Optional[str] The object's signature (for callable objects). None docstring Optional[str] The object's docstring, if any. None"},{"location":"models/object/#docforge.models.object.DocObject.add_member","title":"add_member","text":"add_member(obj: DocObject) -> None\n Add a child member to this object (e.g., a method to a class). Parameters: Name Type Description Default obj DocObject The child DocObject to add. required"},{"location":"models/object/#docforge.models.object.DocObject.get_all_members","title":"get_all_members","text":"get_all_members() -> Iterable[DocObject]\n Get all members of this object. Returns: Type Description Iterable[DocObject] An iterable of child DocObject instances."},{"location":"models/object/#docforge.models.object.DocObject.get_member","title":"get_member","text":"get_member(name: str) -> DocObject\n Retrieve a child member by name. Parameters: Name Type Description Default name str The name of the member. required Returns: Type Description DocObject The requested DocObject."},{"location":"models/project/","title":"Project","text":""},{"location":"models/project/#docforge.models.project","title":"docforge.models.project","text":"This module defines the Project class, the top-level container for a documented project. It aggregates multiple Module instances into a single named entity."},{"location":"models/project/#docforge.models.project.Project","title":"Project","text":"Project(name: str)\n Represents a documentation project, serving as a container for modules. Attributes: Name Type Description name str Name of the project. modules Dict[str, Module] Dictionary mapping module paths to Module instances. Initialize a new Project. Parameters: Name Type Description Default name str The name of the project. required"},{"location":"models/project/#docforge.models.project.Project.add_module","title":"add_module","text":"add_module(module: Module) -> None\n Add a module to the project. Parameters: Name Type Description Default module Module The module to add. required"},{"location":"models/project/#docforge.models.project.Project.get_all_modules","title":"get_all_modules","text":"get_all_modules() -> Iterable[Module]\n Get all modules in the project. Returns: Type Description Iterable[Module] An iterable of Module objects."},{"location":"models/project/#docforge.models.project.Project.get_module","title":"get_module","text":"get_module(path: str) -> Module\n Retrieve a module by its dotted path. Parameters: Name Type Description Default path str The dotted path of the module (e.g., 'pkg.mod'). required Returns: Type Description Module The requested Module."},{"location":"models/project/#docforge.models.project.Project.get_module_list","title":"get_module_list","text":"get_module_list() -> list[str]\n Get the list of all module dotted paths. Returns: Type Description list[str] A list of module paths."},{"location":"nav/","title":"Nav","text":""},{"location":"nav/#docforge.nav","title":"docforge.nav","text":""},{"location":"nav/#docforge.nav--navigation-layer","title":"Navigation Layer","text":"The docforge.nav package manages the mapping between the logical documentation structure and the physical files on disk."},{"location":"nav/#docforge.nav--workflow","title":"Workflow","text":" Spec Definition: Users define navigation intent in docforge.nav.yml. Resolution: resolve_nav matches patterns in the spec to generated .md files. Emission: MkDocsNavEmitter produces the final YAML structure for mkdocs.yml. This abstraction allows doc-forge to support complex grouping and ordering independently of the source code's physical layout."},{"location":"nav/#docforge.nav.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible navigation structure."},{"location":"nav/#docforge.nav.MkDocsNavEmitter.emit","title":"emit","text":"emit(nav: ResolvedNav) -> List[Dict[str, Any]]\n Generate a list of navigation entries for mkdocs.yml. Parameters: Name Type Description Default nav ResolvedNav The resolved navigation data. required Returns: Type Description List[Dict[str, Any]] A list of dictionary mappings representing the MkDocs navigation."},{"location":"nav/#docforge.nav.NavSpec","title":"NavSpec","text":"NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n Parsed representation of the docforge navigation specification file. Attributes: Name Type Description home Optional[str] Path to the home document (e.g., 'index.md'). groups Dict[str, List[str]] Mapping of group titles to lists of path patterns/globs. Initialize a NavSpec. Parameters: Name Type Description Default home Optional[str] The path to the home document. required groups Dict[str, List[str]] A mapping of group names to lists of path patterns (globs). required"},{"location":"nav/#docforge.nav.NavSpec.all_patterns","title":"all_patterns","text":"all_patterns() -> List[str]\n Get all path patterns referenced in the specification. Returns: Type Description List[str] A list of all patterns (home plus all groups)."},{"location":"nav/#docforge.nav.NavSpec.load","title":"load classmethod","text":"load(path: Path) -> NavSpec\n Load a NavSpec from a YAML file. Parameters: Name Type Description Default path Path The filesystem path to the YAML file. required Returns: Type Description NavSpec A NavSpec instance. Raises: Type Description FileNotFoundError If the path does not exist. ValueError If the file content is not a valid NavSpec mapping."},{"location":"nav/#docforge.nav.ResolvedNav","title":"ResolvedNav","text":"ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n Represents a navigation structure where all patterns and paths have been resolved against the actual filesystem contents. Attributes: Name Type Description home Optional[str] Resolved relative path to the home page. groups Dict[str, List[Path]] Mapping of group titles to lists of absolute or relative Path objects. Initialize a ResolvedNav instance. Parameters: Name Type Description Default home str | None The relative path to the project home page. required groups Dict[str, List[Path]] A mapping of group names to their resolved filesystem paths. required docs_root Path | None The root documentation directory. None"},{"location":"nav/#docforge.nav.ResolvedNav.all_files","title":"all_files","text":"all_files() -> Iterable[Path]\n Get an iterable of all resolved files in the navigation structure. Returns: Type Description Iterable[Path] An iterable of Path objects."},{"location":"nav/#docforge.nav.load_nav_spec","title":"load_nav_spec","text":"load_nav_spec(path: Path) -> NavSpec\n Utility function to load a NavSpec from a file. Parameters: Name Type Description Default path Path Path to the navigation specification file. required Returns: Type Description NavSpec A loaded NavSpec instance."},{"location":"nav/#docforge.nav.resolve_nav","title":"resolve_nav","text":"resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav\n Create a ResolvedNav by processing a NavSpec against the filesystem. This expands globs and validates the existence of referenced files. Parameters: Name Type Description Default spec NavSpec The navigation specification to resolve. required docs_root Path The root directory for documentation files. required Returns: Type Description ResolvedNav A ResolvedNav instance. Raises: Type Description FileNotFoundError If a pattern doesn't match any files or the docs_root doesn't exist."},{"location":"nav/mkdocs/","title":"Mkdocs","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs","title":"docforge.nav.mkdocs","text":"This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance into the specific YAML-ready list structure expected by the MkDocs 'nav' configuration."},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible navigation structure."},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter.emit","title":"emit","text":"emit(nav: ResolvedNav) -> List[Dict[str, Any]]\n Generate a list of navigation entries for mkdocs.yml. Parameters: Name Type Description Default nav ResolvedNav The resolved navigation data. required Returns: Type Description List[Dict[str, Any]] A list of dictionary mappings representing the MkDocs navigation."},{"location":"nav/resolver/","title":"Resolver","text":""},{"location":"nav/resolver/#docforge.nav.resolver","title":"docforge.nav.resolver","text":"This module contains the logic for resolving a NavSpec against the physical filesystem. It expands globs and validates that all referenced documents actually exist on disk."},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav","title":"ResolvedNav","text":"ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n Represents a navigation structure where all patterns and paths have been resolved against the actual filesystem contents. Attributes: Name Type Description home Optional[str] Resolved relative path to the home page. groups Dict[str, List[Path]] Mapping of group titles to lists of absolute or relative Path objects. Initialize a ResolvedNav instance. Parameters: Name Type Description Default home str | None The relative path to the project home page. required groups Dict[str, List[Path]] A mapping of group names to their resolved filesystem paths. required docs_root Path | None The root documentation directory. None"},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav.all_files","title":"all_files","text":"all_files() -> Iterable[Path]\n Get an iterable of all resolved files in the navigation structure. Returns: Type Description Iterable[Path] An iterable of Path objects."},{"location":"nav/resolver/#docforge.nav.resolver.resolve_nav","title":"resolve_nav","text":"resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav\n Create a ResolvedNav by processing a NavSpec against the filesystem. This expands globs and validates the existence of referenced files. Parameters: Name Type Description Default spec NavSpec The navigation specification to resolve. required docs_root Path The root directory for documentation files. required Returns: Type Description ResolvedNav A ResolvedNav instance. Raises: Type Description FileNotFoundError If a pattern doesn't match any files or the docs_root doesn't exist."},{"location":"nav/spec/","title":"Spec","text":""},{"location":"nav/spec/#docforge.nav.spec","title":"docforge.nav.spec","text":"This module defines the NavSpec class, which represents the user's intent for documentation navigation as defined in a YAML specification (usually docforge.nav.yml)."},{"location":"nav/spec/#docforge.nav.spec.NavSpec","title":"NavSpec","text":"NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n Parsed representation of the docforge navigation specification file. Attributes: Name Type Description home Optional[str] Path to the home document (e.g., 'index.md'). groups Dict[str, List[str]] Mapping of group titles to lists of path patterns/globs. Initialize a NavSpec. Parameters: Name Type Description Default home Optional[str] The path to the home document. required groups Dict[str, List[str]] A mapping of group names to lists of path patterns (globs). required"},{"location":"nav/spec/#docforge.nav.spec.NavSpec.all_patterns","title":"all_patterns","text":"all_patterns() -> List[str]\n Get all path patterns referenced in the specification. Returns: Type Description List[str] A list of all patterns (home plus all groups)."},{"location":"nav/spec/#docforge.nav.spec.NavSpec.load","title":"load classmethod","text":"load(path: Path) -> NavSpec\n Load a NavSpec from a YAML file. Parameters: Name Type Description Default path Path The filesystem path to the YAML file. required Returns: Type Description NavSpec A NavSpec instance. Raises: Type Description FileNotFoundError If the path does not exist. ValueError If the file content is not a valid NavSpec mapping."},{"location":"nav/spec/#docforge.nav.spec.load_nav_spec","title":"load_nav_spec","text":"load_nav_spec(path: Path) -> NavSpec\n Utility function to load a NavSpec from a file. Parameters: Name Type Description Default path Path Path to the navigation specification file. required Returns: Type Description NavSpec A loaded NavSpec instance."},{"location":"renderers/","title":"Renderers","text":""},{"location":"renderers/#docforge.renderers","title":"docforge.renderers","text":""},{"location":"renderers/#docforge.renderers--renderers-layer","title":"Renderers Layer","text":"The docforge.renderers package handles the transformation of the internal documentation models into physical files formatted for specific documentation engines."},{"location":"renderers/#docforge.renderers--current-implementations","title":"Current Implementations","text":" MkDocsRenderer: Generates Markdown files utilizing the mkdocstrings syntax. It automatically handles package/module hierarchy and generates index.md files for packages. "},{"location":"renderers/#docforge.renderers--extending","title":"Extending","text":"To add a new renderer, implement the DocRenderer protocol defined in docforge.renderers.base."},{"location":"renderers/#docforge.renderers.MCPRenderer","title":"MCPRenderer","text":"Renderer that emits MCP-native JSON resources from docforge models."},{"location":"renderers/#docforge.renderers.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP-compatible JSON resources and navigation for the project. Parameters: Name Type Description Default project Project The project model to render. required out_dir Path Target directory for the generated JSON files. required"},{"location":"renderers/#docforge.renderers.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that generates Markdown source files formatted for the MkDocs 'mkdocstrings' plugin."},{"location":"renderers/#docforge.renderers.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Produce a set of Markdown files in the output directory based on the provided Project models. Parameters: Name Type Description Default project Project The project models to render. required out_dir Path Target directory for documentation files. required module_is_source bool | None Module is the source folder and to be treated as the root folder. None"},{"location":"renderers/base/","title":"Base","text":""},{"location":"renderers/base/#docforge.renderers.base","title":"docforge.renderers.base","text":"This module defines the base interfaces and configuration containers for doc-forge renderers. All renderer implementations should adhere to the DocRenderer protocol."},{"location":"renderers/base/#docforge.renderers.base.DocRenderer","title":"DocRenderer","text":" Bases: Protocol Protocol defining the interface for documentation renderers."},{"location":"renderers/base/#docforge.renderers.base.DocRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate renderer-specific source files for the given project. Parameters: Name Type Description Default project Project The project models containing modules and objects. required out_dir Path Target directory for the generated files. required"},{"location":"renderers/base/#docforge.renderers.base.RendererConfig","title":"RendererConfig","text":"RendererConfig(out_dir: Path, project: Project)\n Configuration container for documentation renderers. Parameters: Name Type Description Default out_dir Path The directory where documentation files should be written. required project Project The introspected project models to be rendered. required"},{"location":"renderers/mcp_renderer/","title":"Mcp Renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer","title":"docforge.renderers.mcp_renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer","title":"MCPRenderer","text":"Renderer that emits MCP-native JSON resources from docforge models."},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP-compatible JSON resources and navigation for the project. Parameters: Name Type Description Default project Project The project model to render. required out_dir Path Target directory for the generated JSON files. required"},{"location":"renderers/mkdocs_renderer/","title":"Mkdocs Renderer","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer","title":"docforge.renderers.mkdocs_renderer","text":"MkDocsRenderer Generates Markdown source files compatible with MkDocs Material and mkdocstrings, ensuring: Root index.md always exists Parent package indexes are created automatically Child modules are linked in parent index files "},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that generates Markdown source files formatted for the MkDocs 'mkdocstrings' plugin."},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Produce a set of Markdown files in the output directory based on the provided Project models. Parameters: Name Type Description Default project Project The project models to render. required out_dir Path Target directory for documentation files. required module_is_source bool | None Module is the source folder and to be treated as the root folder. None"},{"location":"servers/","title":"Servers","text":""},{"location":"servers/#docforge.servers","title":"docforge.servers","text":""},{"location":"servers/#docforge.servers.MCPServer","title":"MCPServer","text":"MCPServer(mcp_root: Path, name: str)\n MCP server for serving a pre-built MCP documentation bundle. Initialize the MCPServer. Parameters: Name Type Description Default mcp_root Path Path to the directory containing pre-built MCP JSON resources. required name str Name of the MCP server. required"},{"location":"servers/#docforge.servers.MCPServer.run","title":"run","text":"run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None\n Start the MCP server. Parameters: Name Type Description Default transport Literal['stdio', 'sse', 'streamable-http'] MCP transport (default: streamable-http) 'streamable-http'"},{"location":"servers/mcp_server/","title":"Mcp Server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server","title":"docforge.servers.mcp_server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer","title":"MCPServer","text":"MCPServer(mcp_root: Path, name: str)\n MCP server for serving a pre-built MCP documentation bundle. Initialize the MCPServer. Parameters: Name Type Description Default mcp_root Path Path to the directory containing pre-built MCP JSON resources. required name str Name of the MCP server. required"},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer.run","title":"run","text":"run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None\n Start the MCP server. Parameters: Name Type Description Default transport Literal['stdio', 'sse', 'streamable-http'] MCP transport (default: streamable-http) 'streamable-http'"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"docforge","text":""},{"location":"#docforge","title":"docforge","text":"Renderer-agnostic Python documentation compiler that converts Python docstrings into structured documentation for both humans (MkDocs) and machines (MCP / AI agents). doc-forge statically analyzes source code, builds a semantic model of modules, classes, functions, and attributes, and renders that model into documentation outputs without executing user code."},{"location":"#docforge--installation","title":"Installation","text":"Install using pip: pip install doc-forge\n"},{"location":"#docforge--quick-start","title":"Quick start","text":"Generate a MkDocs site from a Python package: doc-forge build --mkdocs --module my_package\n Generate MCP JSON documentation: doc-forge build --mcp --module my_package\n Serve documentation locally: doc-forge serve --mkdocs --module my_package\n"},{"location":"#docforge--core-concepts","title":"Core concepts","text":"Loader Extracts symbols, signatures, and docstrings using static analysis. Semantic model Structured, renderer-agnostic representation of the API. Renderer Converts the semantic model into output formats such as MkDocs or MCP JSON. Symbol Any documentable object: - module\n- class\n- function\n- method\n- property\n- attribute\n"},{"location":"#docforge--architecture","title":"Architecture","text":"doc-forge follows a compiler architecture: Front-end: Static analysis of modules, classes, functions, type hints, and docstrings.\n Middle-end: Builds a semantic model describing symbols and relationships.\n Back-end: Renders documentation using interchangeable renderers.\n This architecture ensures deterministic documentation generation."},{"location":"#docforge--rendering-pipeline","title":"Rendering pipeline","text":"Typical flow: Python package\n \u2193\nLoader (static analysis)\n \u2193\nSemantic model\n \u2193\nRenderer\n \u2193\nMkDocs site or MCP JSON\n"},{"location":"#docforge--cli-usage","title":"CLI usage","text":"Build MkDocs documentation: doc-forge build --mkdocs --module my_package\n Build MCP documentation: doc-forge build --mcp --module my_package\n Serve MkDocs locally: doc-forge serve --module my_package\n"},{"location":"#docforge--public-api","title":"Public API","text":"Loaders: GriffeLoader\ndiscover_module_paths\n Renderers: MkDocsRenderer\nMCPRenderer\n CLI: main\n Models: models\n"},{"location":"#docforge--google-styled-doc-forge-convention-gsdfc","title":"Google-Styled Doc-Forge Convention (GSDFC)","text":"GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling. Docstrings are the single source of truth. doc-forge compiles docstrings but does not generate documentation content. Documentation follows the Python import hierarchy. Every public symbol should have a complete and accurate docstring. "},{"location":"#docforge--general-rules","title":"General rules","text":" Use Markdown headings at package and module level. Use Google-style structured sections at class, function, and method level. Indent section contents using four spaces. Use type hints in signatures instead of duplicating types in prose. Write summaries in imperative form. Sections are separated by --- "},{"location":"#docforge--package-docstrings","title":"Package docstrings","text":" Package docstrings act as the documentation home page. Recommended sections: ## Summary\n## Installation\n## Quick start\n## Core concepts\n## Architecture\n## Rendering pipeline\n## CLI usage\n## Public API\n## Examples\n## Notes\n Example Package Doc String: '''\nFoo-bar processing framework.\n\nProvides tools for defining Foo objects and executing Bar pipelines.\n\n---\n\n# Installation\n\n pip install foo-bar\n\n---\n\n# Quick start\n\n from foobar import Foo, BarEngine\n\n foo = Foo(\"example\")\n engine = BarEngine([foo])\n\n result = engine.run()\n\n---\n\n# Public API\n\n Foo\n Bar\n BarEngine\n\n---\n'''\n"},{"location":"#docforge--module-docstrings","title":"Module docstrings","text":" Module docstrings describe a subsystem. Recommended sections: ## Summary\n## Examples\n## Notes\n## Public API\n Example Module Doc String: '''\nFoo execution subsystem.\n\nProvides utilities for executing Foo objects through Bar stages.\n\n---\n\nExample:\n\n from foobar.engine import BarEngine\n from foobar.foo import Foo\n\n foo = Foo(\"example\")\n\n engine = BarEngine([foo])\n engine.run()\n\n---\n'''\n"},{"location":"#docforge--class-docstrings","title":"Class docstrings","text":" Class docstrings define object responsibility, lifecycle, and attributes. Recommended sections: Attributes:\nNotes:\nExample:\nRaises:\n Example Simple Foo: class Foo:\n '''\n Represents a unit of work.\n\n Attributes:\n name (str):\n Identifier of the foo instance.\n\n value (int):\n Numeric value associated with foo.\n\n Notes:\n Guarantees:\n\n - instances are immutable after creation\n\n Lifecycle:\n\n - create instance\n - pass to processing engine\n\n Example:\n Create and inspect a Foo:\n\n foo = Foo(\"example\", value=42)\n print(foo.name)\n '''\n Complex Bar: class BarEngine:\n '''\n Executes Foo objects through Bar stages.\n\n Attributes:\n foos (tuple[Foo, ...]):\n Foo instances managed by the engine.\n\n Notes:\n Guarantees:\n\n - deterministic execution order\n\n Example:\n Run engine:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n"},{"location":"#docforge--function-and-method-docstrings","title":"Function and method docstrings","text":" Function docstrings define API contracts. Recommended sections: Args:\nReturns:\nRaises:\nYields:\nNotes:\nExample:\n Example Simple process method: def process(foo: Foo, multiplier: int) -> int:\n '''\n Process a Foo instance.\n\n Args:\n foo (Foo):\n Foo instance to process.\n\n multiplier (int):\n Value used to scale foo.\n\n Returns:\n int:\n Processed result.\n\n Raises:\n ValueError:\n If multiplier is negative.\n\n Notes:\n Guarantees:\n\n - foo is not modified\n\n Example:\n Process foo:\n\n foo = Foo(\"example\", value=10)\n\n result = process(foo, multiplier=2)\n print(result)\n '''\n Multiple Examples: def combine(foo_a: Foo, foo_b: Foo) -> Foo:\n '''\n Combine two Foo instances.\n\n Args:\n foo_a (Foo):\n First foo.\n\n foo_b (Foo):\n Second foo.\n\n Returns:\n Foo:\n Combined foo.\n\n Example:\n Basic usage:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n combined = combine(foo1, foo2)\n\n Pipeline usage:\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n"},{"location":"#docforge--property-docstrings","title":"Property docstrings","text":" Properties must document return values. Example Property Doc String: @property\ndef foos(self) -> tuple[Foo, ...]:\n '''\n Return contained Foo instances.\n\n Returns:\n tuple[Foo, ...]:\n Stored foo objects.\n\n Example:\n container = FooContainer()\n\n foos = container.foos\n '''\n"},{"location":"#docforge--attribute-documentation","title":"Attribute documentation","text":" Document attributes in class docstrings using Attributes:. Example Attribute Doc String: '''\nRepresents a processing stage.\n\nAttributes:\n id (str):\n Unique identifier.\n\n enabled (bool):\n Whether the stage is active.\n'''\n"},{"location":"#docforge--notes-subsection-grouping","title":"Notes subsection grouping","text":" Group related information using labeled subsections. Example Notes Example: Notes:\n **Guarantees:**\n\n - deterministic behavior\n\n **Lifecycle:**\n\n - created during initialization\n - reused across executions\n\n **Thread safety:**\n\n - safe for concurrent reads\n"},{"location":"#docforge--example-formatting","title":"Example formatting","text":" Use indentation for examples. Example Single example: Example:\n\n foo = Foo(\"example\")\n process(foo, multiplier=2)\n Multiple examples: Example:\n Create foo:\n\n foo = Foo(\"example\")\n\n Run engine:\n\n engine = BarEngine([foo])\n engine.run()\n Avoid fenced code blocks inside structured sections."},{"location":"#docforge--separator-rules","title":"Separator rules","text":"Use horizontal separators only at docstring root level to separate sections: ---\n Allowed locations: package docstrings module docstrings major documentation sections Do not use separators inside code sections."},{"location":"#docforge--parsing-guarantees","title":"Parsing guarantees","text":"GSDFC ensures doc-forge can deterministically extract: symbol kind (module, class, function, property, attribute) symbol name parameters return values attributes examples structured Notes subsections This enables: reliable MkDocs rendering deterministic MCP export accurate AI semantic interpretation Notes doc-forge never executes analyzed modules. Documentation is generated entirely through static analysis. "},{"location":"#docforge-classes","title":"Classes","text":""},{"location":"#docforge.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Load Python modules using Griffe and convert them into doc-forge models. This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into Project, Module, and DocObject instances used by doc-forge. Initialize the Griffe-backed loader. Creates an internal Griffe loader instance with dedicated collections for modules and source lines."},{"location":"#docforge.GriffeLoader-functions","title":"Functions","text":""},{"location":"#docforge.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load and convert a single Python module. The module is introspected using Griffe and then transformed into a doc-forge Module model. Parameters: Name Type Description Default path str Dotted import path of the module. required Returns: Type Description Module A populated Module instance."},{"location":"#docforge.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and assemble them into a Project model. Each module path is introspected and converted into a Module instance. All modules are then aggregated into a single Project object. Parameters: Name Type Description Default module_paths List[str] List of dotted module import paths to load. required project_name Optional[str] Optional override for the project name. Defaults to the top-level name of the first module. None skip_import_errors bool If True, modules that fail to load will be skipped instead of raising an error. None Returns: Type Description Project A populated Project instance containing the loaded modules. Raises: Type Description ValueError If no module paths are provided. ImportError If a module fails to load and skip_import_errors is False."},{"location":"#docforge.MCPRenderer","title":"MCPRenderer","text":"Renderer that generates MCP-compatible documentation resources. This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP)."},{"location":"#docforge.MCPRenderer-functions","title":"Functions","text":""},{"location":"#docforge.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP documentation resources for a project. The renderer serializes each module into a JSON resource and produces supporting metadata files such as nav.json and index.json. Parameters: Name Type Description Default project Project Documentation project model to render. required out_dir Path Directory where MCP resources will be written. required"},{"location":"#docforge.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that produces Markdown documentation for MkDocs. Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically."},{"location":"#docforge.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"#docforge.MkDocsRenderer.generate_readme","title":"generate_readme","text":"generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None\n Generate a README.md file from the root module docstring. Behavior: If module_is_source is True, README.md is written to the project root directory. If False, README generation is currently not implemented. Parameters: Name Type Description Default project Project Project model containing documentation metadata. required docs_dir Path Directory containing generated documentation sources. required module_is_source bool | None Whether the module is treated as the project source root. None"},{"location":"#docforge.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Generate Markdown documentation files for a project. This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory. Parameters: Name Type Description Default project Project Project model containing modules to document. required out_dir Path Directory where generated Markdown files will be written. required module_is_source bool | None If True, treat the specified module as the documentation root rather than nesting it inside a folder. None"},{"location":"#docforge-functions","title":"Functions","text":""},{"location":"#docforge.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover Python modules within a package directory. The function scans the filesystem for .py files inside the specified package and converts them into dotted module import paths. Discovery rules: Directories containing __init__.py are treated as packages. Each .py file is treated as a module. Results are returned as dotted import paths. Parameters: Name Type Description Default module_name str Top-level package name to discover modules from. required project_root Path | None Root directory used to resolve module paths. If not provided, the current working directory is used. None Returns: Type Description List[str] A sorted list of unique dotted module import paths. Raises: Type Description FileNotFoundError If the specified package directory does not exist."},{"location":"cli/","title":"Cli","text":""},{"location":"cli/#docforge.cli","title":"docforge.cli","text":"Command line interface entry point for doc-forge. This module exposes the primary CLI entry function used by the doc-forge command. The actual command implementation resides in docforge.cli.main, while this module provides a stable import path for external tools and the package entry point configuration. The CLI is responsible for orchestrating documentation workflows such as generating renderer sources, building documentation sites, exporting machine-readable documentation bundles, and starting development or MCP servers."},{"location":"cli/#docforge.cli--typical-usage","title":"Typical usage","text":"The CLI is normally invoked through the installed command: doc-forge <command> [options]\n Programmatic invocation is also possible: from docforge.cli import main\nmain()\n"},{"location":"cli/commands/","title":"Commands","text":""},{"location":"cli/commands/#docforge.cli.commands","title":"docforge.cli.commands","text":""},{"location":"cli/commands/#docforge.cli.commands-classes","title":"Classes","text":""},{"location":"cli/commands/#docforge.cli.commands-functions","title":"Functions","text":""},{"location":"cli/commands/#docforge.cli.commands.build","title":"build","text":"build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None\n Build documentation artifacts. This command performs the full documentation build pipeline: Introspects the Python project using Griffe Generates renderer-specific documentation sources Optionally builds the final documentation output Depending on the selected options, the build can target: MkDocs static documentation sites MCP structured documentation resources Parameters: Name Type Description Default mcp bool Enable MCP documentation generation. required mkdocs bool Enable MkDocs documentation generation. required module_is_source bool Treat the specified module directory as the project root. required module Optional[str] Python module import path to document. required project_name Optional[str] Optional override for the project name. required site_name Optional[str] Display name for the MkDocs site. required docs_dir Path Directory where Markdown documentation sources will be generated. required nav_file Path Path to the navigation specification file. required template Optional[Path] Optional custom MkDocs configuration template. required mkdocs_yml Path Output path for the generated MkDocs configuration. required out_dir Path Output directory for generated MCP resources. required Raises: Type Description UsageError If required options are missing or conflicting."},{"location":"cli/commands/#docforge.cli.commands.serve","title":"serve","text":"serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None\n Serve generated documentation locally. Depending on the selected mode, this command starts either: A MkDocs development server for browsing documentation An MCP server exposing structured documentation resources Parameters: Name Type Description Default mcp bool Serve documentation using the MCP server. required mkdocs bool Serve the MkDocs development site. required module Optional[str] Python module import path to serve via MCP. required mkdocs_yml Path Path to the MkDocs configuration file. required out_dir Path Root directory containing MCP documentation resources. required Raises: Type Description UsageError If invalid or conflicting options are provided."},{"location":"cli/commands/#docforge.cli.commands.tree","title":"tree","text":"tree(module: str, project_name: Optional[str]) -> None\n Display the documentation object tree for a module. This command introspects the specified module and prints a hierarchical representation of the discovered documentation objects, including modules, classes, functions, and members. Parameters: Name Type Description Default module str Python module import path to introspect. required project_name Optional[str] Optional name to display as the project root. required"},{"location":"cli/main/","title":"Main","text":""},{"location":"cli/main/#docforge.cli.main","title":"docforge.cli.main","text":"Command-line entry point for the doc-forge CLI. This module exposes the executable entry point that initializes the Click command group defined in docforge.cli.commands."},{"location":"cli/main/#docforge.cli.main-functions","title":"Functions","text":""},{"location":"cli/main/#docforge.cli.main.main","title":"main","text":"main() -> None\n Run the doc-forge command-line interface. This function initializes and executes the Click CLI application. It is used as the console entry point when invoking doc-forge from the command line."},{"location":"cli/mcp_utils/","title":"Mcp Utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils","title":"docforge.cli.mcp_utils","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils-classes","title":"Classes","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils-functions","title":"Functions","text":""},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.generate_resources","title":"generate_resources","text":"generate_resources(module: str, project_name: str | None, out_dir: Path) -> None\n Generate MCP documentation resources from a Python module. The function performs project introspection, builds the internal documentation model, and renders MCP-compatible JSON resources to the specified output directory. Parameters: Name Type Description Default module str Python module import path used as the entry point for documentation generation. required project_name str | None Optional override for the project name used in generated documentation metadata. required out_dir Path Directory where MCP resources (index.json, nav.json, and module data) will be written. required"},{"location":"cli/mcp_utils/#docforge.cli.mcp_utils.serve","title":"serve","text":"serve(module: str, mcp_root: Path) -> None\n Start an MCP server for a pre-generated documentation bundle. The server exposes documentation resources such as project metadata, navigation structure, and module documentation through MCP endpoints. Parameters: Name Type Description Default module str Python module import path used to identify the served documentation instance. required mcp_root Path Path to the directory containing the MCP documentation bundle (index.json, nav.json, and modules/). required Raises: Type Description ClickException If the MCP documentation bundle is missing required files or directories."},{"location":"cli/mkdocs_utils/","title":"Mkdocs Utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils","title":"docforge.cli.mkdocs_utils","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils-classes","title":"Classes","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils-functions","title":"Functions","text":""},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.build","title":"build","text":"build(mkdocs_yml: Path) -> None\n Build the MkDocs documentation site. This function loads the MkDocs configuration and runs the MkDocs build command to generate the final static documentation site. Parameters: Name Type Description Default mkdocs_yml Path Path to the mkdocs.yml configuration file. required Raises: Type Description ClickException If the configuration file does not exist."},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_config","title":"generate_config","text":"generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None\n Generate an mkdocs.yml configuration file. The configuration is created by combining a template configuration with a navigation structure derived from the docforge navigation specification. Parameters: Name Type Description Default docs_dir Path Directory containing generated documentation Markdown files. required nav_file Path Path to the docforge.nav.yml navigation specification. required template Path | None Optional path to a custom MkDocs configuration template. If not provided, a built-in template will be used. required out Path Destination path where the generated mkdocs.yml file will be written. required site_name str Display name for the generated documentation site. required Raises: Type Description FileError If the navigation specification or template file cannot be found."},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.generate_sources","title":"generate_sources","text":"generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None\n Generate MkDocs Markdown sources for a Python module. This function introspects the specified module, builds the internal documentation model, and renders Markdown documentation files for use with MkDocs. Parameters: Name Type Description Default module str Python module import path used as the entry point for documentation generation. required docs_dir Path Directory where the generated Markdown files will be written. required project_name str | None Optional override for the project name used in documentation metadata. None module_is_source bool | None If True, treat the specified module directory as the project root rather than a nested module. None"},{"location":"cli/mkdocs_utils/#docforge.cli.mkdocs_utils.serve","title":"serve","text":"serve(mkdocs_yml: Path) -> None\n Start an MkDocs development server with live reload. The server watches documentation files and automatically reloads the site when changes are detected. Parameters: Name Type Description Default mkdocs_yml Path Path to the mkdocs.yml configuration file. required Raises: Type Description ClickException If the configuration file does not exist."},{"location":"loaders/","title":"Loaders","text":""},{"location":"loaders/#docforge.loaders","title":"docforge.loaders","text":"Loader layer for doc-forge. The docforge.loaders package is responsible for discovering Python modules and extracting documentation data using static analysis."},{"location":"loaders/#docforge.loaders--overview","title":"Overview","text":"This layer converts Python source code into an intermediate documentation model used by doc-forge. It performs module discovery, introspection, and initial filtering before the data is passed to the core documentation models. Core capabilities include: Module discovery \u2013 Locate Python modules and packages within a project. Static introspection \u2013 Parse docstrings, signatures, and object hierarchies using the griffe library without executing the code. Public API filtering \u2013 Exclude private members (names prefixed with _) to produce clean public documentation structures. "},{"location":"loaders/#docforge.loaders-classes","title":"Classes","text":""},{"location":"loaders/#docforge.loaders.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Load Python modules using Griffe and convert them into doc-forge models. This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into Project, Module, and DocObject instances used by doc-forge. Initialize the Griffe-backed loader. Creates an internal Griffe loader instance with dedicated collections for modules and source lines."},{"location":"loaders/#docforge.loaders.GriffeLoader-functions","title":"Functions","text":""},{"location":"loaders/#docforge.loaders.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load and convert a single Python module. The module is introspected using Griffe and then transformed into a doc-forge Module model. Parameters: Name Type Description Default path str Dotted import path of the module. required Returns: Type Description Module A populated Module instance."},{"location":"loaders/#docforge.loaders.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and assemble them into a Project model. Each module path is introspected and converted into a Module instance. All modules are then aggregated into a single Project object. Parameters: Name Type Description Default module_paths List[str] List of dotted module import paths to load. required project_name Optional[str] Optional override for the project name. Defaults to the top-level name of the first module. None skip_import_errors bool If True, modules that fail to load will be skipped instead of raising an error. None Returns: Type Description Project A populated Project instance containing the loaded modules. Raises: Type Description ValueError If no module paths are provided. ImportError If a module fails to load and skip_import_errors is False."},{"location":"loaders/#docforge.loaders-functions","title":"Functions","text":""},{"location":"loaders/#docforge.loaders.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover Python modules within a package directory. The function scans the filesystem for .py files inside the specified package and converts them into dotted module import paths. Discovery rules: Directories containing __init__.py are treated as packages. Each .py file is treated as a module. Results are returned as dotted import paths. Parameters: Name Type Description Default module_name str Top-level package name to discover modules from. required project_root Path | None Root directory used to resolve module paths. If not provided, the current working directory is used. None Returns: Type Description List[str] A sorted list of unique dotted module import paths. Raises: Type Description FileNotFoundError If the specified package directory does not exist."},{"location":"loaders/griffe_loader/","title":"Griffe Loader","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader","title":"docforge.loaders.griffe_loader","text":"Utilities for loading and introspecting Python modules using Griffe. This module provides the GriffeLoader class and helper utilities used to discover Python modules, introspect their structure, and convert the results into doc-forge documentation models."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader-classes","title":"Classes","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader","title":"GriffeLoader","text":"GriffeLoader()\n Load Python modules using Griffe and convert them into doc-forge models. This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into Project, Module, and DocObject instances used by doc-forge. Initialize the Griffe-backed loader. Creates an internal Griffe loader instance with dedicated collections for modules and source lines."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader-functions","title":"Functions","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_module","title":"load_module","text":"load_module(path: str) -> Module\n Load and convert a single Python module. The module is introspected using Griffe and then transformed into a doc-forge Module model. Parameters: Name Type Description Default path str Dotted import path of the module. required Returns: Type Description Module A populated Module instance."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.GriffeLoader.load_project","title":"load_project","text":"load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n Load multiple modules and assemble them into a Project model. Each module path is introspected and converted into a Module instance. All modules are then aggregated into a single Project object. Parameters: Name Type Description Default module_paths List[str] List of dotted module import paths to load. required project_name Optional[str] Optional override for the project name. Defaults to the top-level name of the first module. None skip_import_errors bool If True, modules that fail to load will be skipped instead of raising an error. None Returns: Type Description Project A populated Project instance containing the loaded modules. Raises: Type Description ValueError If no module paths are provided. ImportError If a module fails to load and skip_import_errors is False."},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader-functions","title":"Functions","text":""},{"location":"loaders/griffe_loader/#docforge.loaders.griffe_loader.discover_module_paths","title":"discover_module_paths","text":"discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n Discover Python modules within a package directory. The function scans the filesystem for .py files inside the specified package and converts them into dotted module import paths. Discovery rules: Directories containing __init__.py are treated as packages. Each .py file is treated as a module. Results are returned as dotted import paths. Parameters: Name Type Description Default module_name str Top-level package name to discover modules from. required project_root Path | None Root directory used to resolve module paths. If not provided, the current working directory is used. None Returns: Type Description List[str] A sorted list of unique dotted module import paths. Raises: Type Description FileNotFoundError If the specified package directory does not exist."},{"location":"models/","title":"Models","text":""},{"location":"models/#docforge.models","title":"docforge.models","text":"Model layer for doc-forge. The docforge.models package defines the core data structures used to represent Python source code as a structured documentation model."},{"location":"models/#docforge.models--overview","title":"Overview","text":"The model layer forms the central intermediate representation used throughout doc-forge. Python modules and objects discovered during introspection are converted into a hierarchy of documentation models that can later be rendered into different documentation formats. Key components: Project \u2013 Root container representing an entire documented codebase. Module \u2013 Representation of a Python module or package containing documented members. DocObject \u2013 Recursive structure representing Python objects such as classes, functions, methods, and attributes. These models are intentionally renderer-agnostic, allowing the same documentation structure to be transformed into multiple output formats (e.g., MkDocs, MCP, or other renderers)."},{"location":"models/#docforge.models-classes","title":"Classes","text":""},{"location":"models/#docforge.models.DocObject","title":"DocObject","text":"DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n Representation of a documented Python object. A DocObject models a single Python entity discovered during introspection. Objects may contain nested members, allowing the structure of modules, classes, and other containers to be represented recursively. Attributes: Name Type Description name str Local name of the object. kind str Type of object (for example class, function, method, or attribute). path str Fully qualified dotted path to the object. signature Optional[str] Callable signature if the object represents a callable. docstring Optional[str] Raw docstring text extracted from the source code. members Dict[str, DocObject] Mapping of member names to child DocObject instances. Initialize a DocObject instance. Parameters: Name Type Description Default name str Local name of the object. required kind str Object type identifier (for example class or function). required path str Fully qualified dotted path of the object. required signature Optional[str] Callable signature if applicable. None docstring Optional[str] Documentation string associated with the object. None"},{"location":"models/#docforge.models.DocObject-functions","title":"Functions","text":""},{"location":"models/#docforge.models.DocObject.add_member","title":"add_member","text":"add_member(obj: DocObject) -> None\n Add a child documentation object. This is typically used when attaching methods to classes or nested objects to their parent containers. Parameters: Name Type Description Default obj DocObject Documentation object to add as a member. required"},{"location":"models/#docforge.models.DocObject.get_all_members","title":"get_all_members","text":"get_all_members() -> Iterable[DocObject]\n Return all child members of the object. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances representing nested members."},{"location":"models/#docforge.models.DocObject.get_member","title":"get_member","text":"get_member(name: str) -> DocObject\n Retrieve a member object by name. Parameters: Name Type Description Default name str Name of the member to retrieve. required Returns: Type Description DocObject The corresponding DocObject instance. Raises: Type Description KeyError If the member does not exist."},{"location":"models/#docforge.models.Module","title":"Module","text":"Module(path: str, docstring: Optional[str] = None)\n Representation of a documented Python module or package. A Module stores metadata about the module itself and maintains a collection of top-level documentation objects discovered during introspection. Attributes: Name Type Description path str Dotted import path of the module. docstring Optional[str] Module-level documentation string, if present. members Dict[str, DocObject] Mapping of object names to their corresponding DocObject representations. Initialize a Module instance. Parameters: Name Type Description Default path str Dotted import path identifying the module. required docstring Optional[str] Module-level documentation text, if available. None"},{"location":"models/#docforge.models.Module-functions","title":"Functions","text":""},{"location":"models/#docforge.models.Module.add_object","title":"add_object","text":"add_object(obj: DocObject) -> None\n Add a documented object to the module. Parameters: Name Type Description Default obj DocObject Documentation object to register as a top-level member of the module. required"},{"location":"models/#docforge.models.Module.get_all_objects","title":"get_all_objects","text":"get_all_objects() -> Iterable[DocObject]\n Return all top-level documentation objects in the module. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances representing the Iterable[DocObject] module's public members."},{"location":"models/#docforge.models.Module.get_object","title":"get_object","text":"get_object(name: str) -> DocObject\n Retrieve a documented object by name. Parameters: Name Type Description Default name str Name of the object to retrieve. required Returns: Type Description DocObject The corresponding DocObject instance. Raises: Type Description KeyError If no object with the given name exists."},{"location":"models/#docforge.models.Project","title":"Project","text":"Project(name: str)\n Representation of a documentation project. A Project serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path. Attributes: Name Type Description name str Name of the project. modules Dict[str, Module] Mapping of module paths to Module instances. Initialize a Project instance. Parameters: Name Type Description Default name str Name used to identify the documentation project. required"},{"location":"models/#docforge.models.Project-functions","title":"Functions","text":""},{"location":"models/#docforge.models.Project.add_module","title":"add_module","text":"add_module(module: Module) -> None\n Register a module in the project. Parameters: Name Type Description Default module Module Module instance to add to the project. required"},{"location":"models/#docforge.models.Project.get_all_modules","title":"get_all_modules","text":"get_all_modules() -> Iterable[Module]\n Return all modules contained in the project. Returns: Type Description Iterable[Module] An iterable of Module instances."},{"location":"models/#docforge.models.Project.get_module","title":"get_module","text":"get_module(path: str) -> Module\n Retrieve a module by its dotted path. Parameters: Name Type Description Default path str Fully qualified dotted module path (for example pkg.module). required Returns: Type Description Module The corresponding Module instance. Raises: Type Description KeyError If the module does not exist in the project."},{"location":"models/#docforge.models.Project.get_module_list","title":"get_module_list","text":"get_module_list() -> list[str]\n Return the list of module import paths. Returns: Type Description list[str] A list containing the dotted paths of all modules in the project."},{"location":"models/module/","title":"Module","text":""},{"location":"models/module/#docforge.models.module","title":"docforge.models.module","text":"Documentation model representing a Python module or package. This module defines the Module class used in the doc-forge documentation model. A Module acts as a container for top-level documented objects (classes, functions, variables, and other members) discovered during introspection."},{"location":"models/module/#docforge.models.module-classes","title":"Classes","text":""},{"location":"models/module/#docforge.models.module.Module","title":"Module","text":"Module(path: str, docstring: Optional[str] = None)\n Representation of a documented Python module or package. A Module stores metadata about the module itself and maintains a collection of top-level documentation objects discovered during introspection. Attributes: Name Type Description path str Dotted import path of the module. docstring Optional[str] Module-level documentation string, if present. members Dict[str, DocObject] Mapping of object names to their corresponding DocObject representations. Initialize a Module instance. Parameters: Name Type Description Default path str Dotted import path identifying the module. required docstring Optional[str] Module-level documentation text, if available. None"},{"location":"models/module/#docforge.models.module.Module-functions","title":"Functions","text":""},{"location":"models/module/#docforge.models.module.Module.add_object","title":"add_object","text":"add_object(obj: DocObject) -> None\n Add a documented object to the module. Parameters: Name Type Description Default obj DocObject Documentation object to register as a top-level member of the module. required"},{"location":"models/module/#docforge.models.module.Module.get_all_objects","title":"get_all_objects","text":"get_all_objects() -> Iterable[DocObject]\n Return all top-level documentation objects in the module. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances representing the Iterable[DocObject] module's public members."},{"location":"models/module/#docforge.models.module.Module.get_object","title":"get_object","text":"get_object(name: str) -> DocObject\n Retrieve a documented object by name. Parameters: Name Type Description Default name str Name of the object to retrieve. required Returns: Type Description DocObject The corresponding DocObject instance. Raises: Type Description KeyError If no object with the given name exists."},{"location":"models/object/","title":"Object","text":""},{"location":"models/object/#docforge.models.object","title":"docforge.models.object","text":"Documentation model representing individual Python objects. This module defines the DocObject class, the fundamental recursive unit of the doc-forge documentation model. Each DocObject represents a Python entity such as a class, function, method, or attribute, and may contain nested members that form a hierarchical documentation structure."},{"location":"models/object/#docforge.models.object-classes","title":"Classes","text":""},{"location":"models/object/#docforge.models.object.DocObject","title":"DocObject","text":"DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n Representation of a documented Python object. A DocObject models a single Python entity discovered during introspection. Objects may contain nested members, allowing the structure of modules, classes, and other containers to be represented recursively. Attributes: Name Type Description name str Local name of the object. kind str Type of object (for example class, function, method, or attribute). path str Fully qualified dotted path to the object. signature Optional[str] Callable signature if the object represents a callable. docstring Optional[str] Raw docstring text extracted from the source code. members Dict[str, DocObject] Mapping of member names to child DocObject instances. Initialize a DocObject instance. Parameters: Name Type Description Default name str Local name of the object. required kind str Object type identifier (for example class or function). required path str Fully qualified dotted path of the object. required signature Optional[str] Callable signature if applicable. None docstring Optional[str] Documentation string associated with the object. None"},{"location":"models/object/#docforge.models.object.DocObject-functions","title":"Functions","text":""},{"location":"models/object/#docforge.models.object.DocObject.add_member","title":"add_member","text":"add_member(obj: DocObject) -> None\n Add a child documentation object. This is typically used when attaching methods to classes or nested objects to their parent containers. Parameters: Name Type Description Default obj DocObject Documentation object to add as a member. required"},{"location":"models/object/#docforge.models.object.DocObject.get_all_members","title":"get_all_members","text":"get_all_members() -> Iterable[DocObject]\n Return all child members of the object. Returns: Type Description Iterable[DocObject] An iterable of DocObject instances representing nested members."},{"location":"models/object/#docforge.models.object.DocObject.get_member","title":"get_member","text":"get_member(name: str) -> DocObject\n Retrieve a member object by name. Parameters: Name Type Description Default name str Name of the member to retrieve. required Returns: Type Description DocObject The corresponding DocObject instance. Raises: Type Description KeyError If the member does not exist."},{"location":"models/project/","title":"Project","text":""},{"location":"models/project/#docforge.models.project","title":"docforge.models.project","text":"Documentation model representing a project. This module defines the Project class, the top-level container used by doc-forge to represent a documented codebase. A Project aggregates multiple modules and provides access to them through a unified interface."},{"location":"models/project/#docforge.models.project-classes","title":"Classes","text":""},{"location":"models/project/#docforge.models.project.Project","title":"Project","text":"Project(name: str)\n Representation of a documentation project. A Project serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path. Attributes: Name Type Description name str Name of the project. modules Dict[str, Module] Mapping of module paths to Module instances. Initialize a Project instance. Parameters: Name Type Description Default name str Name used to identify the documentation project. required"},{"location":"models/project/#docforge.models.project.Project-functions","title":"Functions","text":""},{"location":"models/project/#docforge.models.project.Project.add_module","title":"add_module","text":"add_module(module: Module) -> None\n Register a module in the project. Parameters: Name Type Description Default module Module Module instance to add to the project. required"},{"location":"models/project/#docforge.models.project.Project.get_all_modules","title":"get_all_modules","text":"get_all_modules() -> Iterable[Module]\n Return all modules contained in the project. Returns: Type Description Iterable[Module] An iterable of Module instances."},{"location":"models/project/#docforge.models.project.Project.get_module","title":"get_module","text":"get_module(path: str) -> Module\n Retrieve a module by its dotted path. Parameters: Name Type Description Default path str Fully qualified dotted module path (for example pkg.module). required Returns: Type Description Module The corresponding Module instance. Raises: Type Description KeyError If the module does not exist in the project."},{"location":"models/project/#docforge.models.project.Project.get_module_list","title":"get_module_list","text":"get_module_list() -> list[str]\n Return the list of module import paths. Returns: Type Description list[str] A list containing the dotted paths of all modules in the project."},{"location":"nav/","title":"Nav","text":""},{"location":"nav/#docforge.nav","title":"docforge.nav","text":"Navigation layer for doc-forge. The docforge.nav package manages the relationship between the logical documentation structure defined by the user and the physical documentation files generated on disk."},{"location":"nav/#docforge.nav--workflow","title":"Workflow","text":" Specification \u2013 Users define navigation intent in docforge.nav.yml. Resolution \u2013 resolve_nav expands patterns and matches them against generated Markdown files. Emission \u2013 MkDocsNavEmitter converts the resolved structure into the YAML navigation format required by mkdocs.yml. This layer separates documentation organization from the underlying source code layout, enabling flexible grouping, ordering, and navigation structures independent of module hierarchy."},{"location":"nav/#docforge.nav-classes","title":"Classes","text":""},{"location":"nav/#docforge.nav.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"Emit MkDocs navigation structures from resolved navigation data. The emitter transforms a ResolvedNav object into the YAML-compatible list structure expected by the MkDocs nav configuration field."},{"location":"nav/#docforge.nav.MkDocsNavEmitter-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.MkDocsNavEmitter.emit","title":"emit","text":"emit(nav: ResolvedNav) -> List[Dict[str, Any]]\n Generate a navigation structure for mkdocs.yml. Parameters: Name Type Description Default nav ResolvedNav Resolved navigation data describing documentation groups and their associated Markdown files. required Returns: Type Description List[Dict[str, Any]] A list of dictionaries representing the MkDocs navigation layout. List[Dict[str, Any]] Each dictionary maps a navigation label to a page or a list of List[Dict[str, Any]] pages."},{"location":"nav/#docforge.nav.NavSpec","title":"NavSpec","text":"NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n Parsed representation of a navigation specification. A NavSpec describes the intended documentation navigation layout before it is resolved against the filesystem. Attributes: Name Type Description home Optional[str] Relative path to the documentation home page (for example index.md). groups Dict[str, List[str]] Mapping of navigation group titles to lists of file patterns or glob expressions. Initialize a NavSpec instance. Parameters: Name Type Description Default home Optional[str] Relative path to the home document. required groups Dict[str, List[str]] Mapping of group names to lists of path patterns (glob expressions). required"},{"location":"nav/#docforge.nav.NavSpec-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.NavSpec.all_patterns","title":"all_patterns","text":"all_patterns() -> List[str]\n Return all path patterns referenced by the specification. Returns: Type Description List[str] A list containing the home document (if defined) and all List[str] group pattern entries."},{"location":"nav/#docforge.nav.NavSpec.load","title":"load classmethod","text":"load(path: Path) -> NavSpec\n Load a navigation specification from a YAML file. Parameters: Name Type Description Default path Path Filesystem path to the navigation specification file. required Returns: Type Description NavSpec A NavSpec instance representing the parsed configuration. Raises: Type Description FileNotFoundError If the specified file does not exist. ValueError If the file contents are not a valid navigation specification."},{"location":"nav/#docforge.nav.ResolvedNav","title":"ResolvedNav","text":"ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n Resolved navigation structure. A ResolvedNav represents navigation data after glob patterns have been expanded and paths validated against the filesystem. Attributes: Name Type Description home Optional[str] Relative path to the documentation home page. groups Dict[str, List[Path]] Mapping of navigation group titles to lists of resolved documentation file paths. Initialize a ResolvedNav instance. Parameters: Name Type Description Default home str | None Relative path to the home page within the documentation root. required groups Dict[str, List[Path]] Mapping of group titles to resolved documentation file paths. required docs_root Path | None Root directory of the documentation source files. None"},{"location":"nav/#docforge.nav.ResolvedNav-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.ResolvedNav.all_files","title":"all_files","text":"all_files() -> Iterable[Path]\n Iterate over all files referenced by the navigation structure. Returns: Type Description Iterable[Path] An iterable of Path objects representing documentation files. Raises: Type Description RuntimeError If the home page is defined but the documentation root is not available for resolution."},{"location":"nav/#docforge.nav-functions","title":"Functions","text":""},{"location":"nav/#docforge.nav.load_nav_spec","title":"load_nav_spec","text":"load_nav_spec(path: Path) -> NavSpec\n Load a navigation specification file. This helper function reads a YAML navigation file and constructs a corresponding NavSpec instance. Parameters: Name Type Description Default path Path Path to the navigation specification file. required Returns: Type Description NavSpec A NavSpec instance representing the parsed specification. Raises: Type Description FileNotFoundError If the specification file does not exist. ValueError If the YAML structure is invalid."},{"location":"nav/#docforge.nav.resolve_nav","title":"resolve_nav","text":"resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav\n Resolve a navigation specification against the filesystem. The function expands glob patterns defined in a NavSpec and verifies that referenced documentation files exist within the documentation root. Parameters: Name Type Description Default spec NavSpec Navigation specification describing documentation layout. required docs_root Path Root directory containing documentation Markdown files. required Returns: Type Description ResolvedNav A ResolvedNav instance containing validated navigation paths. Raises: Type Description FileNotFoundError If the documentation root does not exist or a navigation pattern does not match any files."},{"location":"nav/mkdocs/","title":"Mkdocs","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs","title":"docforge.nav.mkdocs","text":"MkDocs navigation emitter. This module provides the MkDocsNavEmitter class, which converts a ResolvedNav instance into the navigation structure required by the MkDocs nav configuration."},{"location":"nav/mkdocs/#docforge.nav.mkdocs-classes","title":"Classes","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter","title":"MkDocsNavEmitter","text":"Emit MkDocs navigation structures from resolved navigation data. The emitter transforms a ResolvedNav object into the YAML-compatible list structure expected by the MkDocs nav configuration field."},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter-functions","title":"Functions","text":""},{"location":"nav/mkdocs/#docforge.nav.mkdocs.MkDocsNavEmitter.emit","title":"emit","text":"emit(nav: ResolvedNav) -> List[Dict[str, Any]]\n Generate a navigation structure for mkdocs.yml. Parameters: Name Type Description Default nav ResolvedNav Resolved navigation data describing documentation groups and their associated Markdown files. required Returns: Type Description List[Dict[str, Any]] A list of dictionaries representing the MkDocs navigation layout. List[Dict[str, Any]] Each dictionary maps a navigation label to a page or a list of List[Dict[str, Any]] pages."},{"location":"nav/resolver/","title":"Resolver","text":""},{"location":"nav/resolver/#docforge.nav.resolver","title":"docforge.nav.resolver","text":"Navigation resolution utilities. This module resolves a NavSpec against the filesystem by expanding glob patterns and validating that referenced documentation files exist."},{"location":"nav/resolver/#docforge.nav.resolver-classes","title":"Classes","text":""},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav","title":"ResolvedNav","text":"ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n Resolved navigation structure. A ResolvedNav represents navigation data after glob patterns have been expanded and paths validated against the filesystem. Attributes: Name Type Description home Optional[str] Relative path to the documentation home page. groups Dict[str, List[Path]] Mapping of navigation group titles to lists of resolved documentation file paths. Initialize a ResolvedNav instance. Parameters: Name Type Description Default home str | None Relative path to the home page within the documentation root. required groups Dict[str, List[Path]] Mapping of group titles to resolved documentation file paths. required docs_root Path | None Root directory of the documentation source files. None"},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav-functions","title":"Functions","text":""},{"location":"nav/resolver/#docforge.nav.resolver.ResolvedNav.all_files","title":"all_files","text":"all_files() -> Iterable[Path]\n Iterate over all files referenced by the navigation structure. Returns: Type Description Iterable[Path] An iterable of Path objects representing documentation files. Raises: Type Description RuntimeError If the home page is defined but the documentation root is not available for resolution."},{"location":"nav/resolver/#docforge.nav.resolver-functions","title":"Functions","text":""},{"location":"nav/resolver/#docforge.nav.resolver.resolve_nav","title":"resolve_nav","text":"resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav\n Resolve a navigation specification against the filesystem. The function expands glob patterns defined in a NavSpec and verifies that referenced documentation files exist within the documentation root. Parameters: Name Type Description Default spec NavSpec Navigation specification describing documentation layout. required docs_root Path Root directory containing documentation Markdown files. required Returns: Type Description ResolvedNav A ResolvedNav instance containing validated navigation paths. Raises: Type Description FileNotFoundError If the documentation root does not exist or a navigation pattern does not match any files."},{"location":"nav/spec/","title":"Spec","text":""},{"location":"nav/spec/#docforge.nav.spec","title":"docforge.nav.spec","text":"Navigation specification model. This module defines the NavSpec class, which represents the navigation structure defined by the user in the doc-forge navigation specification (typically docforge.nav.yml)."},{"location":"nav/spec/#docforge.nav.spec-classes","title":"Classes","text":""},{"location":"nav/spec/#docforge.nav.spec.NavSpec","title":"NavSpec","text":"NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n Parsed representation of a navigation specification. A NavSpec describes the intended documentation navigation layout before it is resolved against the filesystem. Attributes: Name Type Description home Optional[str] Relative path to the documentation home page (for example index.md). groups Dict[str, List[str]] Mapping of navigation group titles to lists of file patterns or glob expressions. Initialize a NavSpec instance. Parameters: Name Type Description Default home Optional[str] Relative path to the home document. required groups Dict[str, List[str]] Mapping of group names to lists of path patterns (glob expressions). required"},{"location":"nav/spec/#docforge.nav.spec.NavSpec-functions","title":"Functions","text":""},{"location":"nav/spec/#docforge.nav.spec.NavSpec.all_patterns","title":"all_patterns","text":"all_patterns() -> List[str]\n Return all path patterns referenced by the specification. Returns: Type Description List[str] A list containing the home document (if defined) and all List[str] group pattern entries."},{"location":"nav/spec/#docforge.nav.spec.NavSpec.load","title":"load classmethod","text":"load(path: Path) -> NavSpec\n Load a navigation specification from a YAML file. Parameters: Name Type Description Default path Path Filesystem path to the navigation specification file. required Returns: Type Description NavSpec A NavSpec instance representing the parsed configuration. Raises: Type Description FileNotFoundError If the specified file does not exist. ValueError If the file contents are not a valid navigation specification."},{"location":"nav/spec/#docforge.nav.spec-functions","title":"Functions","text":""},{"location":"nav/spec/#docforge.nav.spec.load_nav_spec","title":"load_nav_spec","text":"load_nav_spec(path: Path) -> NavSpec\n Load a navigation specification file. This helper function reads a YAML navigation file and constructs a corresponding NavSpec instance. Parameters: Name Type Description Default path Path Path to the navigation specification file. required Returns: Type Description NavSpec A NavSpec instance representing the parsed specification. Raises: Type Description FileNotFoundError If the specification file does not exist. ValueError If the YAML structure is invalid."},{"location":"renderers/","title":"Renderers","text":""},{"location":"renderers/#docforge.renderers","title":"docforge.renderers","text":"Renderers layer for doc-forge. The docforge.renderers package transforms the internal documentation models into files formatted for specific documentation systems."},{"location":"renderers/#docforge.renderers--overview","title":"Overview","text":"Renderers consume the doc-forge project model and generate output suitable for documentation tools or machine interfaces. Current implementations: MkDocsRenderer \u2013 Produces Markdown files compatible with MkDocs and the mkdocstrings plugin. It automatically handles package hierarchy and generates index.md files for packages. MCPRenderer \u2013 Emits structured JSON resources designed for consumption by Model Context Protocol (MCP) clients. "},{"location":"renderers/#docforge.renderers--extending","title":"Extending","text":"New renderers can be added by implementing the DocRenderer protocol defined in docforge.renderers.base."},{"location":"renderers/#docforge.renderers-classes","title":"Classes","text":""},{"location":"renderers/#docforge.renderers.MCPRenderer","title":"MCPRenderer","text":"Renderer that generates MCP-compatible documentation resources. This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP)."},{"location":"renderers/#docforge.renderers.MCPRenderer-functions","title":"Functions","text":""},{"location":"renderers/#docforge.renderers.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP documentation resources for a project. The renderer serializes each module into a JSON resource and produces supporting metadata files such as nav.json and index.json. Parameters: Name Type Description Default project Project Documentation project model to render. required out_dir Path Directory where MCP resources will be written. required"},{"location":"renderers/#docforge.renderers.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that produces Markdown documentation for MkDocs. Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically."},{"location":"renderers/#docforge.renderers.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"renderers/#docforge.renderers.MkDocsRenderer.generate_readme","title":"generate_readme","text":"generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None\n Generate a README.md file from the root module docstring. Behavior: If module_is_source is True, README.md is written to the project root directory. If False, README generation is currently not implemented. Parameters: Name Type Description Default project Project Project model containing documentation metadata. required docs_dir Path Directory containing generated documentation sources. required module_is_source bool | None Whether the module is treated as the project source root. None"},{"location":"renderers/#docforge.renderers.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Generate Markdown documentation files for a project. This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory. Parameters: Name Type Description Default project Project Project model containing modules to document. required out_dir Path Directory where generated Markdown files will be written. required module_is_source bool | None If True, treat the specified module as the documentation root rather than nesting it inside a folder. None"},{"location":"renderers/base/","title":"Base","text":""},{"location":"renderers/base/#docforge.renderers.base","title":"docforge.renderers.base","text":"Renderer base interfaces and configuration models. This module defines the base protocol and configuration container used by doc-forge renderers. Concrete renderer implementations should implement the DocRenderer protocol."},{"location":"renderers/base/#docforge.renderers.base-classes","title":"Classes","text":""},{"location":"renderers/base/#docforge.renderers.base.DocRenderer","title":"DocRenderer","text":" Bases: Protocol Protocol defining the interface for documentation renderers. Implementations of this protocol are responsible for transforming a Project model into renderer-specific documentation sources."},{"location":"renderers/base/#docforge.renderers.base.DocRenderer-functions","title":"Functions","text":""},{"location":"renderers/base/#docforge.renderers.base.DocRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate renderer-specific documentation sources. Parameters: Name Type Description Default project Project Project model containing modules and documentation objects. required out_dir Path Directory where generated documentation sources should be written. required"},{"location":"renderers/base/#docforge.renderers.base.RendererConfig","title":"RendererConfig","text":"RendererConfig(out_dir: Path, project: Project)\n Configuration container for documentation renderers. A RendererConfig instance groups together the project model and the output directory used during rendering. Attributes: Name Type Description out_dir Path Directory where generated documentation files will be written. project Project Documentation project model to be rendered. Initialize a RendererConfig instance. Parameters: Name Type Description Default out_dir Path Target directory where documentation files should be written. required project Project Introspected project model to render. required"},{"location":"renderers/base/#docforge.renderers.base.RendererConfig-functions","title":"Functions","text":""},{"location":"renderers/mcp_renderer/","title":"Mcp Renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer","title":"docforge.renderers.mcp_renderer","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer-classes","title":"Classes","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer","title":"MCPRenderer","text":"Renderer that generates MCP-compatible documentation resources. This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP)."},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer-functions","title":"Functions","text":""},{"location":"renderers/mcp_renderer/#docforge.renderers.mcp_renderer.MCPRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path) -> None\n Generate MCP documentation resources for a project. The renderer serializes each module into a JSON resource and produces supporting metadata files such as nav.json and index.json. Parameters: Name Type Description Default project Project Documentation project model to render. required out_dir Path Directory where MCP resources will be written. required"},{"location":"renderers/mkdocs_renderer/","title":"Mkdocs Renderer","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer","title":"docforge.renderers.mkdocs_renderer","text":"MkDocs renderer implementation. This module defines the MkDocsRenderer class, which generates Markdown documentation sources compatible with MkDocs Material and the mkdocstrings plugin. The renderer ensures a consistent documentation structure by: Creating a root index.md if one does not exist Generating package index pages automatically Linking child modules within parent package pages Optionally generating README.md from the root package docstring "},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer-classes","title":"Classes","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer","title":"MkDocsRenderer","text":"Renderer that produces Markdown documentation for MkDocs. Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically."},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer-functions","title":"Functions","text":""},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_readme","title":"generate_readme","text":"generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None\n Generate a README.md file from the root module docstring. Behavior: If module_is_source is True, README.md is written to the project root directory. If False, README generation is currently not implemented. Parameters: Name Type Description Default project Project Project model containing documentation metadata. required docs_dir Path Directory containing generated documentation sources. required module_is_source bool | None Whether the module is treated as the project source root. None"},{"location":"renderers/mkdocs_renderer/#docforge.renderers.mkdocs_renderer.MkDocsRenderer.generate_sources","title":"generate_sources","text":"generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n Generate Markdown documentation files for a project. This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory. Parameters: Name Type Description Default project Project Project model containing modules to document. required out_dir Path Directory where generated Markdown files will be written. required module_is_source bool | None If True, treat the specified module as the documentation root rather than nesting it inside a folder. None"},{"location":"servers/","title":"Servers","text":""},{"location":"servers/#docforge.servers","title":"docforge.servers","text":"Server layer for doc-forge. This module exposes server implementations used to provide live access to generated documentation resources. Currently, it includes the MCP documentation server."},{"location":"servers/#docforge.servers-classes","title":"Classes","text":""},{"location":"servers/#docforge.servers.MCPServer","title":"MCPServer","text":"MCPServer(mcp_root: Path, name: str)\n MCP server for serving a pre-generated documentation bundle. The server exposes documentation resources and diagnostic tools through MCP endpoints backed by JSON files generated by the MCP renderer. Initialize the MCP server. Parameters: Name Type Description Default mcp_root Path Directory containing the generated MCP documentation bundle (for example index.json, nav.json, and modules/). required name str Identifier used for the MCP server instance. required"},{"location":"servers/#docforge.servers.MCPServer-functions","title":"Functions","text":""},{"location":"servers/#docforge.servers.MCPServer.run","title":"run","text":"run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None\n Start the MCP server. Parameters: Name Type Description Default transport Literal['stdio', 'sse', 'streamable-http'] Transport mechanism used by the MCP server. Supported options include stdio, sse, and streamable-http. 'streamable-http'"},{"location":"servers/mcp_server/","title":"Mcp Server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server","title":"docforge.servers.mcp_server","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server-classes","title":"Classes","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer","title":"MCPServer","text":"MCPServer(mcp_root: Path, name: str)\n MCP server for serving a pre-generated documentation bundle. The server exposes documentation resources and diagnostic tools through MCP endpoints backed by JSON files generated by the MCP renderer. Initialize the MCP server. Parameters: Name Type Description Default mcp_root Path Directory containing the generated MCP documentation bundle (for example index.json, nav.json, and modules/). required name str Identifier used for the MCP server instance. required"},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer-functions","title":"Functions","text":""},{"location":"servers/mcp_server/#docforge.servers.mcp_server.MCPServer.run","title":"run","text":"run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None\n Start the MCP server. Parameters: Name Type Description Default transport Literal['stdio', 'sse', 'streamable-http'] Transport mechanism used by the MCP server. Supported options include stdio, sse, and streamable-http. 'streamable-http'"}]} \ No newline at end of file diff --git a/libs/doc-forge/site/servers/index.html b/libs/doc-forge/site/servers/index.html index a853e30..2fe1168 100644 --- a/libs/doc-forge/site/servers/index.html +++ b/libs/doc-forge/site/servers/index.html @@ -82,7 +82,9 @@ - + + + @@ -147,12 +149,19 @@ + + + + + + + @@ -178,134 +187,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -319,10 +200,8 @@ - - - + @@ -365,13 +244,23 @@ - - + + + + + - + + + + + + + + @@ -380,8 +269,9 @@ - - + + + @@ -390,8 +280,14 @@ - - + + + + + + + + @@ -401,27 +297,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -461,13 +336,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -476,8 +365,9 @@ - - + + + @@ -486,8 +376,14 @@ - - + + + + + + + + @@ -497,27 +393,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -603,13 +478,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -618,8 +507,9 @@ - - + + + @@ -628,8 +518,14 @@ - - + + + + + + + + @@ -639,27 +535,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -745,13 +620,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -760,8 +649,9 @@ - - + + + @@ -770,8 +660,14 @@ - - + + + + + + + + @@ -781,27 +677,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -887,13 +762,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -902,8 +793,9 @@ - - + + + @@ -912,8 +804,14 @@ - - + + + + + + + + @@ -923,27 +821,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1081,6 +958,16 @@ + + + Classes + + + + + + + MCPServer @@ -1091,6 +978,16 @@ + + + Functions + + + + + + + run @@ -1107,6 +1004,16 @@ + + + + + + + + + + @@ -1133,13 +1040,19 @@ - docforge.servers + docforge.servers + Server layer for doc-forge. +This module exposes server implementations used to provide live access +to generated documentation resources. Currently, it includes the MCP +documentation server. + + @@ -1149,26 +1062,28 @@ - +Classes - - MCPServer + + MCPServer - -MCPServer(mcp_root: Path, name: str) - + +1MCPServer(mcp_root: Path, name: str) + - MCP server for serving a pre-built MCP documentation bundle. + MCP server for serving a pre-generated documentation bundle. +The server exposes documentation resources and diagnostic tools through +MCP endpoints backed by JSON files generated by the MCP renderer. - Initialize the MCPServer. + Initialize the MCP server. Parameters: @@ -1189,7 +1104,9 @@ - Path to the directory containing pre-built MCP JSON resources. + Directory containing the generated MCP documentation +bundle (for example index.json, nav.json, and +modules/). @@ -1203,7 +1120,7 @@ - Name of the MCP server. + Identifier used for the MCP server instance. @@ -1224,18 +1141,18 @@ - +Functions - - run + + run - -run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None - + +1run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None + @@ -1260,7 +1177,8 @@ - MCP transport (default: streamable-http) + Transport mechanism used by the MCP server. Supported +options include stdio, sse, and streamable-http. @@ -1307,6 +1225,8 @@ + + @@ -1344,7 +1264,7 @@ - + diff --git a/libs/doc-forge/site/servers/mcp_server/index.html b/libs/doc-forge/site/servers/mcp_server/index.html index 70d646a..fd997a3 100644 --- a/libs/doc-forge/site/servers/mcp_server/index.html +++ b/libs/doc-forge/site/servers/mcp_server/index.html @@ -82,7 +82,9 @@ - + + + @@ -147,12 +149,19 @@ + + + + + + + @@ -178,134 +187,6 @@ - - - - - - - - - - - - - - - - - - Home - - - - - - - - - - - - - - - - - - - Loaders - - - - - - - - - - - - - - - - - - - - Models - - - - - - - - - - - - - - - - - - - - Navigation - - - - - - - - - - - - - - - - - - - - Renderers - - - - - - - - - - - - - - - - - - - - CLI - - - - - - - - - - - @@ -319,10 +200,8 @@ - - - + @@ -365,13 +244,23 @@ - - + + + + + - + + + + + + + + @@ -380,8 +269,9 @@ - - + + + @@ -390,8 +280,14 @@ - - + + + + + + + + @@ -401,27 +297,6 @@ - - - - - - - - - - - - Loaders - - - - - - - - - @@ -461,13 +336,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -476,8 +365,9 @@ - - + + + @@ -486,8 +376,14 @@ - - + + + + + + + + @@ -497,27 +393,6 @@ - - - - - - - - - - - - Models - - - - - - - - - @@ -603,13 +478,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -618,8 +507,9 @@ - - + + + @@ -628,8 +518,14 @@ - - + + + + + + + + @@ -639,27 +535,6 @@ - - - - - - - - - - - - Nav - - - - - - - - - @@ -745,13 +620,27 @@ - - + + + + + + + + + - + + + + + + + + @@ -760,8 +649,9 @@ - - + + + @@ -770,8 +660,14 @@ - - + + + + + + + + @@ -781,27 +677,6 @@ - - - - - - - - - - - - Renderers - - - - - - - - - @@ -887,13 +762,29 @@ - - + + + + + + + + + + + - + + + + + + + + @@ -902,8 +793,9 @@ - - + + + @@ -912,8 +804,14 @@ - - + + + + + + + + @@ -923,27 +821,6 @@ - - - - - - - - - - - - Cli - - - - - - - - - @@ -1081,6 +958,16 @@ + + + Classes + + + + + + + MCPServer @@ -1091,6 +978,16 @@ + + + Functions + + + + + + + run @@ -1107,6 +1004,16 @@ + + + + + + + + + + @@ -1133,7 +1040,7 @@ - docforge.servers.mcp_server + docforge.servers.mcp_server @@ -1149,26 +1056,28 @@ - +Classes - - MCPServer + + MCPServer - -MCPServer(mcp_root: Path, name: str) - + +1MCPServer(mcp_root: Path, name: str) + - MCP server for serving a pre-built MCP documentation bundle. + MCP server for serving a pre-generated documentation bundle. +The server exposes documentation resources and diagnostic tools through +MCP endpoints backed by JSON files generated by the MCP renderer. - Initialize the MCPServer. + Initialize the MCP server. Parameters: @@ -1189,7 +1098,9 @@ - Path to the directory containing pre-built MCP JSON resources. + Directory containing the generated MCP documentation +bundle (for example index.json, nav.json, and +modules/). @@ -1203,7 +1114,7 @@ - Name of the MCP server. + Identifier used for the MCP server instance. @@ -1224,18 +1135,18 @@ - +Functions - - run + + run - -run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None - + +1run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None + @@ -1260,7 +1171,8 @@ - MCP transport (default: streamable-http) + Transport mechanism used by the MCP server. Supported +options include stdio, sse, and streamable-http. @@ -1307,6 +1219,8 @@ + + @@ -1344,7 +1258,7 @@ - + diff --git a/libs/doc-forge/site/sitemap.xml.gz b/libs/doc-forge/site/sitemap.xml.gz index b57afed..ef3423e 100644 Binary files a/libs/doc-forge/site/sitemap.xml.gz and b/libs/doc-forge/site/sitemap.xml.gz differ
build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None -
1
build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None +
Build documentation (MkDocs site or MCP resources).
This command orchestrates the full build process: -1. Introspects the code (Griffe) -2. Renders sources (MkDocs Markdown or MCP JSON) -3. (MkDocs only) Generates config and runs the final site build.
Build documentation artifacts.
This command performs the full documentation build pipeline:
Depending on the selected options, the build can target:
Parameters:
Use the MCP documentation builder.
Enable MCP documentation generation.
Use the MkDocs documentation builder.
Enable MkDocs documentation generation.
Module is the source folder and to be treated as the root folder.
Treat the specified module directory as the +project root.
The dotted path of the module to the document.
Python module import path to document.
(MkDocs) The site display name. Defaults to module name.
Display name for the MkDocs site.
(MkDocs) Target directory for Markdown sources.
Directory where Markdown documentation sources +will be generated.
(MkDocs) Path to the docforge.nav.yml specification.
Path to the navigation specification file.
(MkDocs) Optional custom mkdocs.yml template.
Optional custom MkDocs configuration template.
(MkDocs) Target path for the generated mkdocs.yml.
Output path for the generated MkDocs configuration.
(MCP) Target directory for MCP JSON resources.
Output directory for generated MCP resources.
Raises:
UsageError
If required options are missing or conflicting.
serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None -
serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None +
Serve documentation (MkDocs or MCP).
Serve generated documentation locally.
Depending on the selected mode, this command starts either:
Serve MCP resources via an MCP server.
Serve documentation using the MCP server.
Serve the MkDocs site using the built-in development server.
Serve the MkDocs development site.
The dotted path of the module to serve.
Python module import path to serve via MCP.
(MkDocs) Path to the mkdocs.yml configuration.
Path to the MkDocs configuration file.
(MCP) Path to the mcp_docs/ directory.
Root directory containing MCP documentation resources.
If invalid or conflicting options are provided.
tree(module: str, project_name: Optional[str]) -> None -
tree(module: str, project_name: Optional[str]) -> None +
Visualize the project structure in the terminal.
Display the documentation object tree for a module.
This command introspects the specified module and prints a +hierarchical representation of the discovered documentation +objects, including modules, classes, functions, and members.
The module import path to recursively introspect.
Python module import path to introspect.
Optional override for the project name shown at the root.
Optional name to display as the project root.
The docforge.cli package provides the command-line interface for interacting -with doc-forge.
docforge.cli
Command line interface entry point for doc-forge.
This module exposes the primary CLI entry function used by the +doc-forge command. The actual command implementation resides in +docforge.cli.main, while this module provides a stable import path +for external tools and the package entry point configuration.
doc-forge
docforge.cli.main
The CLI is responsible for orchestrating documentation workflows such as +generating renderer sources, building documentation sites, exporting +machine-readable documentation bundles, and starting development or MCP +servers.
The CLI is normally invoked through the installed command:
doc-forge <command> [options] +
Programmatic invocation is also possible:
1 +2
from docforge.cli import main +main() +
Main entry point for the doc-forge CLI. This module delegates all command -execution to docforge.cli.commands.
Command-line entry point for the doc-forge CLI.
This module exposes the executable entry point that initializes the +Click command group defined in docforge.cli.commands.
docforge.cli.commands
main() -> None -
main() -> None +
CLI Entry point. Boots the click application.
Run the doc-forge command-line interface.
This function initializes and executes the Click CLI application. +It is used as the console entry point when invoking doc-forge +from the command line.
generate_resources(module: str, project_name: str | None, out_dir: Path) -> None -
generate_resources(module: str, project_name: str | None, out_dir: Path) -> None +
Generate MCP-compatible documentation resources.
Generate MCP documentation resources from a Python module.
The function performs project introspection, builds the internal +documentation model, and renders MCP-compatible JSON resources +to the specified output directory.
The dotted path of the primary module to document.
Python module import path used as the entry point for +documentation generation.
Optional override for the project name.
Optional override for the project name used in +generated documentation metadata.
Directory where the MCP JSON resources and nav will be written.
Directory where MCP resources (index.json, nav.json, +and module data) will be written.
serve(module: str, mcp_root: Path) -> None -
serve(module: str, mcp_root: Path) -> None +
Serve MCP documentation from a pre-built bundle.
Start an MCP server for a pre-generated documentation bundle.
The server exposes documentation resources such as project metadata, +navigation structure, and module documentation through MCP endpoints.
The dotted path of the primary module to serve.
Python module import path used to identify the served +documentation instance.
Path to the directory containing index.json, nav.json, and modules/.
Path to the directory containing the MCP documentation +bundle (index.json, nav.json, and modules/).
ClickException
If the MCP documentation bundle is missing +required files or directories.
build(mkdocs_yml: Path) -> None -
build(mkdocs_yml: Path) -> None +
Build the documentation site using MkDocs.
Build the MkDocs documentation site.
This function loads the MkDocs configuration and runs the MkDocs +build command to generate the final static documentation site.
Path to the mkdocs.yml configuration file.
mkdocs.yml
If the configuration file does not exist.
generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None -
generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None +
Generate an mkdocs.yml configuration file.
The configuration is created by combining a template configuration +with a navigation structure derived from the docforge navigation +specification.
Path to the directory containing documentation Markdown files.
Directory containing generated documentation Markdown files.
Path to the docforge.nav.yml specification.
Path to the docforge.nav.yml navigation specification.
docforge.nav.yml
Optional path to an mkdocs.yml template (overrides built-in).
Optional path to a custom MkDocs configuration template. +If not provided, a built-in template will be used.
Path where the final mkdocs.yml will be written.
Destination path where the generated mkdocs.yml file +will be written.
The display name for the documentation site.
Display name for the generated documentation site.
FileError
If the navigation specification or template +file cannot be found.
generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None -
generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None +
Generate Markdown source files for the specified module.
Generate MkDocs Markdown sources for a Python module.
This function introspects the specified module, builds the internal +documentation model, and renders Markdown documentation files for +use with MkDocs.
project_name
str | None
None
docs_dir
Optional override for the project name used in +documentation metadata.
module_is_source
If True, treat the specified module directory as +the project root rather than a nested module.
serve(mkdocs_yml: Path) -> None -
serve(mkdocs_yml: Path) -> None +
Serve the documentation site with live-reload using MkDocs.
Start an MkDocs development server with live reload.
The server watches documentation files and automatically reloads +the site when changes are detected.
doc-forge is a renderer-agnostic Python documentation compiler designed for -speed, flexibility, and beautiful output. It decouples the introspection of -your code from the rendering process, allowing you to generate documentation -for various platforms (starting with MkDocs) from a single internal models.
doc-forge operates on two fundamental principles:
mypackage.utils
doc-forge is an "AI-Native" documentation compiler. To get the most out of it, design your docstrings with both humans and LLMs in mind:
__init__.py
Renderer-agnostic Python documentation compiler that converts Python docstrings +into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
doc-forge statically analyzes source code, builds a semantic model of modules, +classes, functions, and attributes, and renders that model into documentation +outputs without executing user code.
Install using pip with the optional mkdocs dependencies for a complete setup:
pip
mkdocs
pip install doc-forge -
Build Documentation: - Introspect your package and generate documentation in one step: - ```bash - # Build MkDocs site - doc-forge build --mkdocs --module my_package --site-name "My Docs"
doc-forge build --mcp --module my_package -```
Define Navigation: - Create a docforge.nav.yml to organize your documentation: - yaml - home: my_package/index.md - groups: - Core API: - - my_package/core/*.md - Utilities: - - my_package/utils.md
yaml - home: my_package/index.md - groups: - Core API: - - my_package/core/*.md - Utilities: - - my_package/utils.md
Preview: - ```bash - # Serve MkDocs site - doc-forge serve --mkdocs
doc-forge serve --mcp -```
Install using pip:
pip install doc-forge +
Generate a MkDocs site from a Python package:
doc-forge build --mkdocs --module my_package +
Generate MCP JSON documentation:
doc-forge build --mcp --module my_package +
Serve documentation locally:
doc-forge serve --mkdocs --module my_package +
Loader
Extracts symbols, signatures, and docstrings using static analysis.
Semantic model
Structured, renderer-agnostic representation of the API.
Renderer
Converts the semantic model into output formats such as MkDocs or MCP JSON.
Symbol
Any documentable object:
1 +2 +3 +4 +5 +6
- module +- class +- function +- method +- property +- attribute +
doc-forge follows a compiler architecture:
Front-end:
Static analysis of modules, classes, functions, type hints, and docstrings. +
Middle-end:
Builds a semantic model describing symbols and relationships. +
Back-end:
Renders documentation using interchangeable renderers. +
This architecture ensures deterministic documentation generation.
Typical flow:
1 +2 +3 +4 +5 +6 +7 +8 +9
Python package + ↓ +Loader (static analysis) + ↓ +Semantic model + ↓ +Renderer + ↓ +MkDocs site or MCP JSON +
Build MkDocs documentation:
Build MCP documentation:
Serve MkDocs locally:
doc-forge serve --module my_package +
Loaders:
GriffeLoader +discover_module_paths +
Renderers:
MkDocsRenderer +MCPRenderer +
CLI:
main +
Models:
models +
GSDFC defines how docstrings must be written so they render correctly in MkDocs and remain machine-parsable by doc-forge and AI tooling.
docforge.loaders
griffe
docforge.models
docforge.renderers
docforge.nav
---
Recommended sections:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10
## Summary +## Installation +## Quick start +## Core concepts +## Architecture +## Rendering pipeline +## CLI usage +## Public API +## Examples +## Notes +
Package Doc String:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28 +29 +30 +31 +32
''' +Foo-bar processing framework. + +Provides tools for defining Foo objects and executing Bar pipelines. + +--- + +# Installation + + pip install foo-bar + +--- + +# Quick start + + from foobar import Foo, BarEngine + + foo = Foo("example") + engine = BarEngine([foo]) + + result = engine.run() + +--- + +# Public API + + Foo + Bar + BarEngine + +--- +''' +
1 +2 +3 +4
## Summary +## Examples +## Notes +## Public API +
Module Doc String:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19
''' +Foo execution subsystem. + +Provides utilities for executing Foo objects through Bar stages. + +--- + +Example: + + from foobar.engine import BarEngine + from foobar.foo import Foo + + foo = Foo("example") + + engine = BarEngine([foo]) + engine.run() + +--- +''' +
Attributes: +Notes: +Example: +Raises: +
Simple Foo:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27
class Foo: + ''' + Represents a unit of work. + + Attributes: + name (str): + Identifier of the foo instance. + + value (int): + Numeric value associated with foo. + + Notes: + Guarantees: + + - instances are immutable after creation + + Lifecycle: + + - create instance + - pass to processing engine + + Example: + Create and inspect a Foo: + + foo = Foo("example", value=42) + print(foo.name) + ''' +
Complex Bar:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22
class BarEngine: + ''' + Executes Foo objects through Bar stages. + + Attributes: + foos (tuple[Foo, ...]): + Foo instances managed by the engine. + + Notes: + Guarantees: + + - deterministic execution order + + Example: + Run engine: + + foo1 = Foo("a") + foo2 = Foo("b") + + engine = BarEngine([foo1, foo2]) + engine.run() + ''' +
Args: +Returns: +Raises: +Yields: +Notes: +Example: +
Simple process method:
def process(foo: Foo, multiplier: int) -> int: + ''' + Process a Foo instance. + + Args: + foo (Foo): + Foo instance to process. + + multiplier (int): + Value used to scale foo. + + Returns: + int: + Processed result. + + Raises: + ValueError: + If multiplier is negative. + + Notes: + Guarantees: + + - foo is not modified + + Example: + Process foo: + + foo = Foo("example", value=10) + + result = process(foo, multiplier=2) + print(result) + ''' +
Multiple Examples:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +21 +22 +23 +24 +25 +26 +27 +28
def combine(foo_a: Foo, foo_b: Foo) -> Foo: + ''' + Combine two Foo instances. + + Args: + foo_a (Foo): + First foo. + + foo_b (Foo): + Second foo. + + Returns: + Foo: + Combined foo. + + Example: + Basic usage: + + foo1 = Foo("a") + foo2 = Foo("b") + + combined = combine(foo1, foo2) + + Pipeline usage: + + engine = BarEngine([foo1, foo2]) + engine.run() + ''' +
Property Doc String:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13 +14
@property +def foos(self) -> tuple[Foo, ...]: + ''' + Return contained Foo instances. + + Returns: + tuple[Foo, ...]: + Stored foo objects. + + Example: + container = FooContainer() + + foos = container.foos + ''' +
Attribute Doc String:
''' +Represents a processing stage. + +Attributes: + id (str): + Unique identifier. + + enabled (bool): + Whether the stage is active. +''' +
Notes Example:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 +13
Notes: + **Guarantees:** + + - deterministic behavior + + **Lifecycle:** + + - created during initialization + - reused across executions + + **Thread safety:** + + - safe for concurrent reads +
Single example:
Example: + + foo = Foo("example") + process(foo, multiplier=2) +
Multiple examples:
Example: + Create foo: + + foo = Foo("example") + + Run engine: + + engine = BarEngine([foo]) + engine.run() +
Avoid fenced code blocks inside structured sections.
Use horizontal separators only at docstring root level to separate sections:
--- +
Allowed locations:
Do not use separators inside code sections.
GSDFC ensures doc-forge can deterministically extract:
This enables:
GriffeLoader() -
GriffeLoader() +
Loads Python modules and extracts documentation using the Griffe introspection engine.
Load Python modules using Griffe and convert them into doc-forge models.
This loader uses the Griffe introspection engine to analyze Python source +code and transform the extracted information into Project, Module, +and DocObject instances used by doc-forge.
Project
Module
DocObject
Initialize the GriffeLoader.
Initialize the Griffe-backed loader.
Creates an internal Griffe loader instance with dedicated collections +for modules and source lines.
load_module(path: str) -> Module -
load_module(path: str) -> Module +
Load a single module and convert its introspection data into the docforge models.
Load and convert a single Python module.
The module is introspected using Griffe and then transformed into +a doc-forge Module model.
The dotted path of the module to load.
Dotted import path of the module.
A Module instance.
A populated Module instance.
load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project -
load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project +
Load multiple modules and combine them into a single Project models.
Load multiple modules and assemble them into a Project model.
Each module path is introspected and converted into a Module +instance. All modules are then aggregated into a single Project +object.
A list of dotted paths to the modules to load.
List of dotted module import paths to load.
Optional name for the project. Defaults to the first module name.
Optional override for the project name. Defaults +to the top-level name of the first module.
If True, modules that fail to import will be skipped.
If True, modules that fail to load will be +skipped instead of raising an error.
A Project instance containing the loaded modules.
A populated Project instance containing the loaded modules.
ValueError
If no module paths are provided.
ImportError
If a module fails to load and +skip_import_errors is False.
skip_import_errors
Renderer that emits MCP-native JSON resources from docforge models.
Renderer that generates MCP-compatible documentation resources.
This renderer converts doc-forge project models into structured JSON +resources suitable for consumption by systems implementing the Model +Context Protocol (MCP).
generate_sources(project: Project, out_dir: Path) -> None -
generate_sources(project: Project, out_dir: Path) -> None +
Generate MCP-compatible JSON resources and navigation for the project.
Generate MCP documentation resources for a project.
The renderer serializes each module into a JSON resource and produces +supporting metadata files such as nav.json and index.json.
nav.json
index.json
The project model to render.
Documentation project model to render.
Target directory for the generated JSON files.
Directory where MCP resources will be written.
Renderer that generates Markdown source files formatted for the MkDocs -'mkdocstrings' plugin.
Renderer that produces Markdown documentation for MkDocs.
Generated pages use mkdocstrings directives to reference Python modules, +allowing MkDocs to render API documentation dynamically.
generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None -
generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None +
Produce a set of Markdown files in the output directory based on the -provided Project models.
Generate a README.md file from the root module docstring.
README.md
Behavior:
The project models to render.
Project model containing documentation metadata.
out_dir
Path
Target directory for documentation files.
Directory containing generated documentation sources.
Whether the module is treated as the project +source root.
generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None +
Generate Markdown documentation files for a project.
This method renders a documentation structure from the provided +project model and writes the resulting Markdown files to the +specified output directory.
project
Project model containing modules to document.
Directory where generated Markdown files will be written.
bool | None
If True, treat the specified module as the +documentation root rather than nesting it inside a folder.
discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] -
discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str] +
Discover all Python modules under a package via filesystem traversal.
Rules: -- Directory with init.py is treated as a package. -- Any .py file is treated as a module. -- All paths are converted to dotted module paths.
Discover Python modules within a package directory.
The function scans the filesystem for .py files inside the specified +package and converts them into dotted module import paths.
.py
Discovery rules:
The name of the package to discover.
Top-level package name to discover modules from.
The root directory of the project. Defaults to current working directory.
Root directory used to resolve module paths. If not +provided, the current working directory is used.
A sorted list of dotted module paths.
A sorted list of unique dotted module import paths.
FileNotFoundError
If the specified package directory does not exist.
This module provides the GriffeLoader, which uses the 'griffe' library to -introspect Python source code and populate the doc-forge Project models.
Utilities for loading and introspecting Python modules using Griffe.
This module provides the GriffeLoader class and helper utilities used to +discover Python modules, introspect their structure, and convert the results +into doc-forge documentation models.
GriffeLoader
The docforge.loaders package is responsible for discovering Python source files -and extracting their documentation using static analysis.
Loader layer for doc-forge.
The docforge.loaders package is responsible for discovering Python modules +and extracting documentation data using static analysis.
This layer converts Python source code into an intermediate documentation +model used by doc-forge. It performs module discovery, introspection, and +initial filtering before the data is passed to the core documentation models.
Core capabilities include:
_
The docforge.models package provides the core data structures used to represent -Python source code in a documentation-focused hierarchy.
Model layer for doc-forge.
The docforge.models package defines the core data structures used to +represent Python source code as a structured documentation model.
The model layer forms the central intermediate representation used throughout +doc-forge. Python modules and objects discovered during introspection are +converted into a hierarchy of documentation models that can later be rendered +into different documentation formats.
Key components:
These classes are designed to be renderer-agnostic, allowing the same internal -representation to be transformed into various output formats (currently MkDocs).
These models are intentionally renderer-agnostic, allowing the same +documentation structure to be transformed into multiple output formats +(e.g., MkDocs, MCP, or other renderers).
DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) -
DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None) +
Represents a documented Python object (class, function, method, etc.).
Representation of a documented Python object.
A DocObject models a single Python entity discovered during +introspection. Objects may contain nested members, allowing the structure +of modules, classes, and other containers to be represented recursively.
Attributes:
Type of object (e.g., 'class', 'function', 'attribute').
Type of object (for example class, function, +method, or attribute).
class
function
method
attribute
Full dotted import path to the object.
Fully qualified dotted path to the object.
Callable signature, if applicable.
Callable signature if the object represents a callable.
Raw docstring content extracted from the source.
Raw docstring text extracted from the source code.
Dictionary mapping member names to their DocObject representations.
Mapping of member names to child DocObject instances.
Initialize a new DocObject.
Initialize a DocObject instance.
The local name of the object.
Local name of the object.
The kind of object (e.g., 'class', 'function').
Object type identifier (for example class or function).
The full dotted path to the object.
Fully qualified dotted path of the object.
The object's signature (for callable objects).
Callable signature if applicable.
The object's docstring, if any.
Documentation string associated with the object.
add_member(obj: DocObject) -> None -
add_member(obj: DocObject) -> None +
Add a child member to this object (e.g., a method to a class).
Add a child documentation object.
This is typically used when attaching methods to classes or +nested objects to their parent containers.
The child DocObject to add.
Documentation object to add as a member.
get_all_members() -> Iterable[DocObject] -
get_all_members() -> Iterable[DocObject] +
Get all members of this object.
Return all child members of the object.
Returns:
An iterable of child DocObject instances.
An iterable of DocObject instances representing nested members.
get_member(name: str) -> DocObject -
get_member(name: str) -> DocObject +
Retrieve a child member by name.
Retrieve a member object by name.
The name of the member.
Name of the member to retrieve.
The requested DocObject.
The corresponding DocObject instance.
KeyError
If the member does not exist.
Module(path: str, docstring: Optional[str] = None) -
Module(path: str, docstring: Optional[str] = None) +
Represents a documented Python module or package.
Representation of a documented Python module or package.
A Module stores metadata about the module itself and maintains a +collection of top-level documentation objects discovered during +introspection.
Module-level docstring content.
Module-level documentation string, if present.
Dictionary mapping object names to their DocObject representations.
Mapping of object names to their corresponding +DocObject representations.
Initialize a new Module.
Initialize a Module instance.
The dotted path of the module.
Dotted import path identifying the module.
The module's docstring, if any.
Module-level documentation text, if available.
add_object(obj: DocObject) -> None -
add_object(obj: DocObject) -> None +
The object to add.
Documentation object to register as a top-level +member of the module.
get_all_objects() -> Iterable[DocObject] -
get_all_objects() -> Iterable[DocObject] +
Get all top-level objects in the module.
Return all top-level documentation objects in the module.
An iterable of DocObject instances.
An iterable of DocObject instances representing the
Iterable[DocObject]
module's public members.
get_object(name: str) -> DocObject -
get_object(name: str) -> DocObject +
Retrieve a documented object by name.
The name of the object.
Name of the object to retrieve.
If no object with the given name exists.
Project(name: str) -
Project(name: str) +
Represents a documentation project, serving as a container for modules.
Representation of a documentation project.
A Project serves as the root container for all modules discovered during +introspection. Each module is stored by its dotted import path.
Dictionary mapping module paths to Module instances.
Mapping of module paths to Module instances.
Initialize a new Project.
Initialize a Project instance.
The name of the project.
Name used to identify the documentation project.
add_module(module: Module) -> None -
add_module(module: Module) -> None +
Add a module to the project.
Register a module in the project.
The module to add.
Module instance to add to the project.
get_all_modules() -> Iterable[Module] -
get_all_modules() -> Iterable[Module] +
Get all modules in the project.
Return all modules contained in the project.
An iterable of Module objects.
An iterable of Module instances.
get_module(path: str) -> Module -
get_module(path: str) -> Module +
The dotted path of the module (e.g., 'pkg.mod').
Fully qualified dotted module path (for example pkg.module).
pkg.module
The requested Module.
The corresponding Module instance.
If the module does not exist in the project.
get_module_list() -> list[str] -
get_module_list() -> list[str] +
Get the list of all module dotted paths.
Return the list of module import paths.
A list of module paths.
A list containing the dotted paths of all modules in the project.
This module defines the Module class, which represents a Python module or package -in the doc-forge documentation models. It acts as a container for top-level -documented objects.
Documentation model representing a Python module or package.
This module defines the Module class used in the doc-forge documentation +model. A Module acts as a container for top-level documented objects +(classes, functions, variables, and other members) discovered during +introspection.
This module defines the DocObject class, the fundamental recursive unit of the -doc-forge documentation models. A DocObject represents a single Python entity -(class, function, method, or attribute) and its nested members.
Documentation model representing individual Python objects.
This module defines the DocObject class, the fundamental recursive unit of +the doc-forge documentation model. Each DocObject represents a Python +entity such as a class, function, method, or attribute, and may contain nested +members that form a hierarchical documentation structure.
This module defines the Project class, the top-level container for a documented -project. It aggregates multiple Module instances into a single named entity.
Documentation model representing a project.
This module defines the Project class, the top-level container used by +doc-forge to represent a documented codebase. A Project aggregates multiple +modules and provides access to them through a unified interface.
The docforge.nav package manages the mapping between the logical documentation -structure and the physical files on disk.
Navigation layer for doc-forge.
The docforge.nav package manages the relationship between the logical +documentation structure defined by the user and the physical documentation +files generated on disk.
resolve_nav
.md
MkDocsNavEmitter
This abstraction allows doc-forge to support complex grouping and ordering -independently of the source code's physical layout.
This layer separates documentation organization from the underlying source +code layout, enabling flexible grouping, ordering, and navigation structures +independent of module hierarchy.
Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible -navigation structure.
Emit MkDocs navigation structures from resolved navigation data.
The emitter transforms a ResolvedNav object into the YAML-compatible +list structure expected by the MkDocs nav configuration field.
ResolvedNav
nav
emit(nav: ResolvedNav) -> List[Dict[str, Any]] -
emit(nav: ResolvedNav) -> List[Dict[str, Any]] +
Generate a list of navigation entries for mkdocs.yml.
Generate a navigation structure for mkdocs.yml.
The resolved navigation data.
Resolved navigation data describing documentation groups +and their associated Markdown files.
A list of dictionary mappings representing the MkDocs navigation.
A list of dictionaries representing the MkDocs navigation layout.
List[Dict[str, Any]]
Each dictionary maps a navigation label to a page or a list of
pages.
NavSpec(home: Optional[str], groups: Dict[str, List[str]]) -
NavSpec(home: Optional[str], groups: Dict[str, List[str]]) +
Parsed representation of the docforge navigation specification file.
Parsed representation of a navigation specification.
A NavSpec describes the intended documentation navigation layout before +it is resolved against the filesystem.
NavSpec
Path to the home document (e.g., 'index.md').
Relative path to the documentation home page (for example +index.md).
index.md
Mapping of group titles to lists of path patterns/globs.
Mapping of navigation group titles to lists of file patterns +or glob expressions.
Initialize a NavSpec.
Initialize a NavSpec instance.
The path to the home document.
Relative path to the home document.
A mapping of group names to lists of path patterns (globs).
Mapping of group names to lists of path patterns +(glob expressions).
all_patterns() -> List[str] -
all_patterns() -> List[str] +
Get all path patterns referenced in the specification.
Return all path patterns referenced by the specification.
A list of all patterns (home plus all groups).
A list containing the home document (if defined) and all
List[str]
group pattern entries.
classmethod
load(path: Path) -> NavSpec -
load(path: Path) -> NavSpec +
Load a NavSpec from a YAML file.
Load a navigation specification from a YAML file.
The filesystem path to the YAML file.
Filesystem path to the navigation specification file.
A NavSpec instance.
A NavSpec instance representing the parsed configuration.
If the path does not exist.
If the specified file does not exist.
If the file content is not a valid NavSpec mapping.
If the file contents are not a valid navigation +specification.
ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) -
ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None) +
Represents a navigation structure where all patterns and paths have been -resolved against the actual filesystem contents.
Resolved navigation structure.
A ResolvedNav represents navigation data after glob patterns have been +expanded and paths validated against the filesystem.
Resolved relative path to the home page.
Relative path to the documentation home page.
Mapping of group titles to lists of absolute or relative Path objects.
Mapping of navigation group titles to lists of resolved +documentation file paths.
The relative path to the project home page.
Relative path to the home page within the documentation root.
A mapping of group names to their resolved filesystem paths.
Mapping of group titles to resolved documentation file paths.
The root documentation directory.
Root directory of the documentation source files.
all_files() -> Iterable[Path] -
all_files() -> Iterable[Path] +
Get an iterable of all resolved files in the navigation structure.
Iterate over all files referenced by the navigation structure.
An iterable of Path objects.
An iterable of Path objects representing documentation files.
RuntimeError
If the home page is defined but the documentation +root is not available for resolution.
load_nav_spec(path: Path) -> NavSpec -
load_nav_spec(path: Path) -> NavSpec +
Utility function to load a NavSpec from a file.
Load a navigation specification file.
This helper function reads a YAML navigation file and constructs a +corresponding NavSpec instance.
A loaded NavSpec instance.
A NavSpec instance representing the parsed specification.
If the specification file does not exist.
If the YAML structure is invalid.
resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav -
resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav +
Create a ResolvedNav by processing a NavSpec against the filesystem. -This expands globs and validates the existence of referenced files.
Resolve a navigation specification against the filesystem.
The function expands glob patterns defined in a NavSpec and verifies +that referenced documentation files exist within the documentation root.
The navigation specification to resolve.
Navigation specification describing documentation layout.
The root directory for documentation files.
Root directory containing documentation Markdown files.
A ResolvedNav instance.
A ResolvedNav instance containing validated navigation paths.
If a pattern doesn't match any files or the docs_root doesn't exist.
If the documentation root does not exist or a +navigation pattern does not match any files.
This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance -into the specific YAML-ready list structure expected by the MkDocs 'nav' -configuration.
MkDocs navigation emitter.
This module provides the MkDocsNavEmitter class, which converts a +ResolvedNav instance into the navigation structure required by the +MkDocs nav configuration.
This module contains the logic for resolving a NavSpec against the physical -filesystem. It expands globs and validates that all referenced documents -actually exist on disk.
Navigation resolution utilities.
This module resolves a NavSpec against the filesystem by expanding glob +patterns and validating that referenced documentation files exist.
This module defines the NavSpec class, which represents the user's intent for -documentation navigation as defined in a YAML specification (usually -docforge.nav.yml).
Navigation specification model.
This module defines the NavSpec class, which represents the navigation +structure defined by the user in the doc-forge navigation specification +(typically docforge.nav.yml).
This module defines the base interfaces and configuration containers for -doc-forge renderers. All renderer implementations should adhere to the -DocRenderer protocol.
Renderer base interfaces and configuration models.
This module defines the base protocol and configuration container used by +doc-forge renderers. Concrete renderer implementations should implement the +DocRenderer protocol.
DocRenderer
Protocol defining the interface for documentation renderers.
Implementations of this protocol are responsible for transforming a +Project model into renderer-specific documentation sources.
Generate renderer-specific source files for the given project.
Generate renderer-specific documentation sources.
The project models containing modules and objects.
Project model containing modules and documentation objects.
Target directory for the generated files.
Directory where generated documentation sources +should be written.
RendererConfig(out_dir: Path, project: Project) -
RendererConfig(out_dir: Path, project: Project) +
Configuration container for documentation renderers.
A RendererConfig instance groups together the project model and the +output directory used during rendering.
RendererConfig
Directory where generated documentation files will be written.
Documentation project model to be rendered.
Initialize a RendererConfig instance.
The directory where documentation files should be written.
Target directory where documentation files should be written.
The introspected project models to be rendered.
Introspected project model to render.
The docforge.renderers package handles the transformation of the internal -documentation models into physical files formatted for specific documentation -engines.
Renderers layer for doc-forge.
The docforge.renderers package transforms the internal documentation +models into files formatted for specific documentation systems.
Renderers consume the doc-forge project model and generate output suitable +for documentation tools or machine interfaces.
Current implementations:
mkdocstrings
To add a new renderer, implement the DocRenderer protocol defined in -docforge.renderers.base.
docforge.renderers.base
New renderers can be added by implementing the DocRenderer protocol +defined in docforge.renderers.base.
MkDocsRenderer
Generates Markdown source files compatible with MkDocs Material -and mkdocstrings, ensuring:
MkDocs renderer implementation.
This module defines the MkDocsRenderer class, which generates Markdown +documentation sources compatible with MkDocs Material and the mkdocstrings +plugin.
The renderer ensures a consistent documentation structure by:
doc-forge is a renderer-agnostic Python documentation compiler designed for speed, flexibility, and beautiful output. It decouples the introspection of your code from the rendering process, allowing you to generate documentation for various platforms (starting with MkDocs) from a single internal models.
doc-forge is an \"AI-Native\" documentation compiler. To get the most out of it, design your docstrings with both humans and LLMs in mind:
pip install doc-forge\n
Build Documentation: Introspect your package and generate documentation in one step: ```bash # Build MkDocs site doc-forge build --mkdocs --module my_package --site-name \"My Docs\"
Define Navigation: Create a docforge.nav.yml to organize your documentation: yaml home: my_package/index.md groups: Core API: - my_package/core/*.md Utilities: - my_package/utils.md
yaml home: my_package/index.md groups: Core API: - my_package/core/*.md Utilities: - my_package/utils.md
Preview: ```bash # Serve MkDocs site doc-forge serve --mkdocs
doc-forge build --mcp --module my_package ```
doc-forge serve --mcp ```
GriffeLoader()\n
load_module(path: str) -> Module\n
path
str
load_project(module_paths: List[str], project_name: Optional[str] = None, skip_import_errors: bool = None) -> Project\n
module_paths
Optional[str]
bool
generate_sources(project: Project, out_dir: Path) -> None\n
Renderer that generates Markdown source files formatted for the MkDocs 'mkdocstrings' plugin.
generate_sources(project: Project, out_dir: Path, module_is_source: bool | None = None) -> None\n
Produce a set of Markdown files in the output directory based on the provided Project models.
discover_module_paths(module_name: str, project_root: Path | None = None) -> List[str]\n
Rules: - Directory with init.py is treated as a package. - Any .py file is treated as a module. - All paths are converted to dotted module paths.
module_name
project_root
Path | None
The docforge.cli package provides the command-line interface for interacting with doc-forge.
build(mcp: bool, mkdocs: bool, module_is_source: bool, module: Optional[str], project_name: Optional[str], site_name: Optional[str], docs_dir: Path, nav_file: Path, template: Optional[Path], mkdocs_yml: Path, out_dir: Path) -> None\n
This command orchestrates the full build process: 1. Introspects the code (Griffe) 2. Renders sources (MkDocs Markdown or MCP JSON) 3. (MkDocs only) Generates config and runs the final site build.
mcp
module
site_name
nav_file
template
Optional[Path]
mkdocs_yml
serve(mcp: bool, mkdocs: bool, module: Optional[str], mkdocs_yml: Path, out_dir: Path) -> None\n
tree(module: str, project_name: Optional[str]) -> None\n
Main entry point for the doc-forge CLI. This module delegates all command execution to docforge.cli.commands.
main() -> None\n
generate_resources(module: str, project_name: str | None, out_dir: Path) -> None\n
serve(module: str, mcp_root: Path) -> None\n
mcp_root
build(mkdocs_yml: Path) -> None\n
generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None\n
out
generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None\n
Directory where the generated Markdown files will be written.
serve(mkdocs_yml: Path) -> None\n
The docforge.loaders package is responsible for discovering Python source files and extracting their documentation using static analysis.
This module provides the GriffeLoader, which uses the 'griffe' library to introspect Python source code and populate the doc-forge Project models.
The docforge.models package provides the core data structures used to represent Python source code in a documentation-focused hierarchy.
These classes are designed to be renderer-agnostic, allowing the same internal representation to be transformed into various output formats (currently MkDocs).
DocObject(name: str, kind: str, path: str, signature: Optional[str] = None, docstring: Optional[str] = None)\n
name
kind
signature
docstring
members
Dict[str, DocObject]
add_member(obj: DocObject) -> None\n
obj
get_all_members() -> Iterable[DocObject]\n
get_member(name: str) -> DocObject\n
Module(path: str, docstring: Optional[str] = None)\n
add_object(obj: DocObject) -> None\n
Add a documented object to the module.
get_all_objects() -> Iterable[DocObject]\n
get_object(name: str) -> DocObject\n
Project(name: str)\n
Name of the project.
modules
Dict[str, Module]
add_module(module: Module) -> None\n
get_all_modules() -> Iterable[Module]\n
Iterable[Module]
get_module(path: str) -> Module\n
Retrieve a module by its dotted path.
get_module_list() -> list[str]\n
list[str]
This module defines the Module class, which represents a Python module or package in the doc-forge documentation models. It acts as a container for top-level documented objects.
This module defines the DocObject class, the fundamental recursive unit of the doc-forge documentation models. A DocObject represents a single Python entity (class, function, method, or attribute) and its nested members.
This module defines the Project class, the top-level container for a documented project. It aggregates multiple Module instances into a single named entity.
The docforge.nav package manages the mapping between the logical documentation structure and the physical files on disk.
This abstraction allows doc-forge to support complex grouping and ordering independently of the source code's physical layout.
Emitter responsible for transforming a ResolvedNav into an MkDocs-compatible navigation structure.
emit(nav: ResolvedNav) -> List[Dict[str, Any]]\n
NavSpec(home: Optional[str], groups: Dict[str, List[str]])\n
home
groups
Dict[str, List[str]]
all_patterns() -> List[str]\n
load(path: Path) -> NavSpec\n
ResolvedNav(home: str | None, groups: Dict[str, List[Path]], docs_root: Path | None = None)\n
Represents a navigation structure where all patterns and paths have been resolved against the actual filesystem contents.
Dict[str, List[Path]]
Initialize a ResolvedNav instance.
docs_root
all_files() -> Iterable[Path]\n
Iterable[Path]
load_nav_spec(path: Path) -> NavSpec\n
resolve_nav(spec: NavSpec, docs_root: Path) -> ResolvedNav\n
Create a ResolvedNav by processing a NavSpec against the filesystem. This expands globs and validates the existence of referenced files.
spec
This module provides the MkDocsNavEmitter, which converts a ResolvedNav instance into the specific YAML-ready list structure expected by the MkDocs 'nav' configuration.
This module contains the logic for resolving a NavSpec against the physical filesystem. It expands globs and validates that all referenced documents actually exist on disk.
This module defines the NavSpec class, which represents the user's intent for documentation navigation as defined in a YAML specification (usually docforge.nav.yml).
The docforge.renderers package handles the transformation of the internal documentation models into physical files formatted for specific documentation engines.
To add a new renderer, implement the DocRenderer protocol defined in docforge.renderers.base.
This module defines the base interfaces and configuration containers for doc-forge renderers. All renderer implementations should adhere to the DocRenderer protocol.
Bases: Protocol
Protocol
RendererConfig(out_dir: Path, project: Project)\n
Generates Markdown source files compatible with MkDocs Material and mkdocstrings, ensuring:
MCPServer(mcp_root: Path, name: str)\n
MCP server for serving a pre-built MCP documentation bundle.
Initialize the MCPServer.
Path to the directory containing pre-built MCP JSON resources.
Name of the MCP server.
run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None\n
Start the MCP server.
transport
Literal['stdio', 'sse', 'streamable-http']
MCP transport (default: streamable-http)
'streamable-http'
Renderer-agnostic Python documentation compiler that converts Python docstrings into structured documentation for both humans (MkDocs) and machines (MCP / AI agents).
doc-forge statically analyzes source code, builds a semantic model of modules, classes, functions, and attributes, and renders that model into documentation outputs without executing user code.
doc-forge build --mkdocs --module my_package\n
doc-forge build --mcp --module my_package\n
doc-forge serve --mkdocs --module my_package\n
- module\n- class\n- function\n- method\n- property\n- attribute\n
Static analysis of modules, classes, functions, type hints, and docstrings.\n
Builds a semantic model describing symbols and relationships.\n
Renders documentation using interchangeable renderers.\n
Python package\n \u2193\nLoader (static analysis)\n \u2193\nSemantic model\n \u2193\nRenderer\n \u2193\nMkDocs site or MCP JSON\n
doc-forge serve --module my_package\n
GriffeLoader\ndiscover_module_paths\n
MkDocsRenderer\nMCPRenderer\n
main\n
models\n
## Summary\n## Installation\n## Quick start\n## Core concepts\n## Architecture\n## Rendering pipeline\n## CLI usage\n## Public API\n## Examples\n## Notes\n
'''\nFoo-bar processing framework.\n\nProvides tools for defining Foo objects and executing Bar pipelines.\n\n---\n\n# Installation\n\n pip install foo-bar\n\n---\n\n# Quick start\n\n from foobar import Foo, BarEngine\n\n foo = Foo(\"example\")\n engine = BarEngine([foo])\n\n result = engine.run()\n\n---\n\n# Public API\n\n Foo\n Bar\n BarEngine\n\n---\n'''\n
## Summary\n## Examples\n## Notes\n## Public API\n
'''\nFoo execution subsystem.\n\nProvides utilities for executing Foo objects through Bar stages.\n\n---\n\nExample:\n\n from foobar.engine import BarEngine\n from foobar.foo import Foo\n\n foo = Foo(\"example\")\n\n engine = BarEngine([foo])\n engine.run()\n\n---\n'''\n
Attributes:\nNotes:\nExample:\nRaises:\n
class Foo:\n '''\n Represents a unit of work.\n\n Attributes:\n name (str):\n Identifier of the foo instance.\n\n value (int):\n Numeric value associated with foo.\n\n Notes:\n Guarantees:\n\n - instances are immutable after creation\n\n Lifecycle:\n\n - create instance\n - pass to processing engine\n\n Example:\n Create and inspect a Foo:\n\n foo = Foo(\"example\", value=42)\n print(foo.name)\n '''\n
class BarEngine:\n '''\n Executes Foo objects through Bar stages.\n\n Attributes:\n foos (tuple[Foo, ...]):\n Foo instances managed by the engine.\n\n Notes:\n Guarantees:\n\n - deterministic execution order\n\n Example:\n Run engine:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n
Args:\nReturns:\nRaises:\nYields:\nNotes:\nExample:\n
def process(foo: Foo, multiplier: int) -> int:\n '''\n Process a Foo instance.\n\n Args:\n foo (Foo):\n Foo instance to process.\n\n multiplier (int):\n Value used to scale foo.\n\n Returns:\n int:\n Processed result.\n\n Raises:\n ValueError:\n If multiplier is negative.\n\n Notes:\n Guarantees:\n\n - foo is not modified\n\n Example:\n Process foo:\n\n foo = Foo(\"example\", value=10)\n\n result = process(foo, multiplier=2)\n print(result)\n '''\n
def combine(foo_a: Foo, foo_b: Foo) -> Foo:\n '''\n Combine two Foo instances.\n\n Args:\n foo_a (Foo):\n First foo.\n\n foo_b (Foo):\n Second foo.\n\n Returns:\n Foo:\n Combined foo.\n\n Example:\n Basic usage:\n\n foo1 = Foo(\"a\")\n foo2 = Foo(\"b\")\n\n combined = combine(foo1, foo2)\n\n Pipeline usage:\n\n engine = BarEngine([foo1, foo2])\n engine.run()\n '''\n
@property\ndef foos(self) -> tuple[Foo, ...]:\n '''\n Return contained Foo instances.\n\n Returns:\n tuple[Foo, ...]:\n Stored foo objects.\n\n Example:\n container = FooContainer()\n\n foos = container.foos\n '''\n
'''\nRepresents a processing stage.\n\nAttributes:\n id (str):\n Unique identifier.\n\n enabled (bool):\n Whether the stage is active.\n'''\n
Notes:\n **Guarantees:**\n\n - deterministic behavior\n\n **Lifecycle:**\n\n - created during initialization\n - reused across executions\n\n **Thread safety:**\n\n - safe for concurrent reads\n
Example:\n\n foo = Foo(\"example\")\n process(foo, multiplier=2)\n
Example:\n Create foo:\n\n foo = Foo(\"example\")\n\n Run engine:\n\n engine = BarEngine([foo])\n engine.run()\n
---\n
This loader uses the Griffe introspection engine to analyze Python source code and transform the extracted information into Project, Module, and DocObject instances used by doc-forge.
Creates an internal Griffe loader instance with dedicated collections for modules and source lines.
The module is introspected using Griffe and then transformed into a doc-forge Module model.
Each module path is introspected and converted into a Module instance. All modules are then aggregated into a single Project object.
Optional override for the project name. Defaults to the top-level name of the first module.
If True, modules that fail to load will be skipped instead of raising an error.
If a module fails to load and skip_import_errors is False.
This renderer converts doc-forge project models into structured JSON resources suitable for consumption by systems implementing the Model Context Protocol (MCP).
The renderer serializes each module into a JSON resource and produces supporting metadata files such as nav.json and index.json.
Generated pages use mkdocstrings directives to reference Python modules, allowing MkDocs to render API documentation dynamically.
generate_readme(project: Project, docs_dir: Path, module_is_source: bool | None = None) -> None\n
Whether the module is treated as the project source root.
This method renders a documentation structure from the provided project model and writes the resulting Markdown files to the specified output directory.
If True, treat the specified module as the documentation root rather than nesting it inside a folder.
The function scans the filesystem for .py files inside the specified package and converts them into dotted module import paths.
Root directory used to resolve module paths. If not provided, the current working directory is used.
This module exposes the primary CLI entry function used by the doc-forge command. The actual command implementation resides in docforge.cli.main, while this module provides a stable import path for external tools and the package entry point configuration.
The CLI is responsible for orchestrating documentation workflows such as generating renderer sources, building documentation sites, exporting machine-readable documentation bundles, and starting development or MCP servers.
doc-forge <command> [options]\n
from docforge.cli import main\nmain()\n
Treat the specified module directory as the project root.
Directory where Markdown documentation sources will be generated.
This command introspects the specified module and prints a hierarchical representation of the discovered documentation objects, including modules, classes, functions, and members.
This module exposes the executable entry point that initializes the Click command group defined in docforge.cli.commands.
This function initializes and executes the Click CLI application. It is used as the console entry point when invoking doc-forge from the command line.
The function performs project introspection, builds the internal documentation model, and renders MCP-compatible JSON resources to the specified output directory.
Python module import path used as the entry point for documentation generation.
Optional override for the project name used in generated documentation metadata.
Directory where MCP resources (index.json, nav.json, and module data) will be written.
The server exposes documentation resources such as project metadata, navigation structure, and module documentation through MCP endpoints.
Python module import path used to identify the served documentation instance.
Path to the directory containing the MCP documentation bundle (index.json, nav.json, and modules/).
If the MCP documentation bundle is missing required files or directories.
This function loads the MkDocs configuration and runs the MkDocs build command to generate the final static documentation site.
The configuration is created by combining a template configuration with a navigation structure derived from the docforge navigation specification.
Optional path to a custom MkDocs configuration template. If not provided, a built-in template will be used.
Destination path where the generated mkdocs.yml file will be written.
If the navigation specification or template file cannot be found.
This function introspects the specified module, builds the internal documentation model, and renders Markdown documentation files for use with MkDocs.
Optional override for the project name used in documentation metadata.
If True, treat the specified module directory as the project root rather than a nested module.
The server watches documentation files and automatically reloads the site when changes are detected.
The docforge.loaders package is responsible for discovering Python modules and extracting documentation data using static analysis.
This layer converts Python source code into an intermediate documentation model used by doc-forge. It performs module discovery, introspection, and initial filtering before the data is passed to the core documentation models.
This module provides the GriffeLoader class and helper utilities used to discover Python modules, introspect their structure, and convert the results into doc-forge documentation models.
The docforge.models package defines the core data structures used to represent Python source code as a structured documentation model.
The model layer forms the central intermediate representation used throughout doc-forge. Python modules and objects discovered during introspection are converted into a hierarchy of documentation models that can later be rendered into different documentation formats.
These models are intentionally renderer-agnostic, allowing the same documentation structure to be transformed into multiple output formats (e.g., MkDocs, MCP, or other renderers).
A DocObject models a single Python entity discovered during introspection. Objects may contain nested members, allowing the structure of modules, classes, and other containers to be represented recursively.
Type of object (for example class, function, method, or attribute).
This is typically used when attaching methods to classes or nested objects to their parent containers.
A Module stores metadata about the module itself and maintains a collection of top-level documentation objects discovered during introspection.
Mapping of object names to their corresponding DocObject representations.
Documentation object to register as a top-level member of the module.
A Project serves as the root container for all modules discovered during introspection. Each module is stored by its dotted import path.
This module defines the Module class used in the doc-forge documentation model. A Module acts as a container for top-level documented objects (classes, functions, variables, and other members) discovered during introspection.
This module defines the DocObject class, the fundamental recursive unit of the doc-forge documentation model. Each DocObject represents a Python entity such as a class, function, method, or attribute, and may contain nested members that form a hierarchical documentation structure.
This module defines the Project class, the top-level container used by doc-forge to represent a documented codebase. A Project aggregates multiple modules and provides access to them through a unified interface.
The docforge.nav package manages the relationship between the logical documentation structure defined by the user and the physical documentation files generated on disk.
This layer separates documentation organization from the underlying source code layout, enabling flexible grouping, ordering, and navigation structures independent of module hierarchy.
The emitter transforms a ResolvedNav object into the YAML-compatible list structure expected by the MkDocs nav configuration field.
Resolved navigation data describing documentation groups and their associated Markdown files.
A NavSpec describes the intended documentation navigation layout before it is resolved against the filesystem.
Relative path to the documentation home page (for example index.md).
Mapping of navigation group titles to lists of file patterns or glob expressions.
Mapping of group names to lists of path patterns (glob expressions).
If the file contents are not a valid navigation specification.
A ResolvedNav represents navigation data after glob patterns have been expanded and paths validated against the filesystem.
Mapping of navigation group titles to lists of resolved documentation file paths.
If the home page is defined but the documentation root is not available for resolution.
This helper function reads a YAML navigation file and constructs a corresponding NavSpec instance.
The function expands glob patterns defined in a NavSpec and verifies that referenced documentation files exist within the documentation root.
If the documentation root does not exist or a navigation pattern does not match any files.
This module provides the MkDocsNavEmitter class, which converts a ResolvedNav instance into the navigation structure required by the MkDocs nav configuration.
This module resolves a NavSpec against the filesystem by expanding glob patterns and validating that referenced documentation files exist.
This module defines the NavSpec class, which represents the navigation structure defined by the user in the doc-forge navigation specification (typically docforge.nav.yml).
The docforge.renderers package transforms the internal documentation models into files formatted for specific documentation systems.
Renderers consume the doc-forge project model and generate output suitable for documentation tools or machine interfaces.
New renderers can be added by implementing the DocRenderer protocol defined in docforge.renderers.base.
This module defines the base protocol and configuration container used by doc-forge renderers. Concrete renderer implementations should implement the DocRenderer protocol.
Implementations of this protocol are responsible for transforming a Project model into renderer-specific documentation sources.
Directory where generated documentation sources should be written.
A RendererConfig instance groups together the project model and the output directory used during rendering.
This module defines the MkDocsRenderer class, which generates Markdown documentation sources compatible with MkDocs Material and the mkdocstrings plugin.
Server layer for doc-forge.
This module exposes server implementations used to provide live access to generated documentation resources. Currently, it includes the MCP documentation server.
MCP server for serving a pre-generated documentation bundle.
The server exposes documentation resources and diagnostic tools through MCP endpoints backed by JSON files generated by the MCP renderer.
Initialize the MCP server.
Directory containing the generated MCP documentation bundle (for example index.json, nav.json, and modules/).
modules/
Identifier used for the MCP server instance.
Transport mechanism used by the MCP server. Supported options include stdio, sse, and streamable-http.
stdio
sse
streamable-http
This module exposes server implementations used to provide live access +to generated documentation resources. Currently, it includes the MCP +documentation server.
MCPServer(mcp_root: Path, name: str) -
MCPServer(mcp_root: Path, name: str) +
The server exposes documentation resources and diagnostic tools through +MCP endpoints backed by JSON files generated by the MCP renderer.
Directory containing the generated MCP documentation +bundle (for example index.json, nav.json, and +modules/).
run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None -
run(transport: Literal['stdio', 'sse', 'streamable-http'] = 'streamable-http') -> None +
Transport mechanism used by the MCP server. Supported +options include stdio, sse, and streamable-http.