mkdocs¶
These are notes on mkdocs from deploying a mkdocs site for my notes.
mkdocs is a Python-based tool used to build static websites, geared towards
technical documentation.
Setting up MkDocs¶
These are setup notes for a MkDocs website.
-
For local testing, use a virtual environment.
sudo apt-get install -y python3.10-venv # to get the venv module sudo apt-get install -y python3.10-venv --fix-missing # if install doesn't work- This is a Debian-based install. For RedHat-based distros, the
venvmodule should be available as long aspython3is installed.
- This is a Debian-based install. For RedHat-based distros, the
-
Once the Python
venvmodule is installed, create the virtual environment and activate it by sourcing thevenv/bin/activatescript.
-
Verify you're in the virtual environment.
-
Install
mkdocsand a theme formkdocs.
-
Initialize the
mkdocsproject.
- This initializes a new mkdocs project in the current directory (
.). - It creates a baseline
mkdocs.ymlfile and adocs/directory with anindex.mdfile.
- This initializes a new mkdocs project in the current directory (
-
Add any markdown files you want to serve via the docs site into the
docs/directory.
-
Add all files to the
mkdocs.ymlfile in thenavsection to serve them.
MkDocs Project Structure¶
In the root of the repo, you need a docs/ directory.
You also need a mkdocs.yml file in the repo root.
The directory structure of my notes directory is fine for mkdocs, but it all needs to
be in the docs/ directory instead of the root.