This is an unofficial version of the OCaml Standard Library docs but with a modernized theme. Click here for where the guide is hosted.
It parses the official html docs, converts it into json to store it. Then it decodes the json and builds a modern site around it using better structure with a sidebar to quickly move between modules and functions.
It uses the following libraries:
From the OCaml opam libraries:
From the Bucklescript npm libraries:
- Clone the repo:
git clone https://github.com/seadynamic8/ocaml-modern-docs
- Download a copy of the official docs from: https://caml.inria.fr/pub/docs/manual-ocaml/index.html and store it in ocaml-modern-docs/parser directory.
So it should look like this:
- Build the parser (make sure to have
cd parser dune build parser.exe dune exec ./parser.exe
This will output a
modules.json file in the
- Decode the json and build the site
cd .. -- Back into the ocaml-modern-docs directory npm install npm run build
- Launch - If you have
npm run start
It's still a work in progress, but should be useful (It's just documentation)
The code needs some refactoring, especially the parser, so bear that in mind.
There was some hacks to get the decoding working because I couldn't figure out how to easily modify to the output for variants in atdgen and bs-json doesn't have a more flexible way to parse the json for variants not in the preferred format.
It was inspired by Elixir docs.
Not going to be actively maintained.