Documentation
¶
Index ¶
Constants ¶
const ListTypeKey = "__LIST_TYPE__"
ListTypeKey is used to get the list type off of the attrs when rendering a list
Variables ¶
This section is empty.
Functions ¶
func Render ¶
func Render(editorState *EditorState, config *Config) string
Render takes the editorState and config and returns the content as a string
Types ¶
type Config ¶
Config is passed to the render function and configures how to render the various content types
func NewHTMLConfig ¶
func NewHTMLConfig() *Config
NewHTMLConfig returns a Config configured for HTML
func NewMarkdownConfig ¶
func NewMarkdownConfig() *Config
NewMarkdownConfig creates a Config configured to render markdown
func NewPlainTextConfig ¶
func NewPlainTextConfig() *Config
NewPlaintextConfig creates a config configured to render plain text
type Content ¶
type EditorState ¶
type EditorState struct {
Content []*Content `json:"content"`
Selection *Selection `json:"selection"`
Type string `json:"type"`
}
EditorState - http://prosemirror.net/docs/ref/#state.Editor_State
type Mark ¶
type Option ¶
type Option interface {
RenderBefore(int, map[string]interface{}) string
RenderAfter(int, map[string]interface{}) string
}
Option configures what to render before and after a specific content type
type Selection ¶
type Selection struct {
Anchor int `json:"anchor"`
Head int `json:"head"`
Type string `json:"type"`
}
Selection - http://prosemirror.net/docs/ref/#state.Selection
type SimpleOption ¶
SimpleOption implements Option. Can be used when Before/After strings are constant.
func (SimpleOption) RenderAfter ¶
func (o SimpleOption) RenderAfter(_ int, _ map[string]interface{}) string
RenderBefore returns the After string
func (SimpleOption) RenderBefore ¶
func (o SimpleOption) RenderBefore(_ int, _ map[string]interface{}) string
RenderBefore returns the Before string