This repo demonstrates how ProseMirror could be used to build a visual editor for Govspeak.
Govspeak is a flavour of Markdown used for publishing content on GOV.UK.
- Clone this repo
- Install dependencies
npm install
- Run the development server
npm run dev
The editor implements a schema based on the prosemirror-schema-basic and prosemirror-schema-list modules, extended with some Govspeak-specific nodes (such as callouts).
It also builds upon the prosemirror-example-setup package which provides a basic editor UI and some useful configuration defaults.
You'll find custom Govspeak-specific nodes defined in the src/nodes directory.
Each 'node' file in that directory defines a few things:
- A NodeSpec, which describes the node's schema for use with the prosemirror-model module
- Input rules, which enable users to type Markdown-esque syntax to create nodes using the prosemirror-inputrules module
- A
buildMenu
function which can add custom buttons to the toolbar menu provided by the prosemirror-example-setup module.