[TechDocs] - Support Mermaid Diagrams Using the Addon Framework
See original GitHub issueExpected Behavior
Expecting techdocs/backstage to render custom JS / mermaid plugin.

Current Behavior
mkdocs/techdocs is not rendering custom JS / mermaid plugin; instead only the raw instructions are presented

Context
I’m running a custom tech-docs backend with the mermaid extension installed in the local container. For example:
Tech-docs custom container:
...
pip install --quiet \
mkdocs==1.1.2 \
cookiecutter==1.7.2 \
Markdown==3.2.2 \
pygments==2.6.1 \
mkdocs-material \
mkdocs-jupyter \
mkdocs-mermaid2-plugin \
...
Your Environment
mkdocs-techdocs-core 0.0.13 mkdocs-plugin-mermaid 0.1.1
My mkdocs.yml config:
plugins:
- techdocs-core
- mermaid2
extra_javascript:
- https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML
- https://unpkg.com/mermaid/dist/mermaid.min.js
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:34 (20 by maintainers)
Top Results From Across the Web
Release: Roadie Now Supports Mermaid Diagrams in Techdocs
We have added support for mermaid syntax in techdocs. If you would like to use mermaid diagrams, you can add the markdown_inline_mermaid ...
Read more >backstage-plugin-techdocs-addon-mermaid - npm
Start using backstage-plugin-techdocs-addon-mermaid in your project by ... allows rendering of Mermaid diagrams within Backstage TechDocs.
Read more >Include diagrams in your Markdown files with Mermaid
Mermaid is a JavaScript based diagramming and charting tool that takes Markdown-inspired text definitions and creates diagrams dynamically ...
Read more >backstage-plugin-techdocs-addon-mermaid - npm package
The `backstage-plugin-techdocs-addon-mermaid` allows rendering of [Mermaid](https://mermaid-js.github.io/) diagrams within [Backstage TechDocs]( ...
Read more >Backstage Software Catalog and Developer Platform
Create new software components in just a few steps, with your standards built-in (Scaffolder). Explore. Backstage TechDocs. by Spotify. Core Feature. A ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We’ll look more into the MkDocs mermaid2 plugin more to see how we can make it work with TechDocs.
But TechDocs loading an external Javascript from its storage and executing it, will be a security threat for a Backstage app. Hence, TechDocs is only allowed to import HTML and CSS.
One possible approach would be to make the files under
extra_javascriptavailable in Backstage/TechDocs frontend; and then when the mermaid diagram’s HTML is rendered, it would work as expected. But I’m not too sure.Still interested