Statocles::Plugin::Diagram::Mermaid - Render diagrams using mermaid https://mermaidjs.github.io
version 0.088
# --- Configuration # site.yml --- site: class: Statocles::Site args: plugins: diagram: $class: Statocles::Plugin::Diagram::Mermaid # --- Usage <%= diagram mermaid => begin %> sequenceDiagram loop every day Alice->>John: Hello John, how are you? John-->>Alice: Great! end <% end %>
This plugin adds the diagram helper function to all templates and content documents, allowing for creation of mermaid diagrams.
diagram
Set the url to use as a, possibly local, alternative to the default script mermaid.min.js for including in a script tag.
%= diagram $type => $content
Wrap the given $content with the html for displaying the diagram with mermaid.js.
$content
mermaid.js
In most cases displaying a diagram will require the use of begin/end:
begin
end
%= diagram mermaid => begin graph TD A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} C -->|One| D[Laptop] C -->|Two| E[iPhone] C -->|Three| F[Car] % end
Register this plugin with the site. Called automatically.
Doug Bell <preaction@cpan.org>
This software is copyright (c) 2016 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Statocles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Statocles
CPAN shell
perl -MCPAN -e shell install Statocles
For more information on module installation, please visit the detailed CPAN module installation guide.