Skip to content

ollietreend/govspeak-visual-editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Govspeak visual editor

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.

Local development

  1. Clone this repo
  2. Install dependencies
    npm install
    
  3. Run the development server
    npm run dev
    

Editor overview

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.

Govspeak-specific nodes

You'll find custom Govspeak-specific nodes defined in the src/nodes directory.

Each 'node' file in that directory defines a few things:

  1. A NodeSpec, which describes the node's schema for use with the prosemirror-model module
  2. Input rules, which enable users to type Markdown-esque syntax to create nodes using the prosemirror-inputrules module
  3. A buildMenu function which can add custom buttons to the toolbar menu provided by the prosemirror-example-setup module.

About

Prototype of a Govspeak editor built with ProseMirror

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published