sig
module Signatures :
sig
module Error :
sig
type gravity = [ `error | `fatal_error | `warning ]
type message =
[ `bad_size_specification_in_image of string
| `begin_without_arg
| `cell_inside_cell
| `cell_out_of_table
| `closing_brace_matching_begin
| `command_shouldnot_have_args of string
| `end_of_input_not_in_text of string
| `ignored_text_after_verbatim_begin of string
| `invalid_end_pattern of string
| `item_out_of_list
| `malformed_verbatim_begin
| `non_matching_end
| `nothing_to_end_with_brace
| `terminating_with_open_environments of string list
| `transformer_lost of string
| `unknown_command of string
| `unknown_list_style of string
| `unknown_quotation_style of string ]
type location =
Bracetax_error.location = {
l_line : int;
l_char : int;
l_file : string;
}
type error =
[ `message of location * gravity * message
| `undefined of string ]
type error_fun = error -> unit
val mk : location -> gravity -> message -> error
val to_string :
location * [< `error | `fatal_error | `warning ] * message ->
string
end
type writer =
Bracetax_signatures.writer = {
w_write : string -> unit;
w_error : Error.error -> unit;
}
val make_writer :
write:(string -> unit) -> error:(Error.error -> unit) -> writer
type printer =
Bracetax_signatures.printer = {
print_comment : Error.location -> string -> unit;
print_text : Error.location -> string -> unit;
enter_cmd : Error.location -> string -> string list -> unit;
leave_cmd : Error.location -> unit;
terminate : Error.location -> unit;
is_raw : string -> bool;
default_raw_end : string -> string;
enter_raw : Error.location -> string -> string list -> unit;
print_raw : Error.location -> string -> unit;
leave_raw : Error.location -> unit;
error : Error.error -> unit;
}
end
module Parser :
sig
module Signatures :
sig
module Error :
sig
type gravity = [ `error | `fatal_error | `warning ]
type message =
[ `bad_size_specification_in_image of string
| `begin_without_arg
| `cell_inside_cell
| `cell_out_of_table
| `closing_brace_matching_begin
| `command_shouldnot_have_args of string
| `end_of_input_not_in_text of string
| `ignored_text_after_verbatim_begin of string
| `invalid_end_pattern of string
| `item_out_of_list
| `malformed_verbatim_begin
| `non_matching_end
| `nothing_to_end_with_brace
| `terminating_with_open_environments of string list
| `transformer_lost of string
| `unknown_command of string
| `unknown_list_style of string
| `unknown_quotation_style of string ]
type location =
Bracetax_error.location = {
l_line : int;
l_char : int;
l_file : string;
}
type error =
[ `message of location * gravity * message
| `undefined of string ]
type error_fun = error -> unit
val mk : location -> gravity -> message -> error
val to_string :
location * [< `error | `fatal_error | `warning ] * message ->
string
end
type writer =
Bracetax_signatures.writer = {
w_write : string -> unit;
w_error : Error.error -> unit;
}
val make_writer :
write:(string -> unit) -> error:(Error.error -> unit) -> writer
type printer =
Bracetax_signatures.printer = {
print_comment : Error.location -> string -> unit;
print_text : Error.location -> string -> unit;
enter_cmd : Error.location -> string -> string list -> unit;
leave_cmd : Error.location -> unit;
terminate : Error.location -> unit;
is_raw : string -> bool;
default_raw_end : string -> string;
enter_raw : Error.location -> string -> string list -> unit;
print_raw : Error.location -> string -> unit;
leave_raw : Error.location -> unit;
error : Error.error -> unit;
}
end
val ( ~% ) : ('a, unit, string) format -> 'a
val check_end_pattern : string -> bool
val err :
Bracetax_signatures.printer ->
Bracetax_signatures.Error.location ->
Bracetax_signatures.Error.message -> unit
val loc : int -> string -> Bracetax_signatures.Error.location
val incr_loc :
Bracetax_signatures.Error.location ->
Bracetax_signatures.Error.location
val mv_loc :
Bracetax_signatures.Error.location ->
int -> Bracetax_signatures.Error.location
type t =
Bracetax_parser.t = {
printer : Signatures.printer;
read_fun : unit -> char option;
deny_bypass : bool;
}
val parse_text : t -> Bracetax_signatures.Error.location -> unit
val parse_comment : t -> Bracetax_signatures.Error.location -> unit
val parse_command : t -> Bracetax_signatures.Error.location -> unit
val parse_raw :
t -> Bracetax_signatures.Error.location -> string -> unit
val do_transformation :
?deny_bypass:bool ->
Signatures.printer -> (unit -> char option) -> string -> unit
end
val opt_may : f:('a -> unit) -> 'a option -> unit
val brtx_to_html :
writer:Bracetax_HTML_printer.Signatures.writer ->
?make_section_links:[ `always | `never | `when_labeled ] ->
?doc:bool ->
?title:string ->
?css_link:string ->
?print_comments:bool ->
?filename:string ->
?class_hook:string ->
?img_hook:(string -> string) ->
?url_hook:(string -> string) ->
input_char:(unit -> char option) ->
?separate_header:(string * string * string) ref ->
?deny_bypass:bool -> unit -> unit
val brtx_to_latex :
writer:Bracetax_latex_printer.Signatures.writer ->
?doc:bool ->
?title:string ->
?use_package:string ->
?deny_bypass:bool ->
?print_comments:bool ->
?href_is_footnote:bool ->
?img_hook:(string -> string) ->
?url_hook:(string -> string) ->
?separate_header:(string * string * string) ref ->
?table_caption_after:bool ->
?filename:string -> input_char:(unit -> char option) -> unit -> unit
val get_TOC :
writer:Bracetax_generic_printer.Signatures.writer ->
?filename:string ->
?make_links:[ `always | `never | `when_labeled ] ->
?list_type:[ `enum | `item ] ->
?numbering:[ `integers | `none ] ->
input_char:(unit -> char option) -> unit -> unit
val string_io :
string ->
Buffer.t ->
Buffer.t -> Bracetax_signatures.writer * (unit -> char option)
val str_to_html :
?make_section_links:[ `always | `never | `when_labeled ] ->
?doc:bool ->
?title:string ->
?css_link:string ->
?print_comments:bool ->
?filename:string ->
?class_hook:string ->
?img_hook:(string -> string) ->
?url_hook:(string -> string) ->
?separate_header:(string * string * string) ref ->
?deny_bypass:bool ->
string -> string * Bracetax_signatures.Error.error list
val str_to_latex :
?doc:bool ->
?title:string ->
?use_package:string ->
?deny_bypass:bool ->
?print_comments:bool ->
?href_is_footnote:bool ->
?img_hook:(string -> string) ->
?url_hook:(string -> string) ->
?table_caption_after:bool ->
?separate_header:(string * string * string) ref ->
?filename:string ->
string -> string * Bracetax_signatures.Error.error list
val str_to_TOC :
?make_links:[ `always | `never | `when_labeled ] ->
?list_type:[ `enum | `item ] ->
?numbering:[ `integers | `none ] ->
?filename:string ->
string -> string * Bracetax_signatures.Error.error list
end