@ryaninvents/prosemirror-doc-tpl
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@ryaninvents/prosemirror-doc-tpl

Create Prosemirror documents using JSX-like syntax

CircleCI GitHub repository semantic-release Maintenance status as of 2019

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>
`;

Readme

Keywords

none

Package Sidebar

Install

npm i @ryaninvents/prosemirror-doc-tpl

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

13.4 kB

Total Files

7

Last publish

Collaborators

  • ryaninvents