Wiki
docforge.nav.wiki
Summary
Wiki navigation derivation.
This module provides build_wiki_nav, which derives an MkDocs-ready
navigation block from the file structure of a hand-written wiki directory
(typically docs/wiki). wiki content is authored by hand and is never
modified by doc-forge; only the navigation layout is inferred.
Notes
index.mdat the wiki root becomes theHomeentry.- Page labels are derived from filenames: numeric order prefixes such as
01_or02-are stripped, separators are replaced with spaces, and names are title-cased (01_overview.mdbecomesOverview). - Subdirectories become nested navigation groups. A nested
index.mdis rendered as the section root placed first inside the group. - Only
.mdfiles are considered; hidden entries are ignored.
Functions
build_wiki_nav
Derive an MkDocs navigation block from a wiki directory.
Returned paths are relative to the parent of wiki_dir and carry the
wiki directory name as their leading component (for example
wiki/01_overview.md when the wiki lives at docs/wiki). This makes
the result directly usable in an MkDocs nav block with
index.mdat the wiki root becomes theHomeentry.- Page labels are derived from filenames: numeric order prefixes such as
01_or02-are stripped, separators are replaced with spaces, and names are title-cased (01_overview.mdbecomesOverview). - Subdirectories become nested navigation groups. A nested
index.mdis rendered as the section root placed first inside the group. - Only
.mdfiles are considered; hidden entries are ignored.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wiki_dir |
Path
|
Path to the hand-written wiki directory, for example |
required |
Returns:
| Type | Description |
|---|---|
list[dict[str, Any]]
|
List[Dict[str, Any]]:
Navigation entries compatible with the MkDocs |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the wiki directory does not exist. |