Skip to main content

render_diagram

Function render_diagram 

Source
pub(crate) fn render_diagram(
    source: &str,
    ordinal: usize,
) -> Result<String, String>
Expand description

渲染一张图的浅色与深色两份 SVG,返回两个 div。

ordinal 为该图在文档中的序号,与源码摘要一起构成 SVG id,保证同页多图 id 不冲突、 同一输入结果完全确定(往返守卫依赖这一点)。