Convert OCaml odoc mld files to x-ocaml compatible format HTML
OCaml 81.9%
Dune 7.3%
Other 10.8%
4 1 0

Clone this repository

https://tangled.org/jon.recoil.org/odoc-xo https://tangled.org/did:plc:v3lpbvpa4s5yxincntuvtwtm/odoc-xo
git@knot.ludl.am:jon.recoil.org/odoc-xo git@knot.ludl.am:did:plc:v3lpbvpa4s5yxincntuvtwtm/odoc-xo

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

odoc-xo - Transform odoc HTML to x-ocaml Web Components#

A command-line tool that transforms HTML documents generated by odoc to use interactive x-ocaml web components for OCaml code blocks.

Key Features#

  • Transforms <pre class="language-ocaml"> blocks to <x-ocaml> elements
  • Processes MDX-style code blocks (lines starting with # )
  • Injects script and style tags for x-ocaml web components
  • Configurable script paths for the x-ocaml runtime

Usage#

Transform a file and write to stdout:

odoc-xo tutorial.html

Transform and write to a file:

odoc-xo -o output.html input.html

Use custom script paths:

odoc-xo --js-src /assets/x-ocaml.js input.html

Installation#

opam install odoc-xo

License#

ISC