Skip to content

Commit 0225338

Browse files
committed
fix more links and add errors on invalid links
1 parent 9a3911c commit 0225338

30 files changed

+102
-99
lines changed

markdown-pages/blog/enhanced-ergonomics-for-record-types.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ let name = nameFromB(a :> b)
141141

142142
Notice how `a` now has more fields than `b`, but we can still coerce `a` to `b` because `b` has a subset of the fields of `a`.
143143

144-
In combination with [optional record fields](../docs/manual/record.mdx#optional-record-fields), one may coerce a mandatory field of an `option` type to an optional field:
144+
In combination with [ReScript objects are like ](../docs/manual/record.mdx#optional-record-fields), one may coerce a mandatory field of an `option` type to an optional field:
145145

146146
```rescript
147147
type a = {

markdown-pages/docs/manual/array-and-list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ var anotherList = {
192192

193193
#### Access
194194

195-
`switch` (described in the [pattern matching section](pattern-matching-destructuring.mdx)) is usually used to access list items:
195+
`switch` (described in the [pattern matching section](./pattern-matching-destructuring.mdx)) is usually used to access list items:
196196

197197
<CodeTab labels={["ReScript", "JS Output"]}>
198198

markdown-pages/docs/manual/bind-to-js-function.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We also expose a few special features, described below.
2929

3030
## Labeled Arguments
3131

32-
ReScript has [function](function.mdx) signature. These work on an `external` too! You'd use them to _fix_ a JS function's unclear usage. Assuming we're modeling this:
32+
ReScript has [function](./function.mdx) signature. These work on an `external` too! You'd use them to _fix_ a JS function's unclear usage. Assuming we're modeling this:
3333

3434
```js
3535
// MyGame.js
@@ -109,7 +109,7 @@ In a `send`, the object is always the first argument. Actual arguments of the me
109109

110110
### Chaining
111111

112-
Ever used `foo().bar().baz()` chaining ("fluent api") in JS OOP? We can model that in ReScript too, through the [pipe operator](pipe.mdx).
112+
Ever used `foo().bar().baz()` chaining ("fluent api") in JS OOP? We can model that in ReScript too, through the [pipe operator](./pipe.mdx).
113113

114114
### Nested function call
115115

@@ -164,7 +164,7 @@ var v = Path.join("a", "b");
164164

165165
</CodeTab>
166166

167-
`module` will be explained in [Import from/Export to JS](import-from-export-to-js.mdx).
167+
`module` will be explained in [Import from/Export to JS](./import-from-export-to-js.mdx).
168168

169169
## Modeling Polymorphic Function
170170

markdown-pages/docs/manual/bind-to-js-object.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ JavaScript objects are a combination of several use-cases:
1515
- As a class.
1616
- As a module to import/export.
1717

18-
ReScript cleanly separates the binding methods for JS object based on these 4 use-cases. This page documents the first three. Binding to JS module objects is described in the [Import from/Export to JS](import-from-export-to-js.mdx) section.
18+
ReScript cleanly separates the binding methods for JS object based on these 4 use-cases. This page documents the first three. Binding to JS module objects is described in the [Import from/Export to JS](./import-from-export-to-js.mdx) section.
1919

2020
{/* TODO: mention scope here too? */}
2121

@@ -47,7 +47,7 @@ var johnName = MySchool.john.name;
4747

4848
</CodeTab>
4949

50-
External is documented [here](external.mdx). `@module` is documented [here](import-from-export-to-js.mdx).
50+
External is documented [here](./external.mdx). `@module` is documented [here](./import-from-export-to-js.mdx).
5151

5252
If you want or need to use different field names on the ReScript and the JavaScript side, you can use the `@as` decorator:
5353

@@ -92,7 +92,7 @@ var value = [7, "baz"];
9292

9393
### Bind Using ReScript Object
9494

95-
Alternatively, you can use [ReScript object](object.mdx) to model a JS object too:
95+
Alternatively, you can use [ReScript object](./object.mdx) to model a JS object too:
9696

9797
<CodeTab labels={["ReScript", "JS Output"]}>
9898

markdown-pages/docs/manual/editor-plugins.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Below is a list of all the scenarios where using dots trigger completion in addi
153153

154154
#### Objects
155155

156-
When writing a `.` on something that's a [structural object](object.mdx), you'll get completions for those object properties. Example:
156+
When writing a `.` on something that's a [structural object](./object.mdx), you'll get completions for those object properties. Example:
157157

158158
```res
159159
let obj = {

markdown-pages/docs/manual/embed-raw-javascript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ Embedding raw JS snippets isn't the best way to experience ReScript, though it's
113113

114114
At the end, we get a fully safe, converted ReScript file whose JS output is clean enough that we can confidently assert that no new bug has been introduced during the conversion process.
115115

116-
We have a small guide on this iteration [here](converting-from-js.mdx). Feel free to peruse it later.
116+
We have a small guide on this iteration [here](./converting-from-js.mdx). Feel free to peruse it later.

markdown-pages/docs/manual/exception.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ order: 19
88

99
# Exception
1010

11-
Exceptions are just a special kind of variant, thrown in **exceptional** cases (don't abuse them!). Consider using the [`option`](null-undefined-option.mdx) or [`result`](/docs/manual/api/stdlib/result) type for recoverable errors.
11+
Exceptions are just a special kind of variant, thrown in **exceptional** cases (don't abuse them!). Consider using the [`option`](./null-undefined-option.mdx) or [`result`](/docs/manual/api/stdlib/result) type for recoverable errors.
1212

1313
You can create your own exceptions like you'd make a variant (exceptions need to be capitalized too).
1414

1515
<CodeTab labels={["ReScript", "JS Output"]}>
16-
16+
1717
```res example
1818
exception InputClosed(string)
1919
// later on

markdown-pages/docs/manual/external.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ order: 3
2828

2929
</CodeTab>
3030

31-
There are several kinds of `external`s, differentiated and/or augmented through the [attribute](attribute.mdx) they carry. This page deals with the general, shared mechanism behind most `external`s. The different `external`s are documented in their respective pages later. A few notable ones:
31+
There are several kinds of `external`s, differentiated and/or augmented through the [attribute](./attribute.mdx) they carry. This page deals with the general, shared mechanism behind most `external`s. The different `external`s are documented in their respective pages later. A few notable ones:
3232

33-
- `@val`, `@scope`: [bind to global JS values](bind-to-global-js-values.mdx).
34-
- `@module`: [bind to JS imported/exported values](import-from-export-to-js.mdx).
35-
- `@send`: [bind to JS methods](bind-to-js-function.mdx).
33+
- `@val`, `@scope`: [bind to global JS values](./bind-to-global-js-values.mdx).
34+
- `@module`: [bind to JS imported/exported values](./import-from-export-to-js.mdx).
35+
- `@send`: [bind to JS methods](./bind-to-js-function.mdx).
3636

3737
You can also use our [Syntax Lookup](../../syntax-lookup/) tool to find them.
3838

markdown-pages/docs/manual/function.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function drawCircle(color, radius) {
251251

252252
</CodeTab>
253253

254-
The first line is the function's signature, we would define it like that in an interface file (see [Signatures](module.mdx#signatures)). The function's signature describes the types that the **outside world** interacts with, hence the type `int` for `radius` because it indeed expects an `int` when called.
254+
The first line is the function's signature, we would define it like that in an interface file (see [Signatures](./module.mdx#signatures)). The function's signature describes the types that the **outside world** interacts with, hence the type `int` for `radius` because it indeed expects an `int` when called.
255255

256256
In the second line, we annotate the arguments to help us remember the types of the arguments when we use them **inside** the function's body, here indeed `radius` will be an `option<int>` inside the function.
257257

markdown-pages/docs/manual/import-export.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ A ReScript project's file names need to be unique.
3434

3535
By default, every file's type declaration, binding and module is exported, aka publicly usable by another file. **This also means those values, once compiled into JS, are immediately usable by your JS code**.
3636

37-
To only export a few selected things, use a `.resi` [interface file](module.mdx#signatures).
37+
To only export a few selected things, use a `.resi` [interface file](./module.mdx#signatures).
3838

3939
## Work with JavaScript Import & Export
4040

41-
To see how to import JS modules and export stuff for JS consumption, see the JavaScript Interop section's [Import from/Export to JS](import-from-export-to-js.mdx).
41+
To see how to import JS modules and export stuff for JS consumption, see the JavaScript Interop section's [Import from/Export to JS](./import-from-export-to-js.mdx).

0 commit comments

Comments
 (0)