
Security News
Rust RFC Proposes a Security Tab on crates.io for RustSec Advisories
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.
backstage-plugin-techdocs-addon-mermaid
Advanced tools
The backstage-plugin-techdocs-addon-mermaid allows rendering of Mermaid diagrams
within Backstage TechDocs
This plugin is a Backstage TechDocs Addon, which requires Backstage v1.2+
Follow the official documentation for TechDocs Addons to enable addons for techdocs.
For your backstage instance, make sure you have installed mkdocs-techdocs-core >= 1.0.2. Older versions will not render mermaid correctly!
pip3 install mkdocs-techdocs-core==1.0.2
Install this plugin in your backstage app. Run the following command from the root of your backstage installation:
yarn --cwd packages/app add backstage-plugin-techdocs-addon-mermaid
Enabling the Mermaid Addon:
App.tsx and EntityPage.tsx// packages/app/src/App.tsx
// packages/app/src/components/catalog/EntityPage.tsx
import { Mermaid } from "backstage-plugin-techdocs-addon-mermaid";
// ...
{techDocsPage}
<TechDocsAddons>
{/*...*/}
<Mermaid config={{ theme: "forest", themeVariables: { lineColor: "#000000" } }} />
</TechDocsAddons>
App.tsx:// packages/app/src/App.tsx
import techDocsPlugin from '@backstage/plugin-techdocs/alpha';
import { techDocsMermaidAddonModule } from "backstage-plugin-techdocs-addon-mermaid";
// ...
const app = createApp({
features: [
// ...
techDocsPlugin,
techDocsMermaidAddonModule,
// ...other techdocs addon modules
],
});
# Mermaid section
Here is a mermaid graph!
```mermaid
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
```
The plugin supports interactive zoom and pan functionality for Mermaid diagrams. This allows users to:
The zoom functionality can be configured using the following options:
interface ZoomOptions {
/**
* Defines the minimum and maximum zoom scale limits.
* Example: [0.1, 10] allows zooming out to 10% and in to 1000%
* Default: [0.1, 10]
*/
scaleExtent?: [number, number];
/**
* Defines the boundaries for panning the diagram.
* Format: [[xmin, ymin], [xmax, ymax]]
* Example: [[-1000, -1000], [1000, 1000]] limits panning to a 2000x2000 area
* Default: No limits
*/
translateExtent?: [[number, number], [number, number]];
}
To enable zoom functionality, add the enableZoom prop and optionally configure the zoom behavior:
<Mermaid
enableZoom
zoomOptions={{
scaleExtent: [0.1, 10], // Optional: Set min/max zoom scale
translateExtent: [[-1000, -1000], [1000, 1000]] // Optional: Set pan boundaries
}}
/>
By default, this plugin will autodetect diagrams based on the starting token of the code block. In some cases, however, this auto-detection is not sufficient, for example, because of an unrecognized
diagram type or the use of front matter. In these cases, you can force the use of mermaid on blocks by adding configuration like this to your mkdocs.yaml file:
markdown_extensions:
pymdownx.extra:
pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format
By providing a mermaid layout renderer that conforms to the LayoutLoaderDefinition, such as the ELK Renderer,
this plugin will include this provided render on page load.
Example Usage
In your Backstage application root folder run:
yarn add @mermaid-js/layout-elk
Then within both App.tsx and EntityPage.tsx add the following:
import elkLayouts from '@mermaid-js/layout-elk';
...
<Mermaid layoutLoaders={elkLayouts} config={{layout: 'elk'}} />
...
This will support both the legacy syntax and the modern syntax for defining which mermaid diagrams utilize the new layout renderer Legacy
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
Modern
---
config:
layout: elk
---
This plugin can be developed in the context of an existing Backstage deployment or a new local deployment.
plugins/backstage-plugin-techdocs-addon-mermaid folder and run yarn link.yarn link backstage-plugin-techdocs-addon-mermaid.yarn install in the Backstage root.app.tsx.After making changes to the plugin and having unit tests pass, to do manual end-to-end testing, follow the instructions below.
You can use the TechDocs CLI to test against a local docs folder. You will need to customize the preview app bundle for that to work as the addon is not included in the standard bundle. Review the TechDoc's documentation for further instructions.
Register a component via URL like any other Backstage component and view that component's TechDocs. For example, to use the SampleDocs component in this repo:
app-config.local.yaml.yarn dev in the root of your Backstage codebase.http://localhost:3000/catalog-importhttps://github.com/johanneswuerbach/backstage-plugin-techdocs-addon-mermaid/blob/main/sampledocs/catalog-info.yamlFAQs
Unknown package
The npm package backstage-plugin-techdocs-addon-mermaid receives a total of 12,144 weekly downloads. As such, backstage-plugin-techdocs-addon-mermaid popularity was classified as popular.
We found that backstage-plugin-techdocs-addon-mermaid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.

Security News
/Research
Socket found a Rust typosquat (finch-rust) that loads sha-rust to steal credentials, using impersonation and an unpinned dependency to auto-deliver updates.

Research
/Security Fundamentals
A pair of typosquatted Go packages posing as Google’s UUID library quietly turn helper functions into encrypted exfiltration channels to a paste site, putting developer and CI data at risk.