package hilite

  1. Overview
  2. Docs
Build time syntax highlighting

Install

Dune Dependency

Authors

Maintainers

Sources

hilite-0.1.0.tbz
sha256=de816a894c7f2974a316d3de802bcddd138b083a86173f6670690d526ab8af51
sha512=9bc9982bc05cf64c2c50117e469ff55335c0d8f3c9f0a95e678903e755cd71413780fa13d6126f355c2360a7319e78702b6b6c08533be0428ee2222a6fb60ef6

Description

A library for adding syntax highlighting to OCaml-related code and outputing to HTML

Published: 14 Apr 2022

README

Hilite 🎨

A small library that generates HTML ready for syntax-highlighting with CSS by parsing markdown documents.

Currently only some OCaml-related syntaxes are supported.

let md = {|
"Hello World!" in OCaml looks like:

~~~ocaml
let () = print_endline "Hello World!"
~~~
|}

And converting is as simple as...

# Omd.of_string md |> Hilite.Md.transform |> Omd.to_html;;
- : string =
"<p>&quot;Hello World!&quot; in OCaml looks like:</p>\n<pre><code><span class='ocaml-keyword-other'>let</span><span class='ocaml-source'> </span><span class='ocaml-constant-language'>()</span><span class='ocaml-source'> </span><span class='ocaml-keyword-operator'>=</span><span class='ocaml-source'> <"... (* string length 593; truncated *)

Dependencies (4)

  1. textmate-language >= "0.3.0"
  2. omd >= "2.0.0~alpha2"
  3. yojson
  4. dune >= "2.9"

Dev Dependencies (3)

  1. odoc with-doc
  2. textmate-language with-test & < "0.3.2"
  3. mdx with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.