Download Material for MKDocs¶
Installing Material for MKDocs requires Python or Docker. This guide uses Python.
For more MKDocs documentation, visit mkdocs.org.
-
Run the following command to download and install Homebrew for macOS.
-
Enter your password for sudo access.
- Press Enter to confirm the installation. The installation can take a few minutes.
-
Run the following commands to add
brew
to the path. Change<username>
to your username. -
Run the following command to install Python using Brew.
-
Run the following command to install Pip.
-
Enter
pip install mkdocs
, then press Enter. MKDocs is installed. - Enter
pip install mkdocs-material
, then press Enter. Material for MKDocs is installed. - Navigate to your project folder. Example:
cd documents/material-mkdocs
. - Enter
mkdocs new .
, then press Enter. This will create an mkdocs.yml file, a docs folder, and an index.md file in the docs folder.
The following works with Windows 10 and later.
- Download the Python installer version 3.11.5. For Windows, download Windows installer (64-bit).
- Double-click the Python executable file to start the installation process.
- Select Add python.exe to PATH.
- Click Install Now.
- When installation is complete, click Close.
- Enter
pip install mkdocs-material
, then press Enter. Material for MKDocs is installed. - Navigate to your project folder. Example:
cd /documents/material-mkdocs
. - Enter
mkdocs new .
, then press Enter. This will create an mkdocs.yml file, a docs folder, and an index.md file in the docs folder.
-
Run the following command to install pip. Running
sudo
will require entering your password. -
When asked if you want to continue installing pip, press Enter to accept.
-
Run the following command to install MKDocs.
-
When asked if you want to continue installing MKDocs, press Enter to accept.
-
Run the following command to install Material for MKDocs.
-
When asked if you want to continue installing Material for MKDocs, press Enter to accept.
- Navigate to your project folder. Example:
cd documents/material-mkdocs
. - Enter
mkdocs new .
, then press Enter. This will create an mkdocs.yml file, a docs folder, and an index.md file in the docs folder.
Build a Site¶
After installing Material for MKDocs and creating a project, you can build a site.
- Open Visual Studio Code.
- Select Terminal > New Terminal.
- In the command line, enter mkdocs serve, then press Enter. This runs the website locally.
- Open a web browser, enter
http://127.0.0.1:8000/
as the URL, then press Enter. The Welcome to MKDocs website displays. - In Visual Studio Code, open the Material for MKDocs
mkdocs.yaml
file. Select File > Open Folder, navigate to the project folder, select themkdocs.yml
file, then click Open. -
Add the following to the
mkdocs.yml
file. The local website should update with the Material for MKDocs theme.