HTML content, which may be either a single node or a sequence of sibling nodes.
This type is optimized for convenient authoring of HTML documents. It is not formally related to the HTML DOM representation. It is analogous to React's Fragment.
- element (tag : String) (attrs : Array (String × String)) (children : Html) : Html
An element with the given tag name, attributes, and children.
- text : String → Html
Textual content.
The characters
&,<, and>are always escaped to HTML entities during rendering. Userawin raw text elements (scriptandstyle) instead. - raw : String → Html
Characters to be copied verbatim (and not escaped) during rendering.
- seq : Array Html → Html
A sequence of HTML values.
Instances For
Equations
- Lean.instReprHtml = { reprPrec := Lean.instReprHtml.repr }
Equations
- Lean.instInhabitedHtml = { default := Lean.instInhabitedHtml.default }
Equations
- Lean.instBEqHtml = { beq := Lean.instBEqHtml.beq }
Equations
Equations
- Lean.instTypeNameHtml = Lean.inst✝
Equations
- Lean.instToExprHtml = { toExpr := Lean.instToExprHtml.toExpr, toTypeExpr := Lean.Expr.const `Lean.Html [] }
Whether this HTML is rendered as the empty string.
Equations
Instances For
If escape is true,
then characters such as & are escaped
to entities such as & during rendering.
Use false in raw text elements (script and style).
Equations
- Lean.Html.ofString escape = if escape = true then Lean.Html.text else Lean.Html.raw
Instances For
Equations
- Lean.Html.instCoeString = { coe := Lean.Html.text }
Appends two HTML forests.
Equations
Instances For
Equations
- Lean.Html.instAppend = { append := Lean.Html.append }
Merges an array of HTML values by appending them.
Like seq, but may produce a more compact representation.
Equations
Instances For
Merges a list of HTML values by appending them.
Like seq hs.toArray, but may produce a more compact representation.
Equations
Instances For
Equations
- Lean.Html.instCoeArray = { coe := Lean.Html.ofArray }
Equations
- Lean.Html.instCoeList = { coe := Lean.Html.ofList }
Equations
- Lean.Html.instCoeOption = { coe := Lean.Html.ofOption }
A compact JSON encoding of Html.
Equations
- Lean.Html.instToJson = { toJson := Lean.Html.instToJson.to }
Equations
- One or more equations did not get rendered due to their size.
- Lean.Html.instToJson.to (Lean.Html.text t) = Lean.Json.str t
- Lean.Html.instToJson.to (Lean.Html.raw r) = Lean.Json.mkObj [("r", Lean.toJson r)]
- Lean.Html.instToJson.to (Lean.Html.seq hs) = Lean.Json.arr (Array.map Lean.Html.instToJson.to hs)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Equations
Rewrites the forest by using fn to transform every node.
Traversal proceeds in post-order:
fn receives element and seq nodes with already-rewritten children.
Equations
- Lean.Html.rewritePost fn h = (Lean.Html.rewritePostM fn h).run