nav submodule

This commit is contained in:
2026-01-20 21:22:28 +05:30
parent 869b1730c4
commit 726e7ca6d2
12 changed files with 493 additions and 0 deletions

37
tests/nav/test_mkdocs.py Normal file
View File

@@ -0,0 +1,37 @@
from pathlib import Path
from docforge.nav import ResolvedNav
from docforge.nav import MkDocsNavEmitter
def test_emit_mkdocs_nav():
nav = ResolvedNav(
home="openapi_first/index.md",
groups={
"Core": [
Path("openapi_first/app.md"),
Path("openapi_first/client.md"),
],
"CLI": [
Path("openapi_first/cli.md"),
],
},
)
emitter = MkDocsNavEmitter()
mkdocs_nav = emitter.emit(nav)
assert mkdocs_nav == [
{"Home": "openapi_first/index.md"},
{
"Core": [
{"App": "openapi_first/app.md"},
{"Client": "openapi_first/client.md"},
]
},
{
"CLI": [
{"Cli": "openapi_first/cli.md"},
]
},
]