Skip to content

Mkdocs Utils

docforge.cli.mkdocs_utils

build

build(mkdocs_yml: Path) -> None

Build the documentation site using MkDocs.

Parameters:

Name Type Description Default
mkdocs_yml Path

Path to the mkdocs.yml configuration file.

required

generate_config

generate_config(docs_dir: Path, nav_file: Path, template: Path | None, out: Path, site_name: str) -> None

Generate an mkdocs.yml configuration file.

Parameters:

Name Type Description Default
docs_dir Path

Path to the directory containing documentation Markdown files.

required
nav_file Path

Path to the docforge.nav.yml specification.

required
template Path | None

Optional path to an mkdocs.yml template (overrides built-in).

required
out Path

Path where the final mkdocs.yml will be written.

required
site_name str

The display name for the documentation site.

required

generate_sources

generate_sources(module: str, docs_dir: Path, project_name: str | None = None, module_is_source: bool | None = None) -> None

Generate Markdown source files for the specified module.

Parameters:

Name Type Description Default
module str

The dotted path of the primary module to document.

required
project_name str | None

Optional override for the project name.

None
docs_dir Path

Directory where the generated Markdown files will be written.

required
module_is_source bool | None

Module is the source folder and to be treated as the root folder.

None

serve

serve(mkdocs_yml: Path) -> None

Serve the documentation site with live-reload using MkDocs.

Parameters:

Name Type Description Default
mkdocs_yml Path

Path to the mkdocs.yml configuration file.

required