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
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.
It would require fixing some bugs for better odoc, omd, and mdx integration:
- realwordocaml/mdx - Add support for odoc
- ocaml/omd - Allowing support for Divs and Spans
- ocaml/omd - Support for more
pandoc
extensions - ocaml/omd - Header identifiers
- ocaml/omd - Handle extended markdown
- ocaml/omd - Improve handling tricky edge cases
- ocaml/omd - Support and test UTF-8
P.S. There is also interesting ongoing work on generating LaTeX from Markdown with omd.