An MkDocs plugin that simplifies configuring page titles and their order through .pages configuration files
Build a helper that turns a docs directory containing distributed navigation definition files into the final MkDocs navigation YAML. The helper must delegate navigation resolution to the navigation plugin dependency rather than reimplementing path discovery or ordering logic.
.nav.yml at the root and inside guides/, where the root file lists index.md, guides/, and api/ while the nested file orders quickstart.md, then a section Deep Dive containing deep/overview.md and deep/api.md, generating navigation YAML returns:
- Home: index.md
- Guides:
- Quickstart: guides/quickstart.md
- Deep Dive:
- Overview: guides/deep/overview.md
- API: guides/deep/api.md
- API Reference: api/index.mdtutorials/ that contains intro.md and advanced/index.md but no .nav.yml, the generated YAML still includes that section using default ordering and derived titles:
- Tutorials:
- intro.md
- advanced/index.mdnav_filename="awesome_nav.yml" and the docs tree contains that file name instead of .nav.yml, the generated navigation YAML follows that file and ignores absent default names. @testguides/**/*.md pulls in matching pages after any explicit items, skips entries marked hidden in the nav file, and avoids duplicating pages that were already explicitly listed. @test@generates
from pathlib import Path
def generate_navigation_yaml(docs_dir: Path, nav_filename: str = ".nav.yml") -> str:
"""Return a YAML string representing the resolved navigation for the docs directory."""Builds MkDocs navigation from distributed navigation definition files.
Site generator used to resolve documentation navigation.
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