@ryaninvents/prosemirror-doc-tpl
v1.0.1
Published
Create Prosemirror documents using JSX-like syntax
Downloads
2
Readme
@ryaninvents/prosemirror-doc-tpl
Create Prosemirror documents using JSX-like syntax
Why do I want to use this?
This package provides a concise way to create Prosemirror documents using a JSX-like syntax, for testing or content generation.
Installation
npm install --save @ryaninvents/prosemirror-doc-tpl
Usage
This package uses your schema to generate nodes. Create the template tag with createBuilder
, then use the tag
to generate ProseMirror documents.
import createBuilder from '@ryaninvents/prosemirror-doc-tpl';
import mySchema from './schema';
const pm = createBuilder(mySchema);
const starterDocument = pm`
<doc>
<heading level=1>prosemirror-doc-tpl</heading>
<blockquote>
Create <link href="https://prosemirror.net" title="ProseMirror">ProseMirror</link>
documents using JSX-like syntax
</blockquote>
<paragraph>
This package provides a concise way to create Prosemirror documents using
a JSX-like syntax, for testing or content generation.
</paragraph>
</doc>
`;