panglesd / hilite

Hilite - a simple code to HTML syntax highlighter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 603; truncated *)

About

Hilite - a simple code to HTML syntax highlighter

License:Other


Languages

Language:Standard ML 91.0%Language:OCaml 9.0%