mermaid plugin (support markdown syntax to generate mermaid charts)
yarn add @aomao/plugin-mermaid
add to engine
import Engine, { EngineInterface } from '@aomao/engine';import Mermaid , { MermaidComponent } from '@aomao/plugin-mermaid';new Engine(...,{ plugins:[Mermaid] , cards:[MermaidComponent]})
mermaid syntax (currently supports flowchart, sequence diagram, pie chart, Gantt chart, gitGraph, erDiagram, journey, stateDiagram)
2、https://mermaid-js.github.io/mermaid/#/n00b-syntaxReference
sequenceDiagramparticipant Aliceparticipant BobAlice->>John: Hello John, how are you?loop HealthcheckJohn->>John: Fight against hypochondriaendNote right of John: Rational thoughts <br/>prevail!John-->>Alice: Great!John->>Bob: How about you?Bob-->>John: Jolly good!
// can carry parameters, the second mermaid syntaxengine.command.execute('mermaid',`sequenceDiagramparticipant Aliceparticipant BobAlice->>John: Hello John, how are you?loop HealthcheckJohn->>John: Fight against hypochondriaendNote right of John: Rational thoughts <br/>prevail!John-->>Alice: Great!John->>Bob: How about you?Bob-->>John: Jolly good!`,);