-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support YAML frontmatter configuration #147
Comments
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 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:
It gets rendered with its default style:
Instead, I expect it to be rendered the same way it is displayed in the official documentation:
This issue was produced in the following environment:
The text was updated successfully, but these errors were encountered: