Skip to content

jupyter-book/example-js-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyST JS Plugin

An example of a MyST JS Plugin to strike-though document prose (see plugin.mjs). This plugin uses esbuild to bundle dependencies.

Build the bundle

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.

The build script defined in package.json shows an example of using esbuild to generate an mjs module. It can be invoked by running

npm run build

Using the bundled plugin

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:

project:
  plugins:
    - /path/to/plugin.mjs

Alternatively, you can publish the built plugin to a public artifact repository, and users can directly link to it in their myst.yml:

project:
  plugins:
    - https://www.someone-elses-myst-plugins.com/plugin.mjs

About

A demonstration JS plugin for use with the MyST Document Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published