Little cli to convert md files into mld files
  • OCaml 96.3%
  • Dune 3.7%
Find a file
2025-02-06 10:04:23 +01:00
.github/workflows Update 2025-02-05 15:22:32 +01:00
docs Remove docs warning 2021-06-25 13:09:00 +02:00
src Cleanup fmt 2025-02-05 13:12:29 +01:00
tests Support code blocks language tags 2023-05-01 12:03:48 +01:00
.gitignore Update to dune.3.6 and generate opam file 2023-02-10 15:12:28 +01:00
.ocamlformat Cleanup fmt 2025-02-05 13:12:29 +01:00
CHANGES.md Prepare to release 0.7 2023-05-01 15:25:25 +02:00
dune-project Update opam file 2025-02-05 13:12:14 +01:00
LICENSE Add LICENSE 2022-10-03 09:43:22 +02:00
md2mld.opam Update md2mld.opam 2025-02-06 10:04:23 +01:00
md2mld.opam.template Create md2mld.opam.template 2025-02-06 10:04:12 +01:00
README.md Fix readme Dune instructions 2023-04-07 19:19:54 +02:00

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

  • Until the new odoc fixing #141 is released, the minimal header allowed in the md file will be the level 3 one ###. You can work around this by using the -min-header 3 flag during the invocation of md2mld.

  • If you see an error like '{0': heading level should be lower than top heading level '0', this is because in ocamldoc the first header must have a level higher than all other headings in the page. You can safely ignore it or increase the level of the subsequent headings to get rid of it.