-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathomd.mli
More file actions
60 lines (46 loc) · 1.36 KB
/
omd.mli
File metadata and controls
60 lines (46 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(** A markdown parser in OCaml. *)
type attributes = (string * string) list
type list_type =
| Ordered of int * char
| Bullet of char
type list_spacing =
| Loose
| Tight
type 'attr link =
{ label : 'attr inline
; destination : string
; title : string option
}
and 'attr inline =
| Concat of 'attr * 'attr inline list
| Text of 'attr * string
| Emph of 'attr * 'attr inline
| Strong of 'attr * 'attr inline
| Code of 'attr * string
| Hard_break of 'attr
| Soft_break of 'attr
| Link of 'attr * 'attr link
| Image of 'attr * 'attr link
| Html of 'attr * string
type 'attr def_elt =
{ term : 'attr inline
; defs : 'attr block list list
}
and 'attr block =
| Paragraph of 'attr * 'attr inline
| List of 'attr * list_type * list_spacing * 'attr block list list
| Blockquote of 'attr * 'attr block list
| Thematic_break of 'attr
| Heading of 'attr * int * 'attr inline
| Code_block of 'attr * string * string
| Html_block of 'attr * string
| Definition_list of 'attr * list_spacing * 'attr def_elt list
type doc = attributes block list
(** A markdown document *)
val of_channel : in_channel -> doc
val of_string : string -> doc
val to_html : doc -> string
val to_sexp : doc -> string
val headers :
?remove_links:bool -> 'attr block list -> ('attr * int * 'attr inline) list
val toc : ?start:int list -> ?depth:int -> doc -> doc