An MkDocs plugin that simplifies configuring page titles and their order through .pages configuration files
Build a small utility that uses the navigation plugin to compute the final MkDocs nav for a docs directory while leveraging automatic flattening of single-child sections and appending of otherwise unmatched files.
.nav.yml disables flattening, that directory remains a section even if it has only one visible page, while the root flattening still applies elsewhere. @testEnable flattening and automatic appending at the root by default, allow overrides via root_config, and rely on the plugin to resolve .nav.yml files instead of rebuilding the rules by hand.
@generates
from pathlib import Path
from typing import Any
def build_nav(docs_dir: Path, root_config: dict[str, Any] | None = None) -> list[dict[str, Any]]:
"""
Build the final MkDocs nav for the given docs directory using the navigation plugin,
honoring flatten-single-child behavior and automatic appending of unmatched files, with root
defaults that turn both behaviors on unless explicitly overridden by root_config.
Returns the nav structure as a list of dictionaries mirroring MkDocs config.
"""Rebuilds MkDocs navigation from per-directory nav files, including flattening and automatic append behaviors.
tessl i tessl/pypi-mkdocs-awesome-pages-plugin@2.10.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10