package hilite

  1. Overview
  2. Docs
Build time syntax highlighting

Install

Dune Dependency

Authors

Maintainers

Sources

hilite-0.4.0.tbz
sha256=1bc335d3f1fb32ecd7888e98ec5b01c94ad4393ad96e80d5e4040931db8858e8
sha512=17cc6db24895b946d98e28db2698bdac41feac63fd97ea7ec8c88b67b38bb10a8b5ca9accb54e6f15caa8ab49234b075301a5888913fe0d493a931114fb02d44

Description

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

Tags

syntax highlighting

Published: 21 Nov 2023

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...

# Cmarkit.Doc.of_string md |> Hilite.Md.transform |> Cmarkit_html.of_doc ~safe:false;;
- : 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-unit'>()</span><span class='ocaml-source'> </span><span class='ocaml-keyword-operator'>=</span><span class='ocaml-sourc"... (* string length 609; truncated *)

Dependencies (3)

  1. textmate-language >= "0.3.3"
  2. cmarkit
  3. dune >= "2.9"

Dev Dependencies (2)

  1. odoc with-doc
  2. mdx with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.