package html_of_jsx

  1. Overview
  2. Docs
Render HTML writing JSX

Install

Dune Dependency

Authors

Maintainers

Sources

html_of_jsx-0.0.1.tbz
sha256=d1a36abcbebd23adfaffe9eed27e69045c1e112da17bfebc385355d2a64f1fb7
sha512=bee674151f2ab6fba41acc1234118b5eca5379aedab2907da517bdeb604ddd02807519b9b29b4eea09595ced9936300b9a6ebf16c9edd92d959151daab4e7a96

doc/html_of_jsx.lib/Jsx/index.html

Module JsxSource

Sourcemodule Attribute : sig ... end
Sourcetype node = {
  1. tag : string;
  2. attributes : Attribute.t list;
  3. children : element list;
}
Sourceand element =
  1. | Null
  2. | Text of string
  3. | Fragment of element list
  4. | Node of node
  5. | Component of unit -> element
  6. | List of element list

The type that represents a Jsx.element, it's a recursive type that allows to represent any HTML structure

Sourceval text : string -> element

Helper to represent an element as a string

Sourceval null : element

Helper to represent nullability in Jsx, useful to pattern match

Sourceval int : int -> element

Helper to render an integer (uses string_of_int)

Sourceval float : float -> element

Helper to render an integer (uses string_of_float)

Sourceval list : element list -> element
Sourceval fragment : element list -> element

Fragment

Sourceval node : string -> Attribute.t list -> element list -> element

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 childrens

OCaml

Innovation. Community. Security.