Note: This plugin is in beta. Whilst it is not expected to significantly change in functionality, it may not yet be fully compatible with other Mkdocs configuration and thus may break with some advanced configurations. Once these have been resolved and all bugs have been ironed out, we will move this to a stable release.
✚ This plugin enables you to build multiple sets of documentation in a single Mkdocs. It is designed to address writing documentation in Spotify's largest and most business-critical codebases (typically monoliths or monorepos).
Support for multiple
docs/folders in Mkdocs. Having a single
docs/folder in a large codebase is hard to maintain. Who owns which documentation? What code is it associated with? Bringing docs closer to the associated code enables you to update them better, as well as leverage folder-based features such as GitHub Codeowners.
Support for multiple navigations. In Spotify, large repositories typically are split up by multiple owners. These are split by folders. By introducing multiple
mkdocs.ymlfiles along with multiple
docs/folder, each team can take ownership of their own navigation. This plugin then intelligently merges of the documentation together into a single repository.
Support across multiple repositories. Using Git Submodules it is possible to merge documentation across multiple repositories into a single codebase dynamically.
The same great Mkdocs developer experience. It is possible to run
mkdocs servein the root to merge all of your documentation together, or in a subfolder to build specific documentation. Autoreload still works as usual. No more using symlinks!
It's easy to get started using PyPI and
pip using Python:
$ pip install mkdocs-monorepo-plugin
Take a look at our sample project or do the following:
- In the root, add the
- Create a subfolder, with a
nav, as well as a
docs/folder with an
- Back in in the root
mkdocs.yml, use the
!includesyntax in your
navto link to to a subfolder
Example root /mkdocs.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Example submodule /v1/mkdocs.yml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Example submodule /v2/mkdocs.yml
1 2 3 4 5 6 7 8 9 10 11 12
An example filetree when using the Mkdocs Monorepo plugin looks like this:
$ tree . ├── docs │ ├── authentication.md │ └── index.md ├── mkdocs.yml ├── v1 │ ├── docs │ │ ├── changelog.md │ │ └── reference.md │ └── mkdocs.yml └── v2 ├── docs │ ├── changelog.md │ ├── migrating.md │ └── reference.md └── mkdocs.yml 5 directories, 10 files
- Python 3 — 3.7, 3.8, 3.9, 3.10, 3.11
- Mkdocs 1.0.4 and above.
Released under the Apache 2.0 License. See here for more details.
Check out our CONTRIBUTING for more details.