Skip to content

MkDocs Basics

This website is generated by and the Material Theme.

Basic MkDocs Commands

  • mkdocs new [dir-name] - Create a new project.
  • mkdocs serve - Start the live-reloading docs server.
  • mkdocs build - Build the documentation site.
  • mkdocs help - Print this help message.

Install and documentation generation

To install MkDocs / create a new documentation site:

pip install mkdocs
mkdocs new documentation

To build the documentation site:

cd documentation
mkdocs build

To start the live-reloading docs server - https://localhost:8000/

mkdocs serve

MkDocs can use the ghp-import tool to commit to the gh-pages branch and push the gh-pages branch to GitHub Pages:

mkdocs gh-deploy

MkDocs project layout

    mkdocs.yml    # The configuration file.
    docs/  # The documentation homepage.
        ...       # Other markdown pages, images and other files.