Instances For
Equations
- ProofWidgets.Penrose.instInhabitedDiagramProps = { default := { embeds := default, dsl := default, sty := default, sub := default } }
Equations
- One or more equations did not get rendered due to their size.
Displays the given diagram using Penrose.
The website contains explanations of how to write domain (dsl
), style (sty
),
and substance (sub
) programs.
The diagram may also contain embedded HTML trees which are specified in embeds
.
Each embed is HTML together with the name of an object x
in the substance program.
The object x
can be of any type but must be assigned an x.textBox : Rectangle
field
in the style program.
This rectangle will be replaced with the HTML tree.
Its dimensions will be overridden in the style program
to match those of the HTML node.
The following additional constants are prepended to the style program:
theme {
color foreground
color tooltipBackground
color tooltipForeground
color tooltipBorder
}
and can be accessed as, for example, theme.foreground
in the provided sty
in order to match
the editor theme.
Instances For
PenroseBuilderM
#
- sub : String
The Penrose substance program. Note that
embeds
are added lazily at the end. - embeds : Lean.HashMap String (String × ProofWidgets.Html)
Components to display as labels in the diagram, stored in the map as name ↦ (type, html).
Instances For
A monad to easily build Penrose diagrams in.
Instances For
Assemble the diagram using the provided domain and style programs.
none
is returned iff nothing was added to the diagram.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add an object nm
of Penrose type tp
,
labelled by h
, to the substance program.
Equations
- ProofWidgets.Penrose.DiagramBuilderM.addEmbed nm tp h = modify fun (st : ProofWidgets.Penrose.DiagramState) => { sub := st.sub, embeds := st.embeds.insert nm (tp, h) }
Instances For
Add an object of Penrose type tp
,
corresponding to (and labelled by) the expression e
,
to the substance program.
Return its Penrose name.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Add an instruction i
to the substance program.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- x.run = StateT.run' x { sub := "", embeds := Lean.HashMap.empty }
Instances For
Abbreviation for backwards-compatibility.
Instances For
Abbreviation for backwards-compatibility.