module SyntaxTree::Mermaid
This module is responsible for rendering mermaid (mermaid.js.org/) flow charts.
Public Class Methods
Source
# File lib/syntax_tree/mermaid.rb, line 158 def escape(label) "\"#{CGI.escapeHTML(label)}\"" end
Escape a label to be used in the mermaid syntax. This is used to escape HTML entities such that they render properly within the quotes.
Source
# File lib/syntax_tree/mermaid.rb, line 165 def flowchart flowchart = FlowChart.new if block_given? yield flowchart flowchart.render else flowchart end end
Create a new flowchart. If a block is given, it will be yielded to and the flowchart will be rendered. Otherwise, the flowchart will be returned.