(********************************************************************************)(* test.mlCopyright (c) 2010 Dario Teixeira (dario.teixeira@yahoo.com)This software is distributed under the terms of the GNU GPL version 2.See LICENSE file for full license text.*)(********************************************************************************)(* Ocsigen demo of Camlhighlight library.*)open XHTML.Mlet test_service =Eliom_services.new_service~path: [""]~get_params: Eliom_parameters.unit()let test_handler sp () () =let ch = open_in "test.ml" inlet str = Std.input_all ch inlet () = close_in ch inlet () = Camlhighlight_parser.set_tabspaces 8 inlet hilite = Camlhighlight_parser.from_string ~lang:"caml" str inlet hilite_xhtml = Camlhighlight_write_xhtml.write ~linenums:false ~extra_classes:[] hilite inlet css_uri = Eliom_predefmod.Xhtml.make_uri (Eliom_services.static_dir sp) sp ["css"; "highlight.css"]in Lwt.return(html(head (title (pcdata "Test")) [Eliom_predefmod.Xhtml.css_link ~a:[(a_media [`All]); (a_title "Default")] ~uri:css_uri ()])(body [hilite_xhtml]))let () = Eliom_predefmod.Xhtml.register test_service test_handler(********************************************************************************)(** The following code does nothing; it is used to illustrate the syntaxhighlighting on different language elements.*)let ola1 = 10let ola2 = 20.123let ola3 = "This is a string with \n escaped characters"type rec_t ={bye1: string;bye2: float;}type foo_t =| One| Two| Threetype bar_t =[ `One| `Two| `Three]