module Markdown:sig..end
type align =
| |
Left |
| |
Center |
| |
Right |
type href =
| |
URL of |
(* |
URL href is printed as it is.
| *) |
| |
Page of |
(* |
URL relative to a common root.
During pretty-printing, if given the path of the current
document, the string will be modified accordingly. For instance,
when writing to
foo/bar.md, Page "foo/bla.md" will be output as
(bla.md). | *) |
| |
Section of |
(* |
URL of an anchor within a
Page, see above. | *) |
type inline =
| |
Plain of |
(* |
Printed as it is
| *) |
| |
Emph of |
(* |
Printed as
"_……_" | *) |
| |
Bold of |
(* |
Printed as
"**……**" | *) |
| |
Inline_code of |
(* |
Printed as
"`……`" | *) |
| |
Link of |
(* |
Hyperlink with text and URL
| *) |
| |
Image of |
(* | Image(alt,path) with alternative text and image file | *) |
typetext =inline list
type block_element =
| |
Text of |
(* |
Single paragraph of text.
| *) |
| |
Block_quote of |
|||
| |
UL of |
|||
| |
OL of |
|||
| |
DL of |
(* |
definition list
| *) |
| |
EL of |
(* |
example list
| *) |
| |
Code_block of |
typeblock =block_element list
type table = {
|
caption : |
|
header : |
|
content : |
type element =
| |
Comment of |
(* |
markdown comment, printed <!-- like this -->
| *) |
| |
Block of |
|||
| |
Table of |
|||
| |
Raw of |
(* |
Each element of the list is printed as-is on its own line.
A blank line separates the
Raw node from the next one. | *) |
| |
H1 of |
|||
| |
H2 of |
|||
| |
H3 of |
|||
| |
H4 of |
|||
| |
H5 of |
|||
| |
H6 of |
typeelements =element list
type pandoc_markdown = {
|
title : |
|
: |
|
date : |
|
elements : |
Remark: text values are list of inline values, hence
you may combined with the (@) operator or with the glue ?sep utility
function (see below).
val plain : string -> textval emph : string -> textval bold : string -> textval code : string -> textval image : alt:string -> file:string -> textval href : ?text:text -> href -> textval link : ?text:text -> ?page:string -> ?name:string -> unit -> textval url : ?text:text -> string -> textval format : ('a, Format.formatter, unit, text) Pervasives.format4 -> 'a
Remark: block values are list of block_element values, hence
you may combined with the (@) operator or with the glue ?sep utility
function (see below).
val text : text -> blockval list : block list -> blockval enum : block list -> blockval description : (text * text) list -> blockval codeblock : ?lang:string ->
('a, Format.formatter, unit, block) Pervasives.format4 -> 'acodeblock lang "...." returns a Code_block for code,
written in lang with the given formatted content.
The code block content placed inside an englobing hv-box, trimed
and finally splitted into lines.
Remark: elements values are list of element values, hence
you may combined with the (@) operator or with the glue ?sep utility
function (see below).
val par : text -> elementsval block : block -> elementsval rawfile : string -> elementsSys_error if there's no such file.val pandoc : ?title:text ->
?authors:text list ->
?date:text -> elements -> pandoc_markdownval section : ?name:string -> title:string -> elements -> elementsH1 header with the given title on top of the given elements.
If name is not explicitly provided,
the header will have as associated anchor id titleval subsections : elements -> elements list -> elementssubsections header body returns a list of elements where the body's
headers have been increased by one (i.e. H1 becomes H2).
H5 stays at H5, though.val glue : ?sep:'a list -> 'a list list -> 'a listtext, block
and elements.
Default separator is empty. The function is tail-recursive.val label : string -> stringval pp_inline : ?page:string -> Format.formatter -> inline -> unit
val pp_text : ?page:string -> Format.formatter -> text -> unit
val pp_block_element : ?page:string -> Format.formatter -> block_element -> unit
val pp_block : ?page:string -> Format.formatter -> block -> unit
val pp_element : ?page:string -> Format.formatter -> element -> unit
val pp_elements : ?page:string -> Format.formatter -> elements -> unit
val pp_pandoc : ?page:string -> Format.formatter -> pandoc_markdown -> unit