Giter Site home page Giter Site logo

seadynamic8 / ocaml-modern-docs Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 0.0 1.3 MB

Unofficial OCaml Standard Library Docs - Modern Theme

Home Page: https://www.streamingspring.com/ocaml/docs/

License: MIT License

HTML 1.19% JavaScript 0.20% OCaml 79.99% CSS 14.36% Elixir 4.25%
ocaml documentation bucklescript bucklescript-tea

ocaml-modern-docs's Introduction

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:

  • lambdasoup
  • atdgen

From the Bucklescript npm libraries:

  • bucklescript-tea
  • bs-json

Install

  1. Clone the repo:
git clone https://github.com/seadynamic8/ocaml-modern-docs
  1. 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:

  • ocaml-modern-docs/parser/htmlman/...
  • ocaml-modern-docs/parser/htmlman/libref/...
  1. Build the parser (make sure to have dune installed already)
cd parser
dune build parser.exe
dune exec ./parser.exe

This will output a modules.json file in the parser directory.

  1. Decode the json and build the site
cd ..  -- Back into the ocaml-modern-docs directory
npm install
npm run build
  1. Launch - If you have parcel and npm-run-all installed
npm run start

Notes

  • 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.

License

MIT

ocaml-modern-docs's People

Contributors

seadynamic8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.