Closed kdeldycke closed 3 days ago
Note that GitHub is supporting these frontmatter configuration directives:
---
title: Hello Title
config:
theme: base
themeVariables:
primaryColor: "#00ff00"
---
flowchart
Hello --> World
My particular use-case for this was to deactivate the rendering of values in a Sankey diagram like this:
---
config:
sankey:
showValues: false
---
sankey-beta
Agricultural 'waste',Bio-conversion,124.729
Bio-conversion,Liquid,0.597
Bio-conversion,Losses,26.862
Bio-conversion,Solid,280.322
Bio-conversion,Gas,81.144
As a temporary workaround, I deactivated globally value rendering for all Sankey diagrams by tweaking the Mermaid initialization in my Sphinx's conf.py
configuration file:
mermaid_version = "latest"
mermaid_init_js = """
const config = {
startOnLoad: true,
sankey: {
showValues: false,
},
};
mermaid.initialize(config);
"""
@kdeldycke are you interested in opening a PR for this? It seems a very valuable feature.
Each mermaid diagram can be prefixed with a frontmatter configuration block to alter its default rendering. Example:
This is the preferred way starting with Mermaid v10.5.0+ since
%%{``}%%
directives are now deprecated.Unfortunately this syntax is not supported by
sphinxcontrib-mermaid
.How to reproduce
Add the following diagram to any markdown file: