Creating Extensions
There are three extension types.
PlainExtension- An extension which has no representation in the editable document but adds commands and other functionality that make working with documents manageable. All thebuiltinextensions are plain extensions. TheSchemaExtensionis used to create theSchemaand add extra attributes to the nodes and marks in your editor.NodeExtension- A node extension add the ProseMirror representation of the coreProsemirrorNodeto you editor. Examples including theImageExtensionand theParagraphExtension. Nodes can both by inline and block.MarkExtension- A mark extensions adds the definition for a ProseMirror Mark to the editor. A mark is like persistent meta data that can be attached to a node. It is used to add formatting and examples of this include theBoldExtensionand theItalicExtension.
The node and mark extensions get their name from the underlying prosemirror implementation. If you have time it's not a bad idea to peruse though the prosemirror documentation.
Naming conventions for npm packages:
- remirror-preset-<%NAME> For composing extensions together.
- remirror-extension-<%NAME> For adding behaviour.