package hilite
Build time syntax highlighting
Install
Dune Dependency
Authors
Maintainers
Sources
hilite-0.2.0.tbz
sha256=3b7c35e1e7219e1651b43ed7cfbad7cf43f83ceca88ceecf1aec7689ba985521
sha512=55ac47061331bf6b1e9db471ae2b95f1fe92916640f78cfbb89b5d6dfa907c23aa8a8f134ffd86dded64ecb85ddac62c0ebe4ad4fc34c79d326ee2fd4c5e1c3b
Description
A library for adding syntax highlighting to OCaml-related code and outputing to HTML
Published: 01 Dec 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 603; truncated *)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page