package html_of_jsx
Render HTML with JSX
Install
Dune Dependency
Authors
Maintainers
Sources
html_of_jsx-0.0.4.tbz
sha256=12c49cb44a7476921d097248540e222cb412cf49a283cc20b92775e2bf2b9c39
sha512=96748d99db49817a900ce2b310d5f496cee5e96ba1c90611d204c397549e55797eb76f0952912bcfd5be17e06cf5029fb85b19417ea47ba4543103eb0536ab55
doc/html_of_jsx/JSX/index.html
Module JSX
Source
Declaratively create HTML elements with JSX using OCaml/Reason.
let html: string = JSX.render (
<div>
<h1> {JSX.string("Hello, World!")} </h1>
</div>
)
Source
type attribute =
string
* [ `Bool of bool | `Int of int | `Float of float | `String of string ]
The type that represents a JSX.element
Render a JSX.element to a string.
let html: string = JSX.render (
<div>
<h1> (JSX.string "Hello, World!") </h1>
</div>
)
The function to create a HTML DOM Node https://developer.mozilla.org/en-US/docs/Web/API/Node
. Given the tag, list of attributes and list of children.
JSX.node(
"a",
[JSX.Attribute.String(("href", "https://ocaml.org"))],
[JSX.string("OCaml")],
);
Helper to bypass HTML encoding and treat output as unsafe. This can lead to HTML scaping problems, XSS injections and other security concerns, use with caution.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>