# 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>
153 lines
8.2 KiB
JSON
153 lines
8.2 KiB
JSON
{
|
|
"module": "docforge.models.module",
|
|
"content": {
|
|
"path": "docforge.models.module",
|
|
"docstring": "Documentation model representing a Python module or package.\n\nThis module defines the ``Module`` class used in the doc-forge documentation\nmodel. A ``Module`` acts as a container for top-level documented objects\n(classes, functions, variables, and other members) discovered during\nintrospection.",
|
|
"objects": {
|
|
"Dict": {
|
|
"name": "Dict",
|
|
"kind": "alias",
|
|
"path": "docforge.models.module.Dict",
|
|
"signature": "<bound method Alias.signature of Alias('Dict', 'typing.Dict')>",
|
|
"docstring": null
|
|
},
|
|
"Iterable": {
|
|
"name": "Iterable",
|
|
"kind": "alias",
|
|
"path": "docforge.models.module.Iterable",
|
|
"signature": "<bound method Alias.signature of Alias('Iterable', 'typing.Iterable')>",
|
|
"docstring": null
|
|
},
|
|
"Optional": {
|
|
"name": "Optional",
|
|
"kind": "alias",
|
|
"path": "docforge.models.module.Optional",
|
|
"signature": "<bound method Alias.signature of Alias('Optional', 'typing.Optional')>",
|
|
"docstring": null
|
|
},
|
|
"DocObject": {
|
|
"name": "DocObject",
|
|
"kind": "class",
|
|
"path": "docforge.models.module.DocObject",
|
|
"signature": "<bound method Alias.signature of Alias('DocObject', 'docforge.models.object.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.models.module.DocObject.name",
|
|
"signature": "<bound method Alias.signature of Alias('name', 'docforge.models.object.DocObject.name')>",
|
|
"docstring": null
|
|
},
|
|
"kind": {
|
|
"name": "kind",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.DocObject.kind",
|
|
"signature": "<bound method Alias.signature of Alias('kind', 'docforge.models.object.DocObject.kind')>",
|
|
"docstring": null
|
|
},
|
|
"path": {
|
|
"name": "path",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.DocObject.path",
|
|
"signature": "<bound method Alias.signature of Alias('path', 'docforge.models.object.DocObject.path')>",
|
|
"docstring": null
|
|
},
|
|
"signature": {
|
|
"name": "signature",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.DocObject.signature",
|
|
"signature": "<bound method Alias.signature of Alias('signature', 'docforge.models.object.DocObject.signature')>",
|
|
"docstring": null
|
|
},
|
|
"docstring": {
|
|
"name": "docstring",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.DocObject.docstring",
|
|
"signature": "<bound method Alias.signature of Alias('docstring', 'docforge.models.object.DocObject.docstring')>",
|
|
"docstring": null
|
|
},
|
|
"members": {
|
|
"name": "members",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.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.models.module.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.models.module.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.models.module.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."
|
|
}
|
|
}
|
|
},
|
|
"Module": {
|
|
"name": "Module",
|
|
"kind": "class",
|
|
"path": "docforge.models.module.Module",
|
|
"signature": "<bound method Class.signature of Class('Module', 15, 79)>",
|
|
"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.models.module.Module.path",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"docstring": {
|
|
"name": "docstring",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.Module.docstring",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"members": {
|
|
"name": "members",
|
|
"kind": "attribute",
|
|
"path": "docforge.models.module.Module.members",
|
|
"signature": null,
|
|
"docstring": null
|
|
},
|
|
"add_object": {
|
|
"name": "add_object",
|
|
"kind": "function",
|
|
"path": "docforge.models.module.Module.add_object",
|
|
"signature": "<bound method Function.signature of Function('add_object', 46, 54)>",
|
|
"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.models.module.Module.get_object",
|
|
"signature": "<bound method Function.signature of Function('get_object', 56, 69)>",
|
|
"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.models.module.Module.get_all_objects",
|
|
"signature": "<bound method Function.signature of Function('get_all_objects', 71, 79)>",
|
|
"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."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |