This is a starter project for creating a ProseMirror plugin
The following references should be updated to better represent your plugin:
- Change
name
to your plugin name - Change
description
to a description of your plugin - Change
repository.url
to the git url for your plugin - Change
bugs.url
to be your github issues page - Change
homepage
to be your github readme or dedicated webstie
- Change
Plugin
class name to be representative of your plugin - Add your options to
get defaultOptions()
- Change
plugin
name in defineOption first parameter - Change where
plugin
is stored inpm.mod
- Change
Plugin
class to match the class name insrc/plugin.js
- Add relevant commands for your plugin
- Change
plugin
option to be the same as the string passed to defineOption insrc/option.js
- Delete everything above the template line
- Update all references in
[brackets]
===== Below here is a Plugin README.md template, change anything in [brackets]
=====
[Default] Plugin for ProseMirror
Open your project in command prompt and run:
npm install prosemirror --save
npm install [prosemirror-plugin-base] --save
In your ProseMirror initialization script:
import { ProseMirror } from "prosemirror"
import "[prosemirror-plugin-base]"
let pm = new ProseMirror({
place: document.querySelector("#target"),
[plugin]: {}
})
The following options can be passed in the [find] object when ProseMirror is initialized:
[anOption (Boolean, default: true): An option description]
A simple, default set of commands is included, if you choose to use them:
import { CommandSet, ProseMirror } from "prosemirror/dist/edit"
import { commands } from "[prosemirror-plugin-base]"
let pm = new ProseMirror({
place: document.querySelector("#target"),
[plugin]: {},
commands: CommandSet.default.add(commands)
})
[sampleCommand (Ctrl + Shift + Meta + Y) - A sample command]
To run a quick demo (based on ProseMirror demo) run the following from the [prosemirror-plugin-base]
directory in a command prompt:
npm install
npm install prosemirror
(npm > 3 will not install peerDependencies for you)
npm run demo
Connect to http://localhost:8080
in your browser