Skip to content

Commit 1b70b8c

Browse files
committed
recommend npm scripts
1 parent ecdf902 commit 1b70b8c

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

docs/index.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,26 @@
175175
npm install @observablehq/notebook-kit
176176
```
177177
</script>
178+
<script id="83" type="text/markdown">
179+
Then define a couple scripts in your `package.json`:
180+
181+
```json
182+
{
183+
"dependencies": {
184+
"@observablehq/notebook-kit": "^1.0.1"
185+
},
186+
"scripts": {
187+
"docs:preview": "notebooks preview --root docs",
188+
"docs:build": "notebooks build --root docs -- docs/*.html"
189+
}
190+
}
191+
```
192+
</script>
178193
<script id="77" type="text/markdown">
179194
Then run the `notebooks build` command:
180195

181196
```sh
182-
notebooks build
197+
npm run docs:build
183198
```
184199
</script>
185200
<script id="79" type="text/markdown">
@@ -194,7 +209,7 @@
194209
The `build` command is implemented on top of [Vite](https://vite.dev), making it incredibly fast. If you prefer to author notebooks in a text editor rather than using Observable Desktop, you can use Vite's preview server for a live preview as you edit.
195210

196211
```sh
197-
notebooks preview
212+
npm run docs:preview
198213
```
199214

200215
See the [Notebook Kit documentation](./kit) for more.

docs/kit.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,21 @@ <h1>Hello, <i>world</i>!</h1>
207207

208208
Notebook Kit's CLI supports three commands: `preview` for a live preview of notebooks, `build` for building a static site, and `download` for downloading Observable Notebooks as HTML.
209209
</script>
210+
<script id="71" type="text/markdown">
211+
We recommend that you install Notebook Kit locally to a project using a package manager such as npm, and then add preview and build scripts to your `package.json`.
212+
213+
```json
214+
{
215+
"dependencies": {
216+
"@observablehq/notebook-kit": "^1.0.1"
217+
},
218+
"scripts": {
219+
"docs:preview": "notebooks preview --root docs",
220+
"docs:build": "notebooks build --root docs -- docs/*.html"
221+
}
222+
}
223+
```
224+
</script>
210225
<script id="9" type="text/markdown">
211226
### Preview
212227

0 commit comments

Comments
 (0)