package html_of_jsx

  1. Overview
  2. Docs
Render HTML with JSX

Install

dune-project
 Dependency

Authors

Maintainers

Sources

html_of_jsx-0.1.0.tbz
sha256=a62b73fe66b6e40196cc06cc0771184d42923e9c571183ecc793cd58f0b407dd
sha512=b25ba1321a5413942bf781aa9a8cacdc92eb03c1099a4c564a061b32cc57bbae571465d123d98548aba1cc78c3bb79fbf415e29934a8318c15ab9ffc0ea8cceb

doc/ppx.html

ppx

The html_of_jsx.ppx preprocessor transforms JSX syntax into efficient HTML rendering code, validating attributes and their types at compile time.

Settings

Pass flags after html_of_jsx.ppx in your dune (preprocess ...) stanza.

-htmx

Enables htmx attributes (hx_get, hx_post, hx_swap, ...) and extension-specific attributes (sse_connect, ws_send, ...) on all HTML elements.

(preprocess (pps html_of_jsx.ppx -htmx))

Requires the html_of_jsx.htmx library for the <Htmx /> script loader. See HTMX mode.

-react

Enables React DOM aliases: className maps to class and htmlFor maps to for. Useful as a migration bridge from React/Reason-React codebases.

(preprocess (pps html_of_jsx.ppx -react))

See React compatibility.

-disable-static-opt

Disables compile-time static analysis and optimization. Every element falls back to the generic JSX.node constructor. Useful for debugging the ppx output.

(preprocess (pps html_of_jsx.ppx -disable-static-opt))

For details on what the static optimization does, see How the ppx works.