ProsemirrorEx.Schema.Basic (prosemirror_ex v0.3.0)

Copy Markdown View Source

Node and mark specifications from prosemirror-schema-basic.

This is the CommonMark-oriented schema minus list nodes (see ProsemirrorEx.Schema.List). DOM parseDOM / toDOM rules are omitted.

Usage

schema = ProsemirrorEx.Schema.Basic.schema()

doc =
  ProsemirrorEx.Model.Schema.node(schema, "doc", nil, [
    ProsemirrorEx.Model.Schema.node(schema, "paragraph", nil, [
      ProsemirrorEx.Model.Schema.text(schema, "hello")
    ])
  ])

Summary

Functions

Individual mark spec maps keyed by name, for extending or composing schemas.

Mark specifications as {name, spec} tuples for Schema.new/1.

Individual node spec maps keyed by name, for extending or composing schemas.

Node specifications as {name, spec} tuples for Schema.new/1.

A compiled schema with the basic node and mark types.

Functions

mark_specs()

Individual mark spec maps keyed by name, for extending or composing schemas.

marks()

Mark specifications as {name, spec} tuples for Schema.new/1.

node_specs()

Individual node spec maps keyed by name, for extending or composing schemas.

nodes()

Node specifications as {name, spec} tuples for Schema.new/1.

schema()

A compiled schema with the basic node and mark types.