module Textile:sig
..end
Textile markup language syntax tree
type
attr =
| |
Class of |
(* | p(myclass). | *) |
| |
Id of |
(* | p(#myid). | *) |
| |
Style of |
(* | p{color:red}. | *) |
| |
Language of |
(* | p[fr-fr]. | *) |
type
img_float =
| |
Float_left |
(* | < | *) |
| |
Float_right |
(* | > | *) |
Image float.
type
talign =
| |
Right |
(* | > | *) |
| |
Left |
(* | < | *) |
| |
Center |
(* | = | *) |
| |
Justify |
(* | <> | *) |
Text-alignment option.
type
valign =
| |
Top |
(* | ^ | *) |
| |
Middle |
(* | - | *) |
| |
Bottom |
(* | ~ | *) |
Vertical alignment.
typepadding =
int * int
Left and right padding consistently. Define with ( and ) in block modifier. (0,0) if padding doesn't set.
typeoptions =
attr list * talign option * padding
Phrases may be presents like HTML tags for text formatting. For
example, **ocaml is __functional__ language** is equivalent for ocaml
is functional language or Bold ([], [CData "ocaml is ";
Italic ([], [CData "functional"]); CData " language"])
type
phrase =
| |
CData of |
|||
| |
Emphasis of |
(* | _ | *) |
| |
Strong of |
(* | * | *) |
| |
Italic of |
(* | __ | *) |
| |
Bold of |
(* | ** | *) |
| |
Citation of |
(* | ?? | *) |
| |
Deleted of |
(* | - | *) |
| |
Inserted of |
(* | + | *) |
| |
Superscript of |
(* | ^ | *) |
| |
Subscript of |
(* | ~ | *) |
| |
Span of |
(* | % | *) |
| |
Code of |
(* | @ | *) |
| |
Notextile of |
(* | == | *) |
| |
Acronym of |
(* | ABC(Always Be Closing) | *) |
| |
Image of |
(* | !imgsrc(alt)! | *) |
| |
Link of |
(* | "linktext(title)":url | *) |
| |
Reference of |
(* | [1] | *) |
typeline =
phrase list
One line of text. It terminates by line break character.
typeelement =
int * line
One element of a list. It's a line and depth of element, or just count of asterisk or sharps.
typetableoptions =
options * valign option
Table specific options. May be applied to a table or to a row.
type
celltype =
| |
Data |
(* | | <...> | | *) |
| |
Head |
(* | |_. <...> | | *) |
In textile symbol _ defines a cell as a table header. Otherwise it's a regular data cell.
typecellspan =
int option * int option
Colspan and rowspan.
typecelloptions =
celltype * tableoptions * cellspan
Cell specific options.
typecell =
celloptions * line list
A cell in row.
typerow =
tableoptions * cell list
A row in table.
type
block =
| |
Header of |
(* | h1. | *) |
| |
Blockquote of |
(* | bq. | *) |
| |
Footnote of |
(* | fnn. | *) |
| |
Paragraph of |
(* | p. | *) |
| |
Blockcode of |
(* | bc. | *) |
| |
Pre of |
(* | pre. | *) |
| |
Blocknott of |
(* | notextile. | *) |
| |
Numlist of |
(* | # | *) |
| |
Bulllist of |
(* | * | *) |
| |
Table of |
(* | |t|a|b| | *) |
Extended blocks parse automaticly so there is no difference for you between normal and extended blocks.
val string_of_line : line -> string
Translates the line to a simple string which can be used, for example, in HTML's <title> tag. All markup will be removed.