Creating a website via config
It is possible to construct a basic documentation website without writing any Python code by
describing the node tree in the config. The default build function (mkdocs_mknodes:parse)
builds the nav from the pages setting.
The following config...
# pyproject.toml
[[tool.mknodes.pages]]
title = "Home"
type = "MkText"
text = "# mkdocs-mknodes (merged into mknodes)
This package has been merged into [mknodes](https://github.com/phil65/mknodes) (4.0+), which now
contains the site generator: `mknodes build` / `serve` / `generate`.
```bash
uv add --group docs "mknodes>=4.0.0"
uv run mknodes build
Settings stay in [tool.mknodes] of pyproject.toml. The default build function is now
mknodes.site:parse (was mkdocs_mknodes:parse); custom build functions are unchanged.
Documentation: https://phil65.github.io/mknodes/
The history of this repository is part of the mknodes repository. " is_index = true
[[tool.mknodes.pages]] Usage = [ { title = "Getting started", type = "MkText", text = "Install the package and import it." }, { title = "Changelog", type = "MkChangelog" }, ]
[[tool.mknodes.pages]] title = "API" type = "MkDoc" section_name = "API" recursive = true
[[tool.mknodes.pages]] title = "CLI" type = "MkCliDoc" show_subcommands = true condition = "typer"
[[tool.mknodes.pages]] Development = [ { title = "Contributing", type = "MkCommitConventions" }, { title = "Dependencies", type = "MkDependencyTable" }, { title = "License", type = "MkLicense" }, ]
...creates a website with a home page, a usage section, API docs, a CLI page (if the project has a CLI) and a development section.