MermaidWriter Class

Writes diagrams and charts as Mermaid text, which MermaidDocument.Parse reads back.

public static class MermaidWriter

Remarks

The theme is written when it is one of the themes of Mermaid (DiagramTheme.Dark...); a modified theme is not written. The text measurer is not written.

Methods

NameDescription
Write(ISceneSource)Writes a diagram or a chart as Mermaid text.

Write(ISceneSource)

MermaidWriter.cs

Writes a diagram or a chart as Mermaid text.

public static string Write(ISceneSource diagram)

Parameters

diagram ISceneSource
The diagram, such as a FlowchartDiagram, or the chart, such as a PieChart: the MermaidDocument.Content of a document.

Returns

string The Mermaid text, with line feeds.

Exceptions

ArgumentException
The diagram has an element that Mermaid cannot express, such as an identifier with spaces.
NotSupportedException
The type of the diagram cannot be written.