| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
Requires Python version >= 3.9
$ pip install mkdocs-techdocs-coreOnce 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: trueYou 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.
We use black as our linter. Please run it against your code before submitting a pull request.
pip install black
black .Note: This will write to all Python files in src/ with the formatted code. If you would like to only check to see if it passes, simply append the --check flag.
If you have made changes to the plugin itself, or updated a dependency it's strongly recommended to test the plugin.
To build a version of the spotify/techdocs docker image with your changes, run the below script in this repository:
./build-e2e-image.shThe script is only tested on OSX
The script assumes that you have the image repository cloned in a sibling directory to this repository (or you can specify its location).
It will build an image called mkdocs:local-dev including the changes you have made locally. To test the image in backstage, edit the config (e.g. app-config.yaml) with the following:
techdocs:
generator:
runIn: "docker"
dockerImage: "mkdocs:local-dev"
pullImage: falseIn order to publish a release, you must manually dispatch the manual-versioning GitHub Action. Please see the official GitHub documentation on Manual Workflows for full instructions.
Tip
If you decide to provide an explicit levelBump, please respect SemVer. When left empty, PSR will determine the best version bump based on the commits since the previous release. Automatic Versioning does rely on conventional-commits which is not enforced within this project.
This project utilizes PSR (Python Semantic Release) to create releases. Release Notes will be generated from commit messages and the CHANGELOG.md will be automatically updated with all commits since the previous release.
The TechDocs Core MkDocs plugin comes with a set of extensions and plugins that mkdocs supports. Below you can find a list of all extensions and plugins that are included in the TechDocs Core plugin:
Plugins:
Extensions:
admonition: Admonitions, also known as call-outs, are an excellent choice for including side content without significantly interrupting the document flow. Material for MkDocs provides several different types of admonitions and allows for the inclusion and nesting of arbitrary content.
toc: The Table of Contents extension generates a Table of Contents from a Markdown document and adds it into the resulting HTML document. This extension is included in the standard Markdown library.
pymdown: PyMdown Extensions is a collection of extensions for Python Markdown. All extensions are found under the module namespace of pymdownx.
markdown_inline_graphviz: A Python Markdown extension replaces inline Graphviz definitions with inline SVGs or PNGs. Activate the markdown_inline_graphviz extension using the usage instructions.
plantuml_markdown: This plugin implements a block extension which can be used to specify a PlantUML diagram which will be converted into an image and inserted in the document.
mdx_truly_sane_lists: An extension for Python-Markdown that makes lists truly sane. Features custom indents for nested lists and fix for messy linebreaks and paragraphs between lists.
Note that the above set of plugins and extensions represents an opinionated list providing a core set of functionality necessary for most technical documentation needs (hence: techdocs-core). PRs introducing new plugins or extensions are welcome, but they are not guaranteed to be accepted.
In order to solve your organization's specific needs, you're encouraged to install any necessary extensions/plugins in your own environment on top of techdocs-core (be it the TechDocs backend container, or a custom TechDocs build container).
We only use material-mkdocs as base styles because Backstage also uses the Material UI on the client-side. We don't expect people to use themes other than Material UI to maintain consistency across all Backstage pages (in other words, documentation pages have the same look and feel as any other Backstage page) and so we use the BackstageTheme configured in Front-end application as the source of truth for all application design tokens like colors, typography and etc. So here you can see that some styles will always be overridden regardless of the mkdocs-material plugin theme settings and this can cause unexpected behavior for those who override the theme setting in a mkdocs.yaml file.
Copyright 2020-2023 © The Backstage Authors. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our Trademark Usage page: https://www.linuxfoundation.org/trademark-usage
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
| Back | FazBrowse Home | New Git URL |