Which Javascript libraries have good support for OCaml syntax highlighting?

Ideally, the library supports a wide range of languages ​​in addition to OCaml, but basic OCaml support is a basic requirement.

+7
source share
2 answers

StackOverflow uses Google Code Prettify . This library supports many canonical languages, as mentioned here .

Although OCaml is not the main supported language, you can update lang-ml.js to better highlight OCaml syntax.

+7
source

Using Js-of-ocaml, you can use ocaml code for this.

For example, in ocsforge there is one ( http://ocsigen.org/darcsweb/?r=ocsforge;a=tree ):

It uses the corrected ocaml lexer (ocaml / parsing / lexer.mll and the src / ocaml_lexer.patch patch). Other useful files for you are src / ocsforge_color.ml and src / ocsforge_color_tokens.ml {, i}

+5
source

All Articles