Improve documentation look & feel via MkDocs Material template enhancements (#5)
# 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>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"module": "docforge.models.project",
|
||||
"content": {
|
||||
"path": "docforge.models.project",
|
||||
"docstring": "This module defines the Project class, the top-level container for a documented\nproject. It aggregates multiple Module instances into a single named entity.",
|
||||
"docstring": "Documentation model representing a project.\n\nThis module defines the ``Project`` class, the top-level container used by\ndoc-forge to represent a documented codebase. A ``Project`` aggregates multiple\nmodules and provides access to them through a unified interface.",
|
||||
"objects": {
|
||||
"Dict": {
|
||||
"name": "Dict",
|
||||
@@ -23,7 +23,7 @@
|
||||
"kind": "class",
|
||||
"path": "docforge.models.project.Module",
|
||||
"signature": "<bound method Alias.signature of Alias('Module', 'docforge.models.module.Module')>",
|
||||
"docstring": "Represents a documented Python module or package.\n\nAttributes:\n path: Dotted import path of the module.\n docstring: Module-level docstring content.\n members: Dictionary mapping object names to their DocObject representations.",
|
||||
"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",
|
||||
@@ -51,21 +51,21 @@
|
||||
"kind": "function",
|
||||
"path": "docforge.models.project.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: The object to add."
|
||||
"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.project.Module.get_object",
|
||||
"signature": "<bound method Alias.signature of Alias('get_object', 'docforge.models.module.Module.get_object')>",
|
||||
"docstring": "Retrieve a member object by name.\n\nArgs:\n name: The name of the object.\n\nReturns:\n The requested DocObject."
|
||||
"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.project.Module.get_all_objects",
|
||||
"signature": "<bound method Alias.signature of Alias('get_all_objects', 'docforge.models.module.Module.get_all_objects')>",
|
||||
"docstring": "Get all top-level objects in the module.\n\nReturns:\n An iterable of DocObject instances."
|
||||
"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."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -73,8 +73,8 @@
|
||||
"name": "Project",
|
||||
"kind": "class",
|
||||
"path": "docforge.models.project.Project",
|
||||
"signature": "<bound method Class.signature of Class('Project', 11, 67)>",
|
||||
"docstring": "Represents a documentation project, serving as a container for modules.\n\nAttributes:\n name: Name of the project.\n modules: Dictionary mapping module paths to Module instances.",
|
||||
"signature": "<bound method Class.signature of Class('Project', 14, 76)>",
|
||||
"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",
|
||||
@@ -94,29 +94,29 @@
|
||||
"name": "add_module",
|
||||
"kind": "function",
|
||||
"path": "docforge.models.project.Project.add_module",
|
||||
"signature": "<bound method Function.signature of Function('add_module', 30, 37)>",
|
||||
"docstring": "Add a module to the project.\n\nArgs:\n module: The module to add."
|
||||
"signature": "<bound method Function.signature of Function('add_module', 36, 43)>",
|
||||
"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.models.project.Project.get_module",
|
||||
"signature": "<bound method Function.signature of Function('get_module', 39, 49)>",
|
||||
"docstring": "Retrieve a module by its dotted path.\n\nArgs:\n path: The dotted path of the module (e.g., 'pkg.mod').\n\nReturns:\n The requested Module."
|
||||
"signature": "<bound method Function.signature of Function('get_module', 45, 58)>",
|
||||
"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.models.project.Project.get_all_modules",
|
||||
"signature": "<bound method Function.signature of Function('get_all_modules', 51, 58)>",
|
||||
"docstring": "Get all modules in the project.\n\nReturns:\n An iterable of Module objects."
|
||||
"signature": "<bound method Function.signature of Function('get_all_modules', 60, 67)>",
|
||||
"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.models.project.Project.get_module_list",
|
||||
"signature": "<bound method Function.signature of Function('get_module_list', 60, 67)>",
|
||||
"docstring": "Get the list of all module dotted paths.\n\nReturns:\n A list of module paths."
|
||||
"signature": "<bound method Function.signature of Function('get_module_list', 69, 76)>",
|
||||
"docstring": "Return the list of module import paths.\n\nReturns:\n A list containing the dotted paths of all modules in the project."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user