We define a representation of HTML trees together with a JSX-like DSL for writing them.
A HTML tree which may contain widget components.
- element: String → Array (String × Lean.Json) → Array ProofWidgets.Html → ProofWidgets.Html
An
element "tag" attrs children
represents<tag {...attrs}>{...children}</tag>
. - text: String → ProofWidgets.Html
Raw HTML text.
- component: UInt64 → String → ProofWidgets.LazyEncodable Lean.Json → Array ProofWidgets.Html → ProofWidgets.Html
A
component h e props children
represents<Foo {...props}>{...children}</Foo>
, whereFoo : Component Props
is some component such thath = hash Foo.javascript
,e = Foo.«export»
, andprops
will produce a JSON-encoded value of typeProps
.
Instances For
Equations
- ProofWidgets.instInhabitedHtml = { default := ProofWidgets.Html.element default default default }
Equations
- ProofWidgets.instRpcEncodableHtml = { rpcEncode := ProofWidgets.instRpcEncodableHtml.enc✝, rpcDecode := ProofWidgets.instRpcEncodableHtml.dec✝ }
Equations
- <c {...props}>{...children}</c> = ProofWidgets.Html.component (hash c.javascript) c.export (Lean.Server.rpcEncode props) children
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.Jsx.jsxAttrVal_ = Lean.ParserDescr.node `ProofWidgets.Jsx.jsxAttrVal_ 1022 (Lean.ParserDescr.const `str)
Instances For
Interpolates an expression into a JSX attribute literal
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interpolates an array of expressions into a JSX attribute literal
Equations
- One or more equations did not get rendered due to their size.
Instances For
Characters not allowed inside JSX plain text.
Equations
- ProofWidgets.Jsx.jsxTextForbidden = "{<>}$"
Instances For
A plain text literal for JSX (notation for Html.text
).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.Jsx.getJsxText x = x.raw[0].getAtomVal
Instances For
Equations
- ProofWidgets.Jsx.jsxText.formatter = Lean.PrettyPrinter.Formatter.visitAtom `ProofWidgets.Jsx.jsxText
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.Jsx.jsxChild_ = Lean.ParserDescr.node `ProofWidgets.Jsx.jsxChild_ 1022 (Lean.ParserDescr.parser `ProofWidgets.Jsx.jsxText)
Instances For
Interpolates an array of elements into a JSX literal
Equations
- One or more equations did not get rendered due to their size.
Instances For
Interpolates an expression into a JSX literal
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- ProofWidgets.Jsx.jsxChild__1 = Lean.ParserDescr.node `ProofWidgets.Jsx.jsxChild__1 1022 (Lean.ParserDescr.cat `jsxElement 0)
Instances For
Equations
- ProofWidgets.Jsx.term_ = Lean.ParserDescr.node `ProofWidgets.Jsx.term_ 1024 (Lean.ParserDescr.cat `jsxElement 0)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
First delaborate into our non-term TSyntax
. Note this means we can't call delab
,
so we have to add the term annotations ourselves.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Now wrap our TSyntax _
delaborators into Term
elaborators.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.