Module Verbatim

module Verbatim: sig .. end
Handling verbatim environments

This module provides functions to generate verbatim (preformatted) content, and a preliminary support for syntax highlighting for a few predefined languages.


val file_cache : (string, Pervasives.out_channel * int) Hashtbl.t
val lines_to_file : string list -> string option -> unit
lines_to_file lines fn writes the lines lines to the optional file fn if it is provided. Do nothing otherwise.
val glue_space : int -> Document.content
glue_space n corresponds to n spaces from the font.
val lines_skip : int Pervasives.ref
val line_per_line : Document.tree_zipper Pervasives.ref ->
(string -> Document.content list) -> string list -> unit
line_per_line f lines builds each line of lines using f and display each of them using the verbatim font.
type param = {
   keywords : string list;
   separators : string list;
   symbols : (string * Document.content) list;
}
Parameter type for the word handler below.
val handle_spaces : param ->
(string -> Document.content list) -> string -> Document.content list
handle_spaces w_to_c line builds a line using the function w_to_c to build words (i.e. sections without spaces) and takes care of the spaces (one text space is as wide as any other character).
val fit_on_grid : Document.content -> Document.content
fit_on_grid c adds spacing on both sides of the content element c so that its width becomes a multiple of the width of a single character.
val symbol : string -> Document.content
symbol s build a mathematical symbole from the string s. Its width on the page will be a multiple of the width of one verbatim character.
exception Found_symbol of int * string * Document.content
val handle_word : param -> string -> Document.content list
handle_word par w build the contents corresponding to the word w. The par variable provides parameters for keywords to be put in bold and special symbols to be displayed using the maths font.
val verb_text : (string -> Document.content list) -> string -> Document.content list
verb_text build s builds verbatim contents from a string s and a generation function build.
val param_Default : param
val param_SML : param
val param_OCaml : param
val param_PML : param
val param_Python : param
val lang_Default : string list -> Document.content list list
val line_to_contents : param -> string -> Document.content list
val lines_to_contents : param -> string list -> Document.content list list
val lang_OCaml : string list -> Document.content list list
val lang_SML : string list -> Document.content list list
val lang_PML : string list -> Document.content list list
val lang_Python : string list -> Document.content list list
val verb_OCaml : string -> Document.content list
val verb_SML : string -> Document.content list
val verb_PML : string -> Document.content list
val verb_Python : string -> Document.content list