1- .. _material :
2-
3- Material for MkDocs
4- ===================
1+ MkDocs
2+ ======
53
64.. meta ::
7- :description lang=en: Hosting Material for MkDocs sites on Read the Docs.
5+ :description lang=en: Hosting MkDocs sites on Read the Docs.
86
97`MkDocs `_ is a fast, simple static site generator that's geared towards building project documentation.
10- `Material for MkDocs `_ is a powerful documentation framework on top of MkDocs.
118Mkdocs is written in Python, and supports documentation written in Markdown.
9+ When using MkDocs, we recommend using the `Material for MkDocs `_ theme,
10+ and this guide is mostly focused on the integration required to make it work well on Read the Docs.
1211
13- .. note ::
14-
15- This page is explicitly about Material for MkDocs. We're working on a guide for plain MkDocs as well.
16-
17- Minimal configuration required to build an existing Material for MkDocs project on Read the Docs looks like this,
18- specifying a python toolchain on Ubuntu, defining the location of the installation requirements, and using the built-in
19- :ref: `mkdocs <config-file/v2:mkdocs >` command:
12+ Minimal configuration is required to build an existing MkDocs project on Read the Docs:
2013
2114.. code-block :: yaml
2215 :caption : .readthedocs.yaml
2316
2417 version : 2
2518
2619 build :
27- os : ubuntu-24.04
20+ os : " ubuntu-24.04"
2821 tools :
2922 python : " 3"
30-
31- python :
32- install :
33- - requirements : requirements.txt
23+ # We recommend using a requirements file for reproducible builds.
24+ # This is just a quick example to get started.
25+ # https://docs.readthedocs.io/page/guides/reproducible-builds.html
26+ jobs :
27+ pre_install :
28+ - pip install mkdocs-material
3429
3530 mkdocs :
3631 configuration : mkdocs.yml
3732
3833 .. _MkDocs : https://www.mkdocs.org/
3934.. _Material for MkDocs : https://squidfunk.github.io/mkdocs-material
4035
36+ Configuring Material for MkDocs on Read the Docs
37+ ------------------------------------------------
4138
42- Quick start
43- -----------
39+ In order to use the Material for MkDocs theme on Read the Docs,
40+ you need to install and configure it.
41+ In your `mkdocs.yml ` file, set the theme to `material `:
4442
45- - If you have an existing Material for MkDocs project you want to host on Read the Docs, check out our :doc: `/intro/add-project ` guide.
43+ .. code-block :: yaml
44+ :caption : mkdocs.yml
4645
47- - If you're new to Material for MkDocs, check out the official `Getting started with Material for MkDocs `_ guide.
46+ theme :
47+ name : material
4848
49- .. _Getting started with Material for MkDocs : https://squidfunk.github.io/mkdocs-material/getting-started/
49+ With these changes, your MkDocs project will use the Material for MkDocs theme when built on Read the Docs,
50+ and should work with the configuration file shown above.
5051
51- Configuring Material for MkDocs and Read the Docs addons
52- --------------------------------------------------------
52+ Quick start
53+ -----------
5354
54- For optimal integration with Read the Docs, make the optional following configuration changes to your Material for MkDocs config.
55+ - You can use our :ref: `MkDocs example project <examples:mkdocs >` as a reference to create a new MkDocs project.
56+ - If you have an existing MkDocs project you want to host on Read the Docs, check out our :doc: `/intro/add-project ` guide.
57+ - If you're new to MkDocs, check out the official `Getting Started <https://www.mkdocs.org/getting-started/ >`_ guide.
5558
56- .. contents ::
57- :depth: 1
58- :local:
59- :backlinks: none
59+ Configuring MkDocs and Read the Docs Addons
60+ -------------------------------------------
61+
62+ There are some additional steps you can take to configure your MkDocs project to work better with Read the Docs,
63+ and these apply to all MkDocs projects.
6064
6165Set the canonical URL
6266~~~~~~~~~~~~~~~~~~~~~
@@ -74,6 +78,15 @@ Set your MkDocs `site URL`_ to your Read the Docs canonical URL using a
7478
7579 .. _Site URL : https://www.mkdocs.org/user-guide/configuration/#site_url
7680
81+ Configuring Material for MkDocs and Read the Docs Addons
82+ --------------------------------------------------------
83+
84+ `Material for MkDocs `_ is a powerful documentation theme on top of MkDocs.
85+ The following steps are specific to integrating Material for MkDocs and Read the Docs.
86+
87+ .. contents ::
88+ :local:
89+ :backlinks: none
7790
7891Configure Read the Docs search
7992~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 commit comments