package html_of_jsx

  1. Overview
  2. Docs
Render HTML with JSX

Install

dune-project
 Dependency

Authors

Maintainers

Sources

html_of_jsx-0.1.1.tbz
sha256=2de32525b5f38b4765c1bbfeba35fcfcc6d26b66a244374e86e109129bb729a6
sha512=a5a27d16aed5c3f8fcacd72578ad63c63cd33276356883fcf282709a56b574a92d35d1af2ae18a61491a28a86b89f4571d8596e000ae4e06201758eb3d8892e5

doc/ppx.html

Preprocessing flags

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

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.