This page is a demo of the reference API of the Ocaml
27 | compiler library. Please select your version on the
28 | sidebar.
29 |
30 |
Comments, bug or issue reports, etc. are welcome on
31 | the github
32 | page.
33 |
34 |
35 |
36 |
37 |
38 |
The present documentation is copyright
39 | Institut National de Recherche en Informatique et en
40 | Automatique (INRIA).
41 |
42 | A complete version can be obtained
43 | from this
44 | page.
This page is a demo of the reference API of the Ocaml
27 | compiler library. Please select your version on the
28 | sidebar.
29 |
30 |
Comments, bug or issue reports, etc. are welcome on
31 | the github
32 | page.
33 |
34 |
35 |
36 |
37 |
38 |
The present documentation is copyright
39 | Institut National de Recherche en Informatique et en
40 | Automatique (INRIA).
41 |
42 | A complete version can be obtained
43 | from this
44 | page.
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OCaml-api
2 |
3 | Proposition for modernizing the OCaml API from the official manual
4 |
5 | Try it out [here](https://sanette.github.io/ocaml-api/) for the
6 | standard lib, or
7 | [there](https://sanette.github.io/ocaml-api/compilerlibref) for the
8 | compiler lib.
9 |
10 |
11 |
12 |
13 | _The documentation shown on the web page that is linked above is
14 | copyright Institut National de Recherche en Informatique et en
15 | Automatique (INRIA). A complete version can be obtained from
16 | [this page](http://caml.inria.fr/pub/docs/manual-ocaml/)._
17 |
18 | # Running the script
19 |
20 | 1. Install lambdasoup
21 |
22 | ```opam install lambdasoup```
23 |
24 | 2. Download or clone the repository
25 |
26 | 3. make
27 |
28 | In the `ocaml-api` directory, run `make`. This will run the
29 | `process.ml` script, which downloads the manuals, populates the `docs`
30 | directory, and copy the css, js and svg files.
31 |
32 | 4. Browse!
33 |
34 | `firefox docs/index.html`
35 |
36 | # More options
37 |
38 | Cleaning the `docs` directory:
39 |
40 | ```make clean```
41 |
42 | The `src/*libref/index-??.js` files can be re-created from scratch:
43 |
44 | ```make index```
45 |
46 | The behaviour of the script can be controlled by a few keywords:
47 | `makeindex`, `overwrite`, `silent`, and `html`. (`html` is true by
48 | default unless `makeindex` is present.)
49 |
50 | ```
51 | dune exec src/process.exe # only process html files
52 | dune exec src/process.exe makeindex # only create the index file
53 | dune exec src/process.exe overwrite # force overwriting existing html files
54 | dune exec src/process.exe makeindex html # create index and process html files
55 | dune exec src/process.exe [...] silent # suppress console output
56 | etc... (all keywords can be combined)
57 | ```
58 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Ocaml - API
7 |
8 |
9 |
10 |
The OCaml API
11 |
12 |
17 |
32 |
33 |
34 |
This page is a demo of the reference API of the Ocaml
35 | standard library. Please select your version on the
36 | sidebar.
37 |
38 |
Comments, bug or issue reports, etc. are welcome on
39 | the github
40 | page.
41 |
42 |
43 |
44 |
45 |
46 |
The present documentation is copyright
47 | Institut National de Recherche en Informatique et en
48 | Automatique (INRIA).
49 |
50 | A complete version can be obtained
51 | from this
52 | page.
This page is a demo of the reference API of the Ocaml
35 | standard library. Please select your version on the
36 | sidebar.
37 |
38 |
Comments, bug or issue reports, etc. are welcome on
39 | the github
40 | page.
41 |
42 |
43 |
44 |
45 |
46 |
The present documentation is copyright
47 | Institut National de Recherche en Informatique et en
48 | Automatique (INRIA).
49 |
50 | A complete version can be obtained
51 | from this
52 | page.
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/docs/scroll.js:
--------------------------------------------------------------------------------
1 | // Smooth scrolling only for near targets
2 | // San Vu Ngoc, 2019
3 |
4 | // if a link is located at distance larger than MAX_DISTANCE, we don't
5 | // use a smooth scrolling.
6 |
7 | console.log ("loading scroll.js");
8 |
9 | const MAX_DISTANCE = 1000;
10 |
11 | const url = window.location.pathname;
12 | var filename = url.substring(url.lastIndexOf('/')+1);
13 | if (filename == "") { filename = "index.html"; }
14 |
15 | function localLink (link) {
16 | return (link.length > 0 &&
17 | (link.charAt(0) == '#'
18 | || link.substring(0,filename.length) == filename));
19 | }
20 |
21 | //aaa.html#coucou --> coucou
22 | function getId (link) {
23 | return link.substring(link.lastIndexOf('#')+1);
24 | }
25 |
26 | // Get absolute y position of element.
27 | // modified from:
28 | // https://www.kirupa.com/html5/get_element_position_using_javascript.htm
29 | function getPosition(el) {
30 | let yPos = 0;
31 | while (el) {
32 | yPos += (el.offsetTop + el.clientTop);
33 | el = el.offsetParent;
34 | }
35 | return yPos;
36 | }
37 |
38 | function setSmooth () {
39 | let x = document.getElementsByClassName("toc_title");
40 | let a = document.getElementsByTagName("a");
41 | // let container = document.body.parentNode; // for ocaml.org
42 | let container = document.body; // for local
43 | let i;
44 | for (i = 0; i < a.length; i++) {
45 | let href = a[i].getAttribute("href");
46 | if (localLink(href)) {
47 | //a[i].style.backgroundColor = "red";
48 | //let top = getPosition(a[i]);
49 | a[i].onclick = function () {
50 | let id = getId(href);
51 | //console.log(id);
52 | let target = document.getElementById(id);
53 | if (! target) { target = document.body.parentNode; }
54 | let top = container.scrollTop;
55 | let dist = top - getPosition(target)
56 | //console.log ("click ==> " + getId(href) + ", distance = " + parseInt(Math.abs(dist)));
57 | if (Math.abs(dist) < MAX_DISTANCE) {
58 | target.scrollIntoView({ block: "start", inline: "nearest", behavior: 'smooth' });
59 | setTimeout(function () {
60 | location.href = href;
61 | // this will set the "target" property.
62 | }, 600);
63 | return false;
64 | // so we don't follow the link immediately
65 | }
66 | }
67 | }
68 | }
69 | }
70 |
71 | window.onload = function() {
72 | setSmooth();
73 | };
74 |
--------------------------------------------------------------------------------
/src/scroll.js:
--------------------------------------------------------------------------------
1 | // Smooth scrolling only for near targets
2 | // copyright 2019-2020 San Vu Ngoc
3 | //
4 |
5 | // Permission to use, copy, modify, and/or distribute this software
6 | // for any purpose with or without fee is hereby granted, provided
7 | // that the above copyright notice and this permission notice appear
8 | // in all copies.
9 |
10 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11 | // WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12 | // WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13 | // AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14 | // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
15 | // OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16 | // NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17 | // CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 |
19 |
20 | // Goal: if a link is located at distance larger than MAX_DISTANCE, we
21 | // don't use a smooth scrolling.
22 | //
23 | // usage: to activate this, run setSmooth within window.onload:
24 | // window.onload = setSmooth
25 | // Here instead we create a loading chain because we have other things
26 | // to add window.onload later.
27 |
28 | const MAX_DISTANCE = 1000;
29 | const SCROLL_DURATION = 600;
30 |
31 | const url = window.location.pathname;
32 | var filename = url.substring(url.lastIndexOf('/')+1);
33 | if (filename == "") { filename = "index.html"; }
34 |
35 | function localLink (link) {
36 | return (link.length > 0 &&
37 | (link.charAt(0) == '#'
38 | || link.substring(0,filename.length) == filename));
39 | }
40 |
41 | //aaa.html#s%3Adatatypes --> s:datatypes
42 | function getId (link) {
43 | let uri = link.substring(link.lastIndexOf('#')+1);
44 | return decodeURIComponent(uri)
45 | // for instance decodeURIComponent("s%3Adatatypes") == 's:datatypes'
46 | }
47 |
48 | // Get absolute y position of element.
49 | // modified from:
50 | // https://www.kirupa.com/html5/get_element_position_using_javascript.htm
51 | // assuming effective licence CC0, see
52 | // https://forum.kirupa.com/t/get-an-elements-position-using-javascript/352186/3
53 | function getPosition(el) {
54 | let yPos = 0;
55 | while (el) {
56 | yPos += (el.offsetTop + el.clientTop);
57 | el = el.offsetParent;
58 | }
59 | return yPos;
60 | }
61 |
62 | // This function scans all "a" tags with a valid "href", and for those
63 | // that are local links (links within the same file) it adds a special
64 | // onclick function for smooth scrolling.
65 | function setSmooth () {
66 | let a = document.getElementsByTagName("a");
67 | let container = document.body.parentNode; // for ocaml.org
68 | //let container = document.body; // for local
69 | let i;
70 | for (i = 0; i < a.length; i++) {
71 | let href = a[i].getAttribute("href");
72 | if (href != null && localLink(href)) {
73 | a[i].onclick = function () {
74 | let id = getId(href);
75 | let target = "";
76 | if ( id == "" ) {
77 | target = container;
78 | } else {
79 | target = document.getElementById(id); }
80 | if (! target) {
81 | console.log ("Error, no target for id=" + id);
82 | target = container; }
83 | let top = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop);
84 | let dist = top - getPosition(target)
85 | console.log ("click ==> " + getId(href) + ", distance = " + parseInt(Math.abs(dist)));
86 | if (Math.abs(dist) < MAX_DISTANCE) {
87 | target.scrollIntoView({ block: "start", inline: "nearest", behavior: 'smooth' });
88 | setTimeout(function () {
89 | location.href = href;
90 | // this will set the "target" property.
91 | }, SCROLL_DURATION);
92 | return false;
93 | // so we don't follow the link immediately
94 | }
95 | }
96 | }
97 | }
98 | }
99 |
100 | // We add it to the chain of window.onload
101 | window.onload=(function(previousLoad){
102 | return function (){
103 | previousLoad && previousLoad ();
104 | setSmooth ();
105 | }
106 | })(window.onload);
107 |
--------------------------------------------------------------------------------
/docs/compilerlibref/4.09/index_classes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | Index of classes
48 |
49 |
52 |
53 |
Index of classes
54 |
55 |
56 |
57 |
58 |
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.
The present documentation is copyright Institut National de Recherche en Informatique et en Automatique (INRIA). A complete version can be obtained from this page.