Search code examples
mermaid

Set mermaid.initialize property in Mermaid CLI


When using Mermaid in the browser, one can set the mermaid.initialize property to alter the SVG produced:

mermaid.initialize({
    flowchart: { 
        curve: 'basis' 
    }
});

How does one set this property when using Mermaid CLI?


Solution

  • Of course I would figure it out only minutes after posting!

    The config should be put into a separate file using valid JSON (double-quoted keys and values):

    $ cat mermaid-config.json
    {
        "flowchart": { 
            "curve": "basis" 
        }
    }
    

    And the mmdc executable should be called with the -c flag:

    $ mmdc -c mermaid-config.json -i foo.txt -o foo.png