package omd

  1. Overview
  2. Docs

Module OmdSource

A markdown parser in OCaml.

Sourcetype attributes = (string * string) list
Sourceand inline = {
  1. il_desc : inline_desc;
  2. il_attributes : attributes;
}
Sourceand inline_desc =
  1. | Concat of inline list
  2. | Text of string
  3. | Emph of inline
  4. | Strong of inline
  5. | Code of string
  6. | Hard_break
  7. | Soft_break
  8. | Image of link
  9. | Html of string
Sourcetype list_type =
  1. | Ordered of int * char
  2. | Bullet of char
Sourcetype list_spacing =
  1. | Loose
  2. | Tight
Sourcetype def_elt = {
  1. term : inline;
  2. defs : inline list;
}
Sourceand block = {
  1. bl_desc : block_desc;
  2. bl_attributes : attributes;
}
Sourceand block_desc =
  1. | Paragraph of inline
  2. | List of list_type * list_spacing * block list list
  3. | Blockquote of block list
  4. | Thematic_break
  5. | Heading of int * inline
  6. | Code_block of string * string
  7. | Html_block of string
  8. | Definition_list of def_elt list
Sourcetype doc = block list

A markdown document

Sourceval of_channel : in_channel -> doc
Sourceval of_string : string -> doc
Sourceval to_html : doc -> string
Sourceval to_sexp : doc -> string