Class: PostNodeBuilder

PostNodeBuilder

The PostNodeBuilder is used to create new Post primitives, such as a MarkupSection, a CardSection, a Markup, etc. Every instance of an Editor has its own builder instance. The builder can be used inside an Editor#run callback to programmatically create new Post primitives to insert into the document. A PostNodeBuilder should be read from the Editor, not instantiated on its own.

Constructor

new PostNodeBuilder()

Source:

Methods

createAtom(name, valueopt, payloadopt, markupsopt) → {Atom}

Parameters:
Name Type Attributes Default Description
name String
value String <optional>
''
payload Object <optional>
{}
markups Array.<Markup> <optional>
[]
Source:
Returns:
Type
Atom

createCardSection(name, payloadopt) → {CardSection}

Parameters:
Name Type Attributes Default Description
name String
payload Object <optional>
{}
Source:
Returns:
Type
CardSection

createMarker(value, markupsopt) → {Marker}

Parameters:
Name Type Attributes Default Description
value String
markups Array.<Markup> <optional>
[]
Source:
Returns:
Type
Marker

createMarkup(tagName, attributes) → {Markup}

Parameters:
Name Type Description
tagName String
attributes Object

Key-value pairs of attributes for the markup

Source:
Returns:
Type
Markup

createMarkupSection(tagNameopt, markersopt) → {MarkupSection}

Parameters:
Name Type Attributes Default Description
tagName tagName <optional>
'P'
markers Array.<Marker> <optional>
[]
Source:
Returns:
Type
MarkupSection

createPost() → {Post}

Source:
Returns:

A new, blank post

Type
Post