Skip to content

A mermaid.js diagram renderer for ReSpec.

License

Notifications You must be signed in to change notification settings

LegReq/respec-mermaid

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mermaid.js for ReSpec

This ReSpec extension allows you to embed mermaid.js diagrams in your specification.

Mermaid lets you create diagrams and visualizations using text and code. It is a Javascript based diagramming and charting tool that renders Markdown-inspired text definitions to create and modify diagrams dynamically.

An example of the output of this extension is provided below (this extension renders the SVG diagram shown below):

image

Usage

To use this extension, include the following line in your ReSpec file:

<script class="remove" src="https://cdn.jsdelivr.net/gh/digitalbazaar/[email protected]/dist/main.js"></script>

and set the following configuration option in your ReSpec configuration:

preProcess: [window.respecMermaid.createFigures]

Note that there might be releases later than the one listed above. Check this repository's tags for all known releases.

ReSpec Markup

To use this extension, you must add the mermaid class to your content block.

<figure>
  <pre class="diagram mermaid">
sequenceDiagram
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!
    Alice-)John: See you later!
  </pre>
  <figcaption>A sequence diagram example</figcaption>
</figure>

For more examples of mermaid.js markup, see the official documentation.

About

A mermaid.js diagram renderer for ReSpec.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 57.6%
  • JavaScript 42.4%