Skip to content

Commit ce422c1

Browse files
authored
Update MkDocs page to be generic and note MkDocs for Material integration (#11871)
This is trying to clarify support for the tooling, and note which parts are generic to MkDocs. Refs squidfunk/mkdocs-material#7822 <!-- readthedocs-preview docs start --> --- :books: Documentation previews :books: - User's documentation (`docs`): https://docs--11871.org.readthedocs.build/en/11871/ <!-- readthedocs-preview docs end --> <!-- readthedocs-preview dev start --> - Developer's documentation (`dev`): https://dev--11871.org.readthedocs.build/en/11871/ <!-- readthedocs-preview dev end -->
1 parent af26138 commit ce422c1

File tree

4 files changed

+46
-45
lines changed

4 files changed

+46
-45
lines changed

docs/user/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ Read the Docs: documentation simplified
66
:hidden:
77
:caption: Getting started
88

9-
/tutorial/index
9+
Tutorial </tutorial/index>
1010
/intro/add-project
1111
/intro/doctools
1212
/examples
13-
/intro/accounts
1413

1514
.. toctree::
1615
:maxdepth: 2
@@ -20,6 +19,7 @@ Read the Docs: documentation simplified
2019
/config-file/index
2120
/config-file/v2
2221
/addons
22+
/intro/accounts
2323
/automation-rules
2424
/guides/reproducible-builds
2525

docs/user/intro/doctools.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ Below is a list of popular documentation tools that you can use to write your do
6868
.. toctree::
6969
:hidden:
7070

71-
/intro/mkdocs
7271
/intro/sphinx
72+
/intro/mkdocs
7373
/intro/docusaurus
7474
/intro/markdoc
7575
/intro/mdbook

docs/user/intro/mkdocs.rst

Lines changed: 43 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,66 @@
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.
118
Mkdocs 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

6165
Set 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

7891
Configure Read the Docs search
7992
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

docs/user/tutorials/index.rst

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,3 @@ Tutorials
3030
⏩️ :doc:`/examples`
3131
If you are bootstrapping a new documentation project,
3232
here is a list of example projects that you can derive your setup from.
33-
34-
35-
.. toctree::
36-
:maxdepth: 1
37-
:hidden:
38-
39-
/tutorial/index
40-
/intro/sphinx
41-
/intro/mkdocs
42-
/intro/add-project
43-
/config-file/index
44-
/examples

0 commit comments

Comments
 (0)