We define a representation of HTML trees including widget components.
A HTML tree which may contain widget components.
- element : String → Array (String × Lean.Json) → Array Html → Html
An
element "tag" attrs childrenrepresents<tag {...attrs}>{...children}</tag>. - text : String → Html
Raw HTML text.
- component : UInt64 → String → LazyEncodable Lean.Json → Array Html → Html
A
component h e props childrenrepresents<Foo {...props}>{...children}</Foo>, whereFoo : Component Propsis some component such thath = hash Foo.javascript,e = Foo.«export», andpropswill produce a JSON-encoded value of typeProps.
Instances For
@[instance_reducible]
Equations
@[instance_reducible]
Equations
- ProofWidgets.instRpcEncodableHtml = { rpcEncode := ProofWidgets.instRpcEncodableHtml.enc✝, rpcDecode := ProofWidgets.instRpcEncodableHtml.dec✝ }
def ProofWidgets.Html.ofComponent {Props : Type} [Lean.Server.RpcEncodable Props] (c : Component Props) (props : Props) (children : Array Html) :
Equations
- ProofWidgets.Html.ofComponent c props children = ProofWidgets.Html.component (hash c.javascript) c.export (Lean.Server.rpcEncode props) children