1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use *;
/// Renders a mermaid diagram as inline SVG.
///
/// The diagram is rendered at build time by `merman`, a pure-Rust
/// mermaid engine, so the published site ships no JavaScript runtime
/// and no `.js` or `.css` asset: the SVG is produced while the page
/// data is generated and inlined into the page.
///
/// The colours come from a scoped stylesheet the engine appends to the
/// SVG itself. Every colour it names is a docs theme token, and CSS
/// custom properties inherit into an inline SVG, so the diagram follows
/// the root theme class — light or dark — with no re-render and no
/// `!important`.
///
/// A diagram the engine could not lay out never reaches this
/// component: the build keeps the ordinary code block instead, so the
/// source stays readable.
///
/// # Arguments
///
/// - `VirtualNode<DocsMermaidProps>` - The props node carrying the
/// rendered SVG of the diagram.
///
/// # Returns
///
/// - `VirtualNode` - The diagram virtual DOM tree.
pub