This page describes concepts that are introduced with Spotify's docs-like-code solution in Backstage.
Generating TechDocs Steps
Preparing is the first step of generating documentation for an entity. It fetches the source markdown files from the source code hosting provider (GitHub, GitLab, etc.) and passes the files to the generator for next steps.
There are two kinds of preparers available -
- Common Git Preparer - Uses
git cloneon any repository url.
- Url Reader - Uses source code hosting provider's API to download files. (Faster and recommended)
Generating is the second step after preparing the markdown source files. This
step either runs the TechDocs container (defined below) or runs
mkdocs CLI to
generate static HTML files and its assets.
Publishing is the third and final step after preparing and generating docs. TechDocs Publisher uploads the generated files to a storage.
techdocs-backend plugin currently comes with two publishers - Google Cloud
Storage and Local Filesystem. You can configure them in your Backstage app.
A TechDocs publisher is responsible for two things (two-way communication
techdocs-backend and the storage)
- Publish generated static files to a storage (Configured by
- Read files from the storage when users visit a TechDocs site
The TechDocs container is a Docker container available at DockerHub. It builds static HTML pages, including stylesheets and scripts from Python flavored Markdown, through MkDocs.
TechDocs Core Plugin
The TechDocs Core Plugin is an MkDocs plugin created as a wrapper around multiple MkDocs plugins and Python Markdown extensions to standardize the configuration of MkDocs used for TechDocs.
The TechDocs CLI was created to make it easy to write, generate and preview documentation for publishing. Currently it mostly acts as a wrapper around the TechDocs container and provides an easy-to-use interface for our docker container.
Documentation generated by TechDocs is generated as static HTML sites. The TechDocs Reader was therefore created to be able to integrate pre-generated HTML sites with the Backstage UI.
The TechDocs Reader purpose is also to open up the opportunity to integrate TechDocs widgets for a customized full-featured TechDocs experience. (coming soon V.3)
Transformers are different pieces of functionality used inside the TechDocs Reader. The reason why transformers were introduced was to provide a way to transform the HTML content on pre and post render (e.g. rewrite docs links or modify css).