Convert the ocaml-manual to Reason flavoured Markdown
The ocaml-manual is the official handbook for using OCaml. It fully describes all features and syntax elements and is highly valuable for explaining complex mechanisms, such as GADTs or polymorphic variants.
This is an ambitious task, I actually post it here so we don't forget about it. It's also a quite isolated task which will hopefully not interfere with our current work, if you feel like experimenting and have any progress, please let us know in this issue, so we can keep track of it.
What needs to be done?
- Revive
rtopwith the most recent Reason version (\cc @jordwalke) - Create a mirror of the ocaml-manual repository
- Use the ocaml manual build system to use
rtopinstead ofutopto output Reason formatted signatures - Add refmt for reformatting ml codesnippets in the build system
- Make the build system expose markdown / json instead of html
Especially the markdown rendering will be useful, since we will then be able to commit the generated markdown output in our existing infrastructure (also makes it easier for us to style).
The manual does not really use a toplevel for building code examples, it has its own caml-tex internal tools that extracts the code example, processes them with compiler-libs and outputs the corresponding latex code block. Adding hooks to caml-tex in order to switch the outcometree printer to reason's printer should not be too hard. Similarly, adding a preprocessing step to the input sounds relatively straightforward.
As stated by @Octachron in Discord, some projects parse the html output to modify the data. Here the direct quote:
For just postprocessing the manual there is https://sanette.github.io/ocaml-tutorial/4.10/coreexamples.html for instance. I am not sure if the postprocessing pipeline is published
It is : https://github.com/sanette/ocaml-tutorial .
Also, converting to markdown is difficult because the manual source are written in latex and latex is too powerful as a language. However, we (me and @gasche at the very least) have been discussing about trying to convert the source to a less featurefull format to decrease the entry barrier for contributors.