module Rigor::ModuleGraph::HtmlView
Self-contained HTML document that embeds Mermaid output inline so it renders without any local server (works over +file://+, no fetch).
The view loads +mermaid@10+ from a CDN at render time. The only network access is that one CDN URL; if a project needs to ship a fully offline page, render the SVG via Graphviz and embed that instead.
The HTML body lives in +lib/rigor/module_graph/templates/view.html.erb+; bumping styling or Mermaid init options is an edit of that file alone.
Constants
- TEMPLATE_PATH
Public Instance Methods
Source
# File lib/rigor/module_graph/html_view.rb, line 29 def render(title:, mermaid_source:, subtitle: nil) indented = mermaid_source.strip.gsub("\n", "\n ") template.result_with_hash( title: title, subtitle: subtitle, indented_mermaid: indented ) end
@param title [String] page <title> and <h1> text @param mermaid_source [String] the mermaid flowchart body @param subtitle [String, nil] one-line caption under the H1 @return [String] the rendered HTML document
Source
# File lib/rigor/module_graph/html_view.rb, line 38 def template @template ||= ERB.new(File.read(TEMPLATE_PATH), trim_mode: "-") end