package html_of_jsx

  1. Overview
  2. Docs
Render HTML with JSX

Install

dune-project
 Dependency

Authors

Maintainers

Sources

html_of_jsx-0.0.9.tbz
sha256=edc7d6d604820ef20d76611eaf7fdc29c691dd9fb48ed9930900f7f331dfea02
sha512=35eead27322cc1d3b34e32ed964449ff83a75f74f01c1127d54504145192b9c7726820f4825f5c793bde0887df202e4769946782d4f42c40b3a5a609daa4aada

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.