Higlo.PrintersPrinters for the higlo tool.
type printer = Lang.token list -> unittype classes = {bcomment : string;constant : string;directive : string;escape : string;id : string;keyword : int -> string;lcomment : string;numeric : string;string : string;symbol : int -> string;text : string;}This structure defines the (X)HTML classes to use when producing XML.
val default_classes : classesDefault X(HTML) classes.
val token_to_xml : ?classes:classes -> Lang.token -> Xtmpl.Xml.treeMap a token to an XML tree (just a <span class="...">code</span> node).
val token_to_xml_rewrite : ?classes:classes -> Lang.token -> Xtmpl.Rewrite.treeSame as token_to_xml but return a Xtmpl.Rewrite.tree.
val to_xml : ?classes:classes -> lang:string -> string -> Xtmpl.Xml.tree listto_xtmpl ~lang code gets the lexer associated to the language lang, uses it to retrieve a list of tokens (using the Lang.parse function) and maps these tokens to XML nodes. See token_to_xml about the classes parameter.
val to_xml_rewrite :
?classes:classes ->
lang:string ->
string ->
Xtmpl.Rewrite.tree listSame as to_xml but return a Xtmpl.Rewrite.tree.
val get_printer : string -> printerval register_printer : string -> printer -> unit