md2mld: Convert md files into odoc mld files

md2mld converts a Markdown-format file into the mld format used by odoc to render HTML documentation or OCaml libraries. You can use this script to automatically embed a README.md file into API documentation for an OCaml library.

Usage

You can use it manually as follows

$ md2mld filename.md > outfile.mld

In dune you can use it to generate an mld file with

(rule
 (target outfile.mld)
 (deps filename.md)
 (action
  (with-stdout-to outfile.mld (run md2mld filename.md))))

Attach the mld file using the (documentation …) stanza. You can see the documentation generated from the latest tagged version of this README at mseri.github.io/md2mld/md2mld.

Known issues