Skip to content

Commit

Permalink
fix paths to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jchavarri committed Aug 18, 2023
1 parent 70701c3 commit 980f25e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Melange exposes three libraries:

- A standard library, which mostly replicates that of OCaml for compatibility;
see the docs: the [`Stdlib`](/_html/melange/Stdlib) library
see the docs: the [`Stdlib`](../_html/melange/Stdlib) library
- Bindings to several browser and Node JavaScript APIs in the [`Js`
library](/_html/melange/Js).
library](../_html/melange/Js).
- Data structures and collection types in the [`Belt`
library](/_html/melange/Belt)
library](../_html/melange/Belt)

Using one or the other will depend on your application requirements, how much
integration you need with existing JavaScript libraries, or other specific
Expand Down
40 changes: 20 additions & 20 deletions docs/communicate-with-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ class="text-reasonml">\-\></code>.
As its name suggests, the pipe first operator is better suited for functions
where the data is passed as the first argument.

The functions in the [`Belt` library](/_html/melange/Belt) included with Melange
have been designed with the data-first convention in mind, so they work best
with the pipe first operator.
The functions in the [`Belt` library](../_html/melange/Belt) included with
Melange have been designed with the data-first convention in mind, so they work
best with the pipe first operator.

For example, we can rewrite the example above using `Belt.List.map` and the pipe
first operator:
Expand Down Expand Up @@ -460,8 +460,8 @@ This is how each Melange type is converted into JavaScript values:
| array | array |
| tuple `(3, 4)` | array `[3, 4]` |
| bool | boolean |
| [Js.Nullable.t](/_html/melange/Js/Nullable) | `null` / `undefined` |
| [Js.Re.t](/_html/melange/Js/Re) | [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) |
| [Js.Nullable.t](../_html/melange/Js/Nullable) | `null` / `undefined` |
| [Js.Re.t](../_html/melange/Js/Re) | [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp) |
| Option.t `None` | `undefined` |
| Option.t <code class="text-ocaml">Some( Some .. Some (None))</code><code class="text-reasonml">Some(Some( .. Some(None)))</code> | internal representation |
| Option.t <code class="text-ocaml">Some 2</code><code class="text-reasonml">Some(2)</code> | `2` |
Expand Down Expand Up @@ -576,9 +576,9 @@ You can surround the interpolation variable in parentheses too: `{j|你
好,$(world)|j}`.

To work with strings, the Melange standard library provides some utilities in
the [`Stdlib.String` module](/_html/melange/Stdlib/String). The bindings to the
native JavaScript functions to work with strings are in the [`Js.String`
module](/_html/melange/Js/String).
the [`Stdlib.String` module](../_html/melange/Stdlib/String). The bindings to
the native JavaScript functions to work with strings are in the [`Js.String`
module](../_html/melange/Js/String).

#### Floating-point numbers

Expand All @@ -589,9 +589,9 @@ same encoding as [JavaScript
numbers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding),
so values of these types can be used transparently between Melange code and
JavaScript code. The Melange standard library provides a [`Stdlib.Float`
module](/_html/melange/Stdlib/Float). The bindings to the JavaScript APIs that
module](../_html/melange/Stdlib/Float). The bindings to the JavaScript APIs that
manipulate float values can be found in the
[`Js.Float`](/_html/melange/Js/Float) module.
[`Js.Float`](../_html/melange/Js/Float) module.

#### Integers

Expand All @@ -608,8 +608,8 @@ Melange. When dealing with large numbers, it is advisable to use floats instead.
For instance, floats are used in bindings like `Js.Date`.

The Melange standard library provides a [`Stdlib.Int`
module](/_html/melange/Stdlib/Int). The bindings to work with JavaScript
integers are in the [`Js.Int`](/_html/melange/Js/Int) module.
module](../_html/melange/Stdlib/Int). The bindings to work with JavaScript
integers are in the [`Js.Int`](../_html/melange/Js/Int) module.

#### Arrays

Expand All @@ -619,10 +619,10 @@ arrays, all the values in a Melange array need to have the same type.
Another difference is that OCaml arrays are fixed-sized, but on Melange side
this constraint is relaxed. You can change an array’s length using functions
like `Js.Array.push`, available in the bindings to the JavaScript APIs in
[`Js.Array`](/_html/melange/Js/Array).
[`Js.Array`](../_html/melange/Js/Array).

Melange standard library also has a module to work with arrays, available in
[`Stdlib.Array`](/_html/melange/Stdlib/Array) module.
[`Stdlib.Array`](../_html/melange/Stdlib/Array) module.

#### Tuples

Expand Down Expand Up @@ -685,7 +685,7 @@ var r = /b/g;
```

A regular expression like the above is of type `Js.Re.t`. The
[`Js.Re`](/_html/melange/Js/Re) module provides the bindings to the JavaScript
[`Js.Re`](../_html/melange/Js/Re) module provides the bindings to the JavaScript
functions that operate over regular expressions.

## Non-shared data types
Expand All @@ -700,10 +700,10 @@ them before doing so.
- Exceptions
- Option (a variant type): Better use the `Js.Nullable.fromOption` and
`Js.Nullable.toOption` functions in the [`Js.Nullable`
module](/_html/melange/Js/Nullable) to transform them into either `null` or
module](../_html/melange/Js/Nullable) to transform them into either `null` or
`undefined` values.
- List (also a variant type): use `Array.of_list` and `Array.to_list` in the
[`Array` module](/_html/melange/Stdlib/Array).
[`Array` module](../_html/melange/Stdlib/Array).
- Character
- Int64
- Lazy values
Expand Down Expand Up @@ -1356,8 +1356,8 @@ Sometimes JavaScript objects are used as dictionaries. In these cases:

For this particular use case of JavaScript objects, Melange exposes a specific
type `Js.Dict.t`. The values and functions to work with values of this type are
defined in the [`Js.Dict`](/_html/melange/Js/Dict) module, with operations like
`get`, `set`, etc.
defined in the [`Js.Dict`](../_html/melange/Js/Dict) module, with operations
like `get`, `set`, etc.

Values of the type `Js.Dict.t` compile to JavaScript objects.

Expand Down Expand Up @@ -1432,7 +1432,7 @@ let () = clearTimeout(id);

> **_NOTE:_** The bindings to `setTimeout` and `clearTimeout` are shown here for
> learning purposes, but they are already available in the
> [`Js.Global`](/_html/melange/Js/Global) module.
> [`Js.Global`](../_html/melange/Js/Global) module.
Generates:

Expand Down

0 comments on commit 980f25e

Please sign in to comment.