module Textile: sig
.. end
Textile markup language syntax tree
Author(s): Alexander Markov [email protected]
See also the official textile reference manual
Textile syntax tree
Options
type
attr =
| |
Class of string |
| |
Id of string |
| |
Style of string |
| |
Language of string |
type
img_float =
| |
Float_left |
| |
Float_right |
Image float.
type
talign =
| |
Right |
| |
Left |
| |
Center |
| |
Justify |
Text-alignment option.
type
valign =
Vertical alignment.
type
padding = int * int
Left and right padding consistently. Define with ( and ) in block
modifier. (0,0) if padding doesn't set.
type
options = attr list * talign option * padding
Content
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 string |
| |
Emphasis of (attr list * phrase list) |
| |
Strong of (attr list * phrase list) |
| |
Italic of (attr list * phrase list) |
| |
Bold of (attr list * phrase list) |
| |
Citation of (attr list * phrase list) |
| |
Deleted of (attr list * phrase list) |
| |
Inserted of (attr list * phrase list) |
| |
Superscript of (attr list * phrase list) |
| |
Subscript of (attr list * phrase list) |
| |
Span of (attr list * phrase list) |
| |
Code of (attr list * string) |
| |
Notextile of string |
| |
Acronym of string * string |
| |
Image of attr list * img_float option * string * string option |
| |
Link of (attr list * phrase list) * string option * string |
| |
Reference of int |
type
line = phrase list
One line of text. It terminates by line break character.
type
element = int * line
One element of a list. It's a line and depth of element,
or just count of asterisk or sharps.
Tables
type
tableoptions = options * valign option
Table specific options. May be applied to a table or to a row.
type
celltype =
In textile symbol _ defines a cell as a table header. Otherwise
it's a regular data cell.
type
cellspan = int option * int option
Colspan and rowspan.
type
celloptions = celltype * tableoptions * cellspan
Cell specific options.
type
cell = celloptions * line list
A cell in row.
type
row = tableoptions * cell list
A row in table.
Blocks
type
block =
Extended blocks parse automaticly so there is no difference for you between normal and extended blocks.
Translation
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.