The core MkDocs plugin used by Backstage's TechDocs as a wrapper around multiple MkDocs plugins and Python Markdown extensions
Actively maintained. Last release 3 months ago. A safe choice.
pip install mkdocs-techdocs-coremkdocs-techdocs-core
This is the base Mkdocs plugin used when using Mkdocs with Spotify's TechDocs. It is written in Python and packages all of our Mkdocs defaults, such as theming, plugins, etc in a single plugin.
Usage
Requires Python version >= 3.9
$ pip install mkdocs-techdocs-core
Once you have installed the mkdocs-techdocs-core plugin, you'll need to add it to your mkdocs.yml.
site_name: Backstage Docs
nav:
- Home: index.md
- Developing a Plugin: developing-a-plugin.md
plugins:
- techdocs-core
(Optional) To use material theme search to generate the search/search_index.json (responsible for the search functionality in the TechDocs reader), you need to add the following configuration to your mkdocs.yml:
plugins:
- techdocs-core:
use_material_search: true
(Optional) To use PyMdown Blocks Extensions (replaces admonitions, pymdownx.details and pymdownx.tabbed extensions), you need to add the following configuration to your mkdocs.yml:
plugins:
- techdocs-core:
use_pymdownx_blocks: true
Development
Running Locally
You can install this package locally using pip and the --editable flag used for making developing Python packages.
pip install --editable .
You'll then have the techdocs-core package available to use in Mkdocs and pip will point the dependency to this folder.
Linting
We use black as our linter. Please run it against your code before submitting a pull request.
pip install black
black .
This will write to all Python files in with the formatted code. If you would like to only check to see if it passes, simply append the flag.