package hilite
Build time syntax highlighting
Install
Dune Dependency
Authors
Maintainers
Sources
hilite-0.1.1.tbz
sha256=0fab6d29dc4fda1aefc68c8af9340c0ea0ec153445c880d4de218a7976356c53
sha512=4682e2197acff4c6e8f3bdbbe239534b2abfceae0847b4af4284dd24207ca480dee69e4e23bb9ebb0e6bdd0db083b8a271db7a80db21c533a5e8c5df3ea2b150
Description
A library for adding syntax highlighting to OCaml-related code and outputing to HTML
Published: 24 Nov 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>"Hello World!" 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 *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page