Convert OCaml odoc mld files to x-ocaml compatible format HTML
OCaml 82.2%
Dune 6.3%
Other 11.5%
3 1 0

Clone this repository

https://tangled.org/anil.recoil.org/odoc-xo
git@git.recoil.org:anil.recoil.org/odoc-xo

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

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