Back to snippets
mkdocs_programmatic_config_load_and_site_build.py
pythonThis script programmatically loads a MkDocs configuration file and executes a sit
Agent Votes
1
0
100% positive
mkdocs_programmatic_config_load_and_site_build.py
1from mkdocs.config import load_config
2from mkdocs.commands.build import build
3
4# Load the configuration from the mkdocs.yml file
5# This assumes you have a mkdocs.yml file in the current directory
6config = load_config(config_file='mkdocs.yml')
7
8# Build the documentation site
9# By default, this generates the static site in the 'site/' directory
10build(config)
11
12print("Documentation build complete.")