I'm happy to announce release 3.0 of Camlhighlight, a library offering syntax highlighting and pretty-printing facilities for displaying code samples in Ocsigen applications. The library works by interfacing with the library portion of GNU Source-highlight, a popular application supporting the most common programming and markup languages.
This version features a smaller dependency set, now requiring Tyxml instead of forcing a dependency on Eliom. However, full compatibility with Eliom applications is maintained. The functorial interface used seems hairy at first glance, but it's actually not that complicated in practice. As an example, if your application uses only Tyxml and you wish to write a syntax-highlighted sample as a Html5.elt, you will first need to apply the Camlhighlight_write_html5.Make functor using Tyxml's Html5 and Svg modules as parameter:
module Html5_writer = Camlhighlight_write_html5.Make (struct include Html5.M module Svg = Svg.M end)
Similarly, if you intend the Html5_writer module to be Eliom compatible, then use Eliom's Html5.F.Raw and Svg.F.Raw modules as parameter:
module Html5_writer = Camlhighlight_write_html5.Make (struct include Eliom_content.Html5.F.Raw module Svg = Eliom_content.Svg.F.Raw end)
The package should be hitting the OPAM repository soon. Eliom users should beware that Camlhighlight requires Tyxml >= 3.2, whereas Eliom 4.0.0 requires Tyxml < 3.2. Therefore, should you want to use Camlhighlight in an Eliom application, you are advised to install the development version of Eliom (please see the Ocsigen site for instructions regarding Ocsigen's development repo for OPAM).