Skip to content

Commit 1e63a91

Browse files
authored
Fix more broken links and add stronger detection for broken links (#215)
* Fix more broken links and add stronger detection for broken links * update package json * Try to get this to build on CI * Testing * Testing
1 parent 4b6a5fb commit 1e63a91

22 files changed

+1257
-258
lines changed

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.wordWrap": "on"
3+
}

docs/actions-and-actors/entry-and-exit-actions.mdx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ Use the <kbd>Backspace</kbd> key to delete the action.
9393

9494
## Add a built-in action
9595

96-
You can add built-in XState actions which will be formatted in your [exported code](export-as-code.mdx). The options are:
96+
You can add built-in XState actions which will be formatted in your [exported code](/docs/export-as-code.mdx). The options are:
9797

98-
- [assign](#assign-action): assigns data to the state context.
99-
- [raise](#raise-action): _raises_ an event that is received by the same machine.
100-
- [log](#log-action): an easy way to log messages to the console.
101-
- [sendTo](#send-to-action): sends an event to a specific actor.
102-
- [stop](#stop-action): stops a child actor.
98+
- [assign](/docs/xstate/actions/context#assign-action): assigns data to the state context.
99+
- [raise](/docs/xstate/actions/built-in-actions#raise-action): _raises_ an event that is received by the same machine.
100+
- [log](/docs/xstate/actions/built-in-actions#log-action): an easy way to log messages to the console.
101+
- [sendTo](/docs/xstate/actions/built-in-actions#sending-events-to-actors): sends an event to a specific actor.
102+
- [stop](/docs/xstate/actors/spawn#stopping-spawned-actors): stops a child actor.
103103

104-
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
104+
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
105105

106106
### On the canvas
107107

@@ -114,15 +114,15 @@ To add a built-in action, first add a [transition action](#add-a-transition-acti
114114

115115
1. Open the state, or event <Info size={18} /> **Details** panel from the right tool menu.
116116
1. Hover, focus, or select the action block to reveal the <Edit size={18} /> edit icon button.
117-
2. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
118-
3. Choose your desired action from the dropdown menu at the top of the **Action** panel.
119-
4. Fill out the required corresponding action input fields.
117+
1. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
118+
1. Choose your desired action from the dropdown menu at the top of the **Action** panel.
119+
1. Fill out the required corresponding action input fields.
120120

121121
## Add a custom action
122122

123-
You can also add custom actions with a custom action type and parameters which will be formatted as [XState action objects](#action-objects) in your [exported code](export-as-code.mdx).
123+
You can also add custom actions with a custom action type and parameters which will be formatted as [XState action objects](/docs/xstate/actions) in your [exported code](/docs/export-as-code).
124124

125-
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
125+
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
126126

127127
### On the canvas
128128

@@ -131,16 +131,16 @@ First, add a [transition action](#add-a-transition-action), [entry action](#add-
131131
3. Custom action is selected by default. Add your custom action type in the **Action type** text input.
132132
4. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
133133

134-
[Read about action objects below for more on action types and and parameters](#action-objects).
134+
[Read about action objects below for more on action types and and parameters](/docs/xstate/actions).
135135

136136
### Using the details panel
137137

138138
1. Open the state, or event <Info size={18} /> **Details** panel from the right tool menu.
139139
1. Hover, focus, or select the action block to reveal the <Edit size={18} /> edit icon button.
140-
2. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
141-
3. Custom action is selected by default. Add your custom action type in the **Action type** text input.
142-
4. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
143-
:::xstate
140+
1. Use the <Edit size={18} /> edit icon button to open the **Action** panel.
141+
1. Custom action is selected by default. Add your custom action type in the **Action type** text input.
142+
1. Add your custom **Action parameters** using the **Parameter key** and **Parameter value** text input pairs.
143+
:::xstate
144144

145145
## Looking for how to use entry and exit actions in XState?
146146

docs/studio.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Here you can find all the documentation for the Stately Studio and [XState](/xst
2727
</a>
2828
</li>
2929
<li>
30-
<a className="link-box" href="/docs/xstate">
30+
<a className="link-box" href="docs/xstate">
3131
💻 <strong>Learn XState</strong> Get started with our JavaScript and
3232
TypeScript library for state machines and statecharts.
3333
</a>

docs/tools/visualizer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Are you looking for the _Stately Studio_ visual _Editor_? Check out the [Stately
1717

1818
:::tip
1919

20-
Stately still supports the Stately Visualizer, but you will find many more advanced features, including the visual [Studio Editor](studio.mdx/#studio-editor), teams, and shared projects.
20+
Stately still supports the Stately Visualizer, but you will find many more advanced features, including the visual [Studio Editor](/studio.mdx#stately-studios-editor), teams, and shared projects.
2121

2222
:::
2323

docs/tools/xstate-vscode-extension.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You can also [download the VS Code extension from the VS Code marketplace](https
3535

3636
## TypeScript typegen
3737

38-
You can automatically generate intelligent typings for XState with our VS Code extension and [command line interface](/tools/developer-tools.mdx#xstate-cli-command-line-interface). [Read more about how to use typegen, and our recommended best practices, on the Typegen page](../xstate/typescript/typegen).
38+
You can automatically generate intelligent typings for XState with our VS Code extension and [command line interface](/tools/developer-tools.mdx#xstate-cli-command-line-interface). [Read more about how to use typegen, and our recommended best practices, on the Typegen page](/docs/xstate/typescript/typegen).
3939

4040
## `xsm` snippet
4141

docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const config = {
1212
baseUrl: '/',
1313
baseUrlIssueBanner: false,
1414
onBrokenLinks: 'throw',
15-
onBrokenMarkdownLinks: 'warn',
15+
onBrokenMarkdownLinks: 'throw',
1616
favicon: 'icon.svg',
1717
staticDirectories: ['static'],
1818

@@ -90,7 +90,7 @@ const config = {
9090
blogSidebarCount: 0,
9191
postsPerPage: 10,
9292
editUrl: ({ locale, blogDirPath, blogPath, permalink }) =>
93-
`https://github.com/statelyai/docs/edit/main/${blogDirPath}/${blogPath}`
93+
`https://github.com/statelyai/docs/edit/main/${blogDirPath}/${blogPath}`,
9494
},
9595
theme: {
9696
customCss: require.resolve('./src/css/custom.css'),

package.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2-
"name": "classic",
3-
"version": "0.0.0",
4-
"private": true,
2+
"name": "stately-docs",
3+
"version": "0.1.0",
4+
"repository": "https://github.com/statelyai/docs",
55
"scripts": {
66
"docusaurus": "docusaurus",
7-
"start": "docusaurus start",
8-
"build": "docusaurus build",
7+
"remark:once": "yarn remark --quiet --frail docs/**/* versioned_docs/**/*",
8+
"remark:watch": "yarn remark --quiet --frail --watch docs/**/* versioned_docs/**/*",
9+
"start": "concurrently \"yarn remark:watch\" \"yarn typecheck:watch\" \"docusaurus start\"",
10+
"build": "yarn remark:once && yarn typecheck && docusaurus build",
911
"swizzle": "docusaurus swizzle",
1012
"deploy": "docusaurus deploy",
1113
"clear": "docusaurus clear",
@@ -14,9 +16,19 @@
1416
"write-heading-ids": "docusaurus write-heading-ids",
1517
"typecheck": "tsc"
1618
},
19+
"remarkConfig": {
20+
"plugins": [
21+
[
22+
"remark-validate-links",
23+
{
24+
"repository": false
25+
}
26+
]
27+
]
28+
},
1729
"dependencies": {
18-
"@docusaurus/core": "^2.4.1",
19-
"@docusaurus/preset-classic": "^2.4.1",
30+
"@docusaurus/core": "^2.4.3",
31+
"@docusaurus/preset-classic": "^2.4.3",
2032
"@mdx-js/react": "^1.6.22",
2133
"@microsoft/api-extractor": "^7.35.1",
2234
"@xstate/inspect": "^0.8.0",
@@ -32,10 +44,13 @@
3244
"xstate": "^4.37.2"
3345
},
3446
"devDependencies": {
35-
"@docusaurus/module-type-aliases": "^2.4.1",
47+
"@docusaurus/module-type-aliases": "^2.4.3",
3648
"@fec/remark-a11y-emoji": "^3.1.0",
3749
"@tsconfig/docusaurus": "^1.0.7",
50+
"concurrently": "^8.2.1",
3851
"dotenv": "^16.0.3",
52+
"remark-cli": "^12.0.0",
53+
"remark-validate-links": "^13.0.0",
3954
"typescript": "^5.0.4"
4055
},
4156
"browserslist": {

versioned_docs/version-5/actions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ You can add built-in XState actions which will be formatted in your [exported co
129129
- [sendTo](#send-to-action): sends an event to a specific actor.
130130
- [stop](#stop-action): stops a child actor.
131131

132-
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
132+
To add a built-in action, first add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
133133

134134
### On the canvas
135135

@@ -150,7 +150,7 @@ To add a built-in action, first add a [transition action](#add-a-transition-acti
150150

151151
You can also add custom actions with a custom action type and parameters which will be formatted as [XState action objects](#action-objects) in your [exported code](export-as-code.mdx).
152152

153-
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-to-a-state), or [exit action](#add-an-exit-action-to-a-state).
153+
First, add a [transition action](#add-a-transition-action), [entry action](#add-an-entry-action-or-exit-action-to-a-state), or [exit action](#add-an-entry-action-or-exit-action-to-a-state).
154154

155155
### On the canvas
156156

versioned_docs/version-5/actors.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ In the actor model, actors are objects that can communicate with each other. The
3737

3838
Actor logic is the actor’s logical “model” (brain, blueprint, DNA, etc.) It describes how the actor should change behavior when receiving an event. You can create actor logic using **actor logic creators**. The types of actor logic you can create from XState are:
3939

40-
- [State machine logic (`createMachine(...)`)](#TODO)
41-
- [Promise logic (`fromPromise(...)`)](#TODO)
42-
- [Transition logic (`fromTransition(...)`)](#TODO)
43-
- [Observable logic (`fromObservable(...)`)](#TODO)
44-
- [Event observable logic (`fromEventObservable(...)`)](#TODO)
45-
- [Callback logic (`fromCallback(...)`)](#TODO)
40+
- [State machine logic (`createMachine(...)`)](cheatsheet.mdx#creating-a-state-machine)
41+
- [Promise logic (`fromPromise(...)`)](cheatsheet.mdx#creating-promise-logic)
42+
- [Transition logic (`fromTransition(...)`)](cheatsheet.mdx#creating-promise-logic)
43+
- [Observable logic (`fromObservable(...)`)](cheatsheet.mdx#creating-observable-logic)
44+
- [Event observable logic (`fromEventObservable(...)`)](migration.mdx#use-actor-logic-creators-for-invokesrc-instead-of-functions)
45+
- [Callback logic (`fromCallback(...)`)](cheatsheet.mdx#creating-callback-logic)
4646

4747
In XState, actor logic is defined by an object containing methods like `.transition(...)`, `.getInitialState()`, `.getSnapshot()`, and more. This object tells an interpreter how to update an actor’s internal state when it receives an event and which effects to execute (if any).
4848

@@ -245,7 +245,7 @@ promiseActor.start();
245245

246246
## Transition actors
247247

248-
Transition actor logic is described by a [transition function](#TODO), similar to a [reducer](#TODO). Transition functions take the current `state` and received `event` object as arguments, and return the next state. Actors created from transition logic (“transition actors”) can:
248+
Transition actor logic is described by a [transition function](migration.mdx#use-actor-logic-creators-for-invokesrc-instead-of-functions), similar to a [reducer](cheatsheet.mdx#creating-transition-logic). Transition functions take the current `state` and received `event` object as arguments, and return the next state. Actors created from transition logic (“transition actors”) can:
249249

250250
- Receive events
251251
- Emit snapshots of its state
@@ -277,7 +277,7 @@ transitionActor.send({ type: 'increment' });
277277

278278
## Observable actors
279279

280-
Observable actor logic is described by an [observable stream of values](#TODO). Actors created from observable logic (“observable actors”) can:
280+
Observable actor logic is described by an [observable stream of values](cheatsheet.mdx#creating-observable-logic). Actors created from observable logic (“observable actors”) can:
281281

282282
- Emit snapshots of its emitted value
283283

versioned_docs/version-5/developer-tools.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: 'Developer tools'
33
description: 'Find out more about the Stately XState CLI (Command Line Interface) and Chrome Devtools.'
44
---
55

6-
Find more about our [XState CLI (Command Line Interface)](#xstate-cli-command-line-interface) and [Chrome Devtools](#chrome-devtools) below. We plan to make extensions for more IDEs (Integrated Development Environments) in the future.
6+
Find more about our [XState CLI (Command Line Interface)](#xstate-cli-command-line-interface) below. We plan to make extensions for more IDEs (Integrated Development Environments) in the future.
77

88
:::xstate
99

0 commit comments

Comments
 (0)