diff --git a/README.md b/README.md index b5e1c49..ad71906 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,17 @@ Here are the options you can pass to the MystEditor function: Also see [the demo HTML](./src/index.html) for an example on how you can set these options. +## Myst Editor for Git + +There is an additonal wrapper around the base editor that is meant to be easy to integrate with Git version control. +The wrapper is provided as a component located in [src/myst-git/MystEditorGit.jsx](src/myst-git/MystEditorGit.jsx). +You can import it from a build of Myst Editor with the following syntax: +```js +import { MystEditorGit } from "MystEditor.js"; +``` +There is an example page that makes use of this wrapper in [src/myst-git/git.html](src/myst-git/git.html). +The example page can be accessed while the Editor is running in development mode via the following URL: `/myst-git/git.html`. + ## License [Apache 2.0](./LICENSE) diff --git a/src/myst-git/git.html b/src/myst-git/git.html new file mode 100644 index 0000000..d6b0559 --- /dev/null +++ b/src/myst-git/git.html @@ -0,0 +1,131 @@ + + + + MyST editor Demo + + + + + +
+ + diff --git a/vite.config.js b/vite.config.js index 955b521..8743241 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,7 +12,7 @@ export default defineConfig({ outDir: "../dist", emptyOutDir: true, lib: { - entry: [resolve(__dirname, "src/MystEditor.jsx"), resolve(__dirname, "src/index.html")], + entry: [resolve(__dirname, "src/MystEditor.jsx"), resolve(__dirname, "src/index.html"), resolve(__dirname, "src/myst-git/git.html")], formats: ["es"], }, rollupOptions: { @@ -21,6 +21,8 @@ export default defineConfig({ manualChunks: (module) => { if (module.includes("index.html")) { return "index"; + } else if (module.includes("git.html")) { + return "git"; } else { return "MystEditor"; }