You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@aloisklink I have a query before we release this. Do we need the config key?
The only other keys in frontmatter are title and displayMode, with the addition of config, the chance of us adding a top level frontmatter key is slim.
So, should we remove the config key, and directly write the config at the root?
sankey:
showValues: true
prefix: $
suffix: B
width: 800
nodeAlignment: left
So, should we remove the config key, and directly write the config at the root?
My opinion is no!
Having everything as a separate config means people can easily just copy the config in and out of the frontmatter. E.g., if you have a mermaid-config.json file, you can easily just add it to your YAML frontmatter like:
config: {example: {value: "my huge JSON config here", other_big_values: "...................."}}title: My title here
It will also help for writing documentation, since when we document how the YAML frontmatter works, we can just say something like "The config key must be some valid MermaidConfig values, see docs in https://mermaid.js.org/config/schema-docs/config.html", instead of documenting something like "The flowchart key must be a valid MermaidConfig flowchart value, the class key must be a valid MermaidConfigclass key, ...."
It will also make the code harder to handle, since then we'd need some sort of pre-processing step to split up what values of the frontmatter are part of the config, and which aren't (and we'd have to keep modifying this whenever we add new diagrams (and how would third-party diagrams work?)).
Having everything under the config param seems easier for both the users, and for us from a code maintenance perspective.
The only other keys in frontmatter are title and displayMode, with the addition of config, the chance of us adding a top level frontmatter key is slim.
So, should we remove the
config
key, and directly write the config at the root?Originally posted by @sidharthv96 in #4748 (comment)
The text was updated successfully, but these errors were encountered: