# Improve documentation look & feel via MkDocs Material template enhancements ## Summary This MR improves the overall **documentation experience and visual presentation** of the doc-forge docs by enhancing the MkDocs Material template configuration. The changes focus on **navigation usability, code readability, and richer Markdown rendering**, resulting in a cleaner and more professional documentation site. Docstring changes were made across the codebase for consistency, but this MR description focuses on the **template and presentation improvements**. --- ## Navigation Improvements The navigation system has been enhanced to provide a clearer structure and better discoverability. Key improvements include: * Section-aware navigation in the sidebar * Automatic expansion of module/package hierarchy * Scroll tracking within the sidebar * Clickable package index pages Material navigation features added: * `navigation.sections` * `navigation.expand` * `navigation.tracking` * `navigation.indexes` This results in a **single cohesive navigation tree** that exposes the entire documentation hierarchy from the sidebar. --- ## Code Block Improvements Code blocks previously appeared relatively plain. The template now enables richer syntax highlighting and improved readability. Enhancements include: * Syntax highlighting using `pymdownx.highlight` * Line numbers for code blocks * Anchored line numbers for deep linking * Improved fenced code block rendering Additional Material features: * `content.code.copy` — copy button for code blocks * `content.code.annotate` — support for code annotations These changes significantly improve the readability of examples and API snippets throughout the documentation. --- ## Markdown Rendering Enhancements Additional Markdown extensions were enabled to support richer documentation features: * `pymdownx.superfences` for advanced fenced blocks * `pymdownx.inlinehilite` for inline code highlighting * `pymdownx.snippets` for reusable snippets * `admonition` and `pymdownx.details` for callouts and collapsible sections * `pymdownx.tabbed` for tabbed content blocks * `pymdownx.tasklist` for checklist-style items * `tables`, `footnotes`, and advanced formatting extensions These extensions make it easier to write expressive and structured documentation. --- ## Search Experience The documentation search experience has been improved using Material search features: * `search.highlight` * `search.share` * `search.suggest` These enhancements provide: * highlighted search matches * sharable search URLs * auto-suggestions while typing --- ## mkdocstrings Improvements The mkdocstrings configuration has been expanded to produce clearer API documentation. Notable improvements include: * grouping objects by category * explicit category headings * improved symbol headings * cleaner object path display This results in more structured API documentation pages. --- ## Result Overall, these changes provide: * cleaner and more intuitive navigation * significantly improved code presentation * richer Markdown capabilities * better search usability The documentation now has a **more polished, modern appearance** and improved usability for both readers and contributors. Reviewed-on: #5 Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com> Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
315 lines
22 KiB
JSON
315 lines
22 KiB
JSON
{
|
||
"module": "docforge.loaders",
|
||
"content": {
|
||
"path": "docforge.loaders",
|
||
"docstring": "Loader layer for doc-forge.\n\nThe ``docforge.loaders`` package is responsible for discovering Python modules\nand extracting documentation data using static analysis.\n\n---\n\nOverview\n--------\n\nThis layer converts Python source code into an intermediate documentation\nmodel used by doc-forge. It performs module discovery, introspection, and\ninitial filtering before the data is passed to the core documentation models.\n\nCore capabilities include:\n\n- **Module discovery** – Locate Python modules and packages within a project.\n- **Static introspection** – Parse docstrings, signatures, and object\n hierarchies using the ``griffe`` library without executing the code.\n- **Public API filtering** – Exclude private members (names prefixed with\n ``_``) to produce clean public documentation structures.\n\n---",
|
||
"objects": {
|
||
"GriffeLoader": {
|
||
"name": "GriffeLoader",
|
||
"kind": "class",
|
||
"path": "docforge.loaders.GriffeLoader",
|
||
"signature": "<bound method Alias.signature of Alias('GriffeLoader', 'docforge.loaders.griffe_loader.GriffeLoader')>",
|
||
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.",
|
||
"members": {
|
||
"load_project": {
|
||
"name": "load_project",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.GriffeLoader.load_project",
|
||
"signature": "<bound method Alias.signature of Alias('load_project', 'docforge.loaders.griffe_loader.GriffeLoader.load_project')>",
|
||
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False."
|
||
},
|
||
"load_module": {
|
||
"name": "load_module",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.GriffeLoader.load_module",
|
||
"signature": "<bound method Alias.signature of Alias('load_module', 'docforge.loaders.griffe_loader.GriffeLoader.load_module')>",
|
||
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance."
|
||
}
|
||
}
|
||
},
|
||
"discover_module_paths": {
|
||
"name": "discover_module_paths",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.discover_module_paths",
|
||
"signature": "<bound method Alias.signature of Alias('discover_module_paths', 'docforge.loaders.griffe_loader.discover_module_paths')>",
|
||
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist."
|
||
},
|
||
"griffe_loader": {
|
||
"name": "griffe_loader",
|
||
"kind": "module",
|
||
"path": "docforge.loaders.griffe_loader",
|
||
"signature": null,
|
||
"docstring": "Utilities for loading and introspecting Python modules using Griffe.\n\nThis module provides the ``GriffeLoader`` class and helper utilities used to\ndiscover Python modules, introspect their structure, and convert the results\ninto doc-forge documentation models.",
|
||
"members": {
|
||
"logging": {
|
||
"name": "logging",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.logging",
|
||
"signature": "<bound method Alias.signature of Alias('logging', 'logging')>",
|
||
"docstring": null
|
||
},
|
||
"Path": {
|
||
"name": "Path",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.Path",
|
||
"signature": "<bound method Alias.signature of Alias('Path', 'pathlib.Path')>",
|
||
"docstring": null
|
||
},
|
||
"List": {
|
||
"name": "List",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.List",
|
||
"signature": "<bound method Alias.signature of Alias('List', 'typing.List')>",
|
||
"docstring": null
|
||
},
|
||
"Optional": {
|
||
"name": "Optional",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.Optional",
|
||
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
||
"docstring": null
|
||
},
|
||
"ModulesCollection": {
|
||
"name": "ModulesCollection",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.ModulesCollection",
|
||
"signature": "<bound method Alias.signature of Alias('ModulesCollection', 'griffe.ModulesCollection')>",
|
||
"docstring": null
|
||
},
|
||
"LinesCollection": {
|
||
"name": "LinesCollection",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.LinesCollection",
|
||
"signature": "<bound method Alias.signature of Alias('LinesCollection', 'griffe.LinesCollection')>",
|
||
"docstring": null
|
||
},
|
||
"Object": {
|
||
"name": "Object",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.Object",
|
||
"signature": "<bound method Alias.signature of Alias('Object', 'griffe.Object')>",
|
||
"docstring": null
|
||
},
|
||
"AliasResolutionError": {
|
||
"name": "AliasResolutionError",
|
||
"kind": "alias",
|
||
"path": "docforge.loaders.griffe_loader.AliasResolutionError",
|
||
"signature": "<bound method Alias.signature of Alias('AliasResolutionError', 'griffe.AliasResolutionError')>",
|
||
"docstring": null
|
||
},
|
||
"Module": {
|
||
"name": "Module",
|
||
"kind": "class",
|
||
"path": "docforge.loaders.griffe_loader.Module",
|
||
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.Module')>",
|
||
"docstring": "Representation of a documented Python module or package.\n\nA ``Module`` stores metadata about the module itself and maintains a\ncollection of top-level documentation objects discovered during\nintrospection.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level documentation string, if present.\n members: Mapping of object names to their corresponding\n ``DocObject`` representations.",
|
||
"members": {
|
||
"path": {
|
||
"name": "path",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.Module.path",
|
||
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.module.Module.path')>",
|
||
"docstring": null
|
||
},
|
||
"docstring": {
|
||
"name": "docstring",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.Module.docstring",
|
||
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.module.Module.docstring')>",
|
||
"docstring": null
|
||
},
|
||
"members": {
|
||
"name": "members",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.Module.members",
|
||
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.module.Module.members')>",
|
||
"docstring": null
|
||
},
|
||
"add_object": {
|
||
"name": "add_object",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Module.add_object",
|
||
"signature": "<bound method Alias.signature of Alias('add_object', 'docforge.models.module.Module.add_object')>",
|
||
"docstring": "Add a documented object to the module.\n\nArgs:\n obj: Documentation object to register as a top-level\n member of the module."
|
||
},
|
||
"get_object": {
|
||
"name": "get_object",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Module.get_object",
|
||
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||
"docstring": "Retrieve a documented object by name.\n\nArgs:\n name: Name of the object to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If no object with the given name exists."
|
||
},
|
||
"get_all_objects": {
|
||
"name": "get_all_objects",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Module.get_all_objects",
|
||
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||
"docstring": "Return all top-level documentation objects in the module.\n\nReturns:\n An iterable of ``DocObject`` instances representing the\n module's public members."
|
||
}
|
||
}
|
||
},
|
||
"Project": {
|
||
"name": "Project",
|
||
"kind": "class",
|
||
"path": "docforge.loaders.griffe_loader.Project",
|
||
"signature": "<bound method Alias.signature of Alias('Project', 'docforge.models.Project')>",
|
||
"docstring": "Representation of a documentation project.\n\nA ``Project`` serves as the root container for all modules discovered during\nintrospection. Each module is stored by its dotted import path.\n\nAttributes:\n name: Name of the project.\n modules: Mapping of module paths to ``Module`` instances.",
|
||
"members": {
|
||
"name": {
|
||
"name": "name",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.Project.name",
|
||
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.project.Project.name')>",
|
||
"docstring": null
|
||
},
|
||
"modules": {
|
||
"name": "modules",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.Project.modules",
|
||
"signature": "<bound method Alias.signature of Alias('modules', 'docforge.models.project.Project.modules')>",
|
||
"docstring": null
|
||
},
|
||
"add_module": {
|
||
"name": "add_module",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Project.add_module",
|
||
"signature": "<bound method Alias.signature of Alias('add_module', 'docforge.models.project.Project.add_module')>",
|
||
"docstring": "Register a module in the project.\n\nArgs:\n module: Module instance to add to the project."
|
||
},
|
||
"get_module": {
|
||
"name": "get_module",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Project.get_module",
|
||
"signature": "<bound method Alias.signature of Alias('get_module', 'docforge.models.project.Project.get_module')>",
|
||
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: Fully qualified dotted module path (for example ``pkg.module``).\n\nReturns:\n The corresponding ``Module`` instance.\n\nRaises:\n KeyError: If the module does not exist in the project."
|
||
},
|
||
"get_all_modules": {
|
||
"name": "get_all_modules",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Project.get_all_modules",
|
||
"signature": "<bound method Alias.signature of Alias('get_all_modules', 'docforge.models.project.Project.get_all_modules')>",
|
||
"docstring": "Return all modules contained in the project.\n\nReturns:\n An iterable of ``Module`` instances."
|
||
},
|
||
"get_module_list": {
|
||
"name": "get_module_list",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.Project.get_module_list",
|
||
"signature": "<bound method Alias.signature of Alias('get_module_list', 'docforge.models.project.Project.get_module_list')>",
|
||
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project."
|
||
}
|
||
}
|
||
},
|
||
"DocObject": {
|
||
"name": "DocObject",
|
||
"kind": "class",
|
||
"path": "docforge.loaders.griffe_loader.DocObject",
|
||
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.DocObject')>",
|
||
"docstring": "Representation of a documented Python object.\n\nA ``DocObject`` models a single Python entity discovered during\nintrospection. Objects may contain nested members, allowing the structure\nof modules, classes, and other containers to be represented recursively.\n\nAttributes:\n name: Local name of the object.\n kind: Type of object (for example ``class``, ``function``,\n ``method``, or ``attribute``).\n path: Fully qualified dotted path to the object.\n signature: Callable signature if the object represents a callable.\n docstring: Raw docstring text extracted from the source code.\n members: Mapping of member names to child ``DocObject`` instances.",
|
||
"members": {
|
||
"name": {
|
||
"name": "name",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.name",
|
||
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
||
"docstring": null
|
||
},
|
||
"kind": {
|
||
"name": "kind",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.kind",
|
||
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
||
"docstring": null
|
||
},
|
||
"path": {
|
||
"name": "path",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.path",
|
||
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
||
"docstring": null
|
||
},
|
||
"signature": {
|
||
"name": "signature",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.signature",
|
||
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
||
"docstring": null
|
||
},
|
||
"docstring": {
|
||
"name": "docstring",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.docstring",
|
||
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
||
"docstring": null
|
||
},
|
||
"members": {
|
||
"name": "members",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.members",
|
||
"signature": "<bound method Alias.signature of Alias('members', 'docforge.models.object.DocObject.members')>",
|
||
"docstring": null
|
||
},
|
||
"add_member": {
|
||
"name": "add_member",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.add_member",
|
||
"signature": "<bound method Alias.signature of Alias('add_member', 'docforge.models.object.DocObject.add_member')>",
|
||
"docstring": "Add a child documentation object.\n\nThis is typically used when attaching methods to classes or\nnested objects to their parent containers.\n\nArgs:\n obj: Documentation object to add as a member."
|
||
},
|
||
"get_member": {
|
||
"name": "get_member",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.get_member",
|
||
"signature": "<bound method Alias.signature of Alias('get_member', 'docforge.models.object.DocObject.get_member')>",
|
||
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: Name of the member to retrieve.\n\nReturns:\n The corresponding ``DocObject`` instance.\n\nRaises:\n KeyError: If the member does not exist."
|
||
},
|
||
"get_all_members": {
|
||
"name": "get_all_members",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.DocObject.get_all_members",
|
||
"signature": "<bound method Alias.signature of Alias('get_all_members', 'docforge.models.object.DocObject.get_all_members')>",
|
||
"docstring": "Return all child members of the object.\n\nReturns:\n An iterable of ``DocObject`` instances representing nested members."
|
||
}
|
||
}
|
||
},
|
||
"logger": {
|
||
"name": "logger",
|
||
"kind": "attribute",
|
||
"path": "docforge.loaders.griffe_loader.logger",
|
||
"signature": null,
|
||
"docstring": null
|
||
},
|
||
"discover_module_paths": {
|
||
"name": "discover_module_paths",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.discover_module_paths",
|
||
"signature": "<bound method Function.signature of Function('discover_module_paths', 26, 73)>",
|
||
"docstring": "Discover Python modules within a package directory.\n\nThe function scans the filesystem for ``.py`` files inside the specified\npackage and converts them into dotted module import paths.\n\nDiscovery rules:\n\n- Directories containing ``__init__.py`` are treated as packages.\n- Each ``.py`` file is treated as a module.\n- Results are returned as dotted import paths.\n\nArgs:\n module_name: Top-level package name to discover modules from.\n project_root: Root directory used to resolve module paths. If not\n provided, the current working directory is used.\n\nReturns:\n A sorted list of unique dotted module import paths.\n\nRaises:\n FileNotFoundError: If the specified package directory does not exist."
|
||
},
|
||
"GriffeLoader": {
|
||
"name": "GriffeLoader",
|
||
"kind": "class",
|
||
"path": "docforge.loaders.griffe_loader.GriffeLoader",
|
||
"signature": "<bound method Class.signature of Class('GriffeLoader', 76, 264)>",
|
||
"docstring": "Load Python modules using Griffe and convert them into doc-forge models.\n\nThis loader uses the Griffe introspection engine to analyze Python source\ncode and transform the extracted information into ``Project``, ``Module``,\nand ``DocObject`` instances used by doc-forge.",
|
||
"members": {
|
||
"load_project": {
|
||
"name": "load_project",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_project",
|
||
"signature": "<bound method Function.signature of Function('load_project', 97, 144)>",
|
||
"docstring": "Load multiple modules and assemble them into a Project model.\n\nEach module path is introspected and converted into a ``Module``\ninstance. All modules are then aggregated into a single ``Project``\nobject.\n\nArgs:\n module_paths: List of dotted module import paths to load.\n project_name: Optional override for the project name. Defaults\n to the top-level name of the first module.\n skip_import_errors: If True, modules that fail to load will be\n skipped instead of raising an error.\n\nReturns:\n A populated ``Project`` instance containing the loaded modules.\n\nRaises:\n ValueError: If no module paths are provided.\n ImportError: If a module fails to load and\n ``skip_import_errors`` is False."
|
||
},
|
||
"load_module": {
|
||
"name": "load_module",
|
||
"kind": "function",
|
||
"path": "docforge.loaders.griffe_loader.GriffeLoader.load_module",
|
||
"signature": "<bound method Function.signature of Function('load_module', 146, 162)>",
|
||
"docstring": "Load and convert a single Python module.\n\nThe module is introspected using Griffe and then transformed into\na doc-forge ``Module`` model.\n\nArgs:\n path: Dotted import path of the module.\n\nReturns:\n A populated ``Module`` instance."
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
} |