Coelho.Schema.MarkSpec (coelho v0.3.1)

Copy Markdown View Source

Specification of a single mark type, such as bold or link.

Fields:

  • :name — the mark name, an atom
  • :attrs — map of attribute name to Coelho.Schema.Attr
  • :class — a CSS class merged into the rendered element and exported to the browser, so the editor shows the class the public page will use
  • :editor_attrs — extra DOM attributes for the editor only, exported with the schema and never emitted server side
  • :render — how the mark is turned into HTML, see Coelho.Render
  • :parse — HTML this mark is imported from, see Coelho.HTML

Summary

Types

t()

@type t() :: %Coelho.Schema.MarkSpec{
  attrs: %{optional(atom()) => Coelho.Schema.Attr.t()},
  class: String.t() | nil,
  editor_attrs: %{optional(String.t()) => String.t()},
  name: atom(),
  parse: [Coelho.HTML.rule()],
  render: Coelho.Schema.NodeSpec.render()
}