Module Djot.Html

type t = Kernel.Html.helt =
  1. | HText of string
    (*

    Escaped when serialized.

    *)
  2. | HRaw of string
    (*

    Written as is.

    *)
  3. | HVoid of string * bool * Attr.t
    (*

    HVoid (tag, self_closing, attrs): no closing tag.

    *)
  4. | HElem of string * int * Attr.t * t list
    (*

    HElem (tag, newlines, attrs, children). newlines is 2 for a newline after both tags, 1 after the closing tag only, 0 for neither.

    *)
val tree : Doc.t -> t list

The output before serialization, for post-processing.

val to_string : t list -> string
val of_doc : Doc.t -> string
val of_blocks : Block.t node list -> string

The HTML of blocks that are not in a document, such as a tree built in code or the blocks Stream returns. Headings get identifiers and sections, and footnotes and references are resolved among these blocks, as Doc.of_string does for a text.

The blocks must have no Block.t.Section. For a parsed document use of_doc.