ODoc Support For Generating Markdown?

I tried looking but couldn’t find anything on whether odoc has plans on supporting Markdown output for documentation? It would be nice to use mdbook for documentation, similar to Rust

1 Like

This seems to be doing just that (I think for displaying docs in vscode):

For output, yes. Right now, most of our odoc maintainer time on odoc at OCaml Labs is taken up by a huge rewrite of the internals that results in complete and consistent doc generation (right now, odoc fails on a number of typing constructs involving module resolution). Once that’s integrated, we’ll have much more time to work on the actual output formats. It’s a bit tricky to do them both in parallel since there are just so many broken links in the current output…


There is also a pull requests on ocaml-lsp trying to do the conversion from ocamldoc to markdown. 1st version was using octavius. But there is also an attempt using odoc.

It is not as good as having odoc generating some markdown, because it doesn’t do things like resolving links to other modules/types/… And so probably not enough to be used with mdbook. But still nice to have in the editor.

1 Like

It would require fixing some bugs for better odoc, omd, and mdx integration:

P.S. There is also interesting ongoing work on generating LaTeX from Markdown with omd.