Lean4
/-- Construct a commutative diagram from a Penrose `sub`stance program and expressions `embeds` to
display as labels in the diagram. -/
def mkCommDiag (sub : String) (embeds : ExprEmbeds) : MetaM Html := do
let embeds ← embeds.mapM fun (s, h) => return (s, <InteractiveCode fmt={← Widget.ppExprTagged h}/>)
return
(<PenroseDiagram
embeds={embeds}dsl={include_str
".." / ".." / ".." / "widget" / "src" / "penrose" /
"commutative.dsl"}sty={include_str
".." / ".." / ".." / "widget" / "src" / "penrose" / "commutative.sty"}sub={sub}/>)