Module Djot.Block

type list_spacing = Kernel.Ast.list_spacing =
  1. | Tight
  2. | Loose
type ordered_list_style = Kernel.Ast.ordered_list_style =
  1. | Decimal
  2. | LetterUpper
  3. | LetterLower
  4. | RomanUpper
  5. | RomanLower
type ordered_list_delim = Kernel.Ast.ordered_list_delim =
  1. | RightPeriod
  2. | RightParen
  3. | LeftRightParen
type ordered_list_attributes = Kernel.Ast.ordered_list_attributes = {
  1. ol_style : ordered_list_style;
  2. ol_delim : ordered_list_delim;
  3. ol_start : int;
}
type task_status = Kernel.Ast.task_status =
  1. | Complete
  2. | Incomplete
type align = Kernel.Ast.align =
  1. | AlignLeft
  2. | AlignRight
  3. | AlignCenter
  4. | AlignDefault
type cell_type = Kernel.Ast.cell_type =
  1. | HeadCell
  2. | BodyCell
type cell = Kernel.Ast.cell =
  1. | Cell of cell_type * align * Inline.t node list
type callout_fold = Kernel.Ast.callout_fold =
  1. | FoldExpanded
  2. | FoldCollapsed
type t = Kernel.Ast.block =
  1. | Para of Inline.t node list
  2. | Section of t node list
    (*

    a heading (the first child) and the blocks up to the next heading of the same or a higher level. The heading's id is on the section node.

    *)
  3. | Heading of int * Inline.t node list
  4. | BlockQuote of t node list
  5. | CodeBlock of string * string
  6. | Div of string * t node list
    (*

    The string is a name, written ::: name where djot reads a class, an extension (Profile.with_ext_tags); empty means unnamed.

    *)
  7. | OrderedList of ordered_list_attributes * list_spacing * t node list node list
    (*

    Each item is a node, with its own location.

    *)
  8. | BulletList of char * list_spacing * t node list node list
    (*

    The character is the marker the items are written with: -, + or *, or : where definition lists are off.

    *)
  9. | TaskList of list_spacing * (task_status * t node list) node list
  10. | DefinitionList of list_spacing * (Inline.t node list node * t node list node) node list
    (*

    Each item holds its term and its definition.

    *)
  11. | ThematicBreak
  12. | Table of Inline.t node list node * cell node list node list
    (*

    Caption, then rows of cells. A caption with no inlines is no caption.

    *)
  13. | RawBlock of string * string
  14. | FootnoteDef of string * t node list
    (*

    A definition stays where it was written; Doc.footnotes is collected from these.

    *)
  15. | RefDef of string * string
  16. | AttrBlock
    (*

    Block attributes with no block after them: the node has the attributes. It renders to no HTML.

    *)
  17. | Ext_keyed of Inline.t node list * t node
    (*

    An extension: label: content.

    *)
  18. | Ext_callout of string * callout_fold option * Inline.t node list * t node list
    (*

    Kind, fold marker, inline title, and body.

    *)
val to_string : ?profile:Profile.t -> ?style:style -> t node list -> string

The blocks as djot source, for the source of one node or of a mapped tree. Unlike Doc.to_string, a heading's identifier is always written as an attribute.

  • parameter style

    default `Checked