MkDocs

1.6.1 · active · verified Sun Apr 05

MkDocs is a fast, simple, and downright gorgeous static site generator that's geared towards building project documentation with Markdown. It converts a directory of Markdown files and a YAML configuration into a static website. The current version is 1.6.1, and it maintains an active release cadence with several patch and minor releases per year to address bugs and introduce new features.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to create a new MkDocs project and start its built-in development server. The `mkdocs new` command scaffolds a basic project structure with a `mkdocs.yml` configuration file and a `docs/` directory for your Markdown content. The `mkdocs serve` command then launches a local server with live-reloading for development.

import os

# Create a new MkDocs project
os.system("mkdocs new my-docs-project")

# Change into the project directory
os.chdir("my-docs-project")

# Start the development server (runs in the background for this example)
# In a real scenario, you'd run this from your terminal and visit http://127.0.0.1:8000
print("Run 'mkdocs serve' in your terminal in the 'my-docs-project' directory to preview your site.")
print("To open in browser automatically: 'mkdocs serve --open'")

view raw JSON →