The build process
This section provides an overview about the sequence of operations applied by MkNodes when running the full build process.
Load settings
Settings are read from the mknodes entry of the plugins list in mkdocs.yml,
[tool.mknodes] in pyproject.toml and the CLI options. The target repository gets
cloned in case it is a remote one.
Create theme
Initialize the theme object based on the theme configured in mkdocs.yml
(default: material).
Create context
All available information from following sources is extracted in order to build a project context:
- metadata.Distribution
- PyProject File
- Site config file (
mkdocs.yml) - Other config files in the repository
- Git repository info
- Information from GitHub
Build MkNodes tree
The build function (build_fn) is executed with the root MkNav and the theme
and the node tree is generated. Without any configuration, the default build function
creates a default website (README, API docs, CLI docs, development pages).
Collect build artifacts
The BuildCollector walks the node tree and renders every page and nav
(Markdown incl. front matter, rendered with jinja2). It aggregates the required
resources (CSS / JS / Markdown extensions) and the page templates and converts the
template blocks to HTML. The result is an engine-neutral BuildOutput.
Write the site input
The ZensicalWriter writes the pages and assets into the docs folder and the
template overrides into the theme custom_dir (both tracked in a generated
.gitignore, hand-written files are never overwritten) as well as
mkdocs.generated.yml, which inherits from mkdocs.yml and adds the nav,
the Markdown extensions and the extra CSS / JS.
Build with Zensical
zensical build -f mkdocs.generated.yml renders the website.