Skip to content

Commit f8cbd57

Browse files
committed
docs: update notes about usage
1 parent a7bb0cd commit f8cbd57

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
11
# MyST JS Plugin
22

3-
An example of deploying a MyST book that uses a JS Plugin to strike-though document prose (see `plugin.mjs`). This plugin uses `esbuild` to bundle dependencies.
3+
An example of a MyST JS Plugin to strike-though document prose (see `plugin.mjs`). This plugin uses `esbuild` to bundle dependencies.
4+
5+
## Build the bundle
6+
7+
The `esbuild` tool takes `plugin.mjs` and its dependencies as inputs, and generates a `dist/plugin.mjs` bundle. This bundle can be directly loaded by MyST without requiring a build or install step.
8+
9+
The `build` script defined in `package.json` shows an example of using `esbuild` to generate an `mjs` module. It can be invoked by running
10+
11+
```shell
12+
npm run build
13+
```
14+
15+
## Using the bundled plugin
16+
17+
The output MyST plugin can be loaded into a MyST project in several ways. The user may wish to download the plugin to their local filesystem, and write the following `myst.yml`:
18+
19+
```yaml
20+
project:
21+
plugins:
22+
- /path/to/plugin.mjs
23+
```
24+
25+
Alternatively, you can publish the built plugin to a public artifact repository, and users can directly link to it in their `myst.yml`:
26+
27+
```yaml
28+
project:
29+
plugins:
30+
- https://www.someone-elses-myst-plugins.com/plugin.mjs
31+
```

0 commit comments

Comments
 (0)