block

package
v0.0.0-...-52599dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseBlock

type BaseBlock struct {
	Type  string               `json:"type"`
	Text  string               `json:"text"`
	Spans []span.SpanInterface `json:"spans"`
}

Common block properties

func (*BaseBlock) AsText

func (b *BaseBlock) AsText() string

func (*BaseBlock) FormatHtmlText

func (b *BaseBlock) FormatHtmlText() string

Formats the block content as html, without enclosing tags

func (b *BaseBlock) ResolveLinks(r link.Resolver)

Resolves links

type Block

type Block interface {
	Decode(interface{}) error
	AsHtml() string
	AsText() string
	ParentHtmlTag() string
	ResolveLinks(link.Resolver)
}

type Embed

type Embed struct {
	BaseBlock
	Embed *embed.Embed
}

A embed block

func (*Embed) AsHtml

func (e *Embed) AsHtml() string

func (*Embed) Decode

func (e *Embed) Decode(enc interface{}) error

func (*Embed) ParentHtmlTag

func (e *Embed) ParentHtmlTag() string

type Heading

type Heading struct {
	BaseBlock
}

A heading (h1, h2, h3, h4) block

func (*Heading) AsHtml

func (h *Heading) AsHtml() string

func (*Heading) Decode

func (h *Heading) Decode(enc interface{}) error

func (*Heading) ParentHtmlTag

func (h *Heading) ParentHtmlTag() string

type Image

type Image struct {
	BaseBlock
	View *image.View
}

An image block

func (*Image) AsHtml

func (i *Image) AsHtml() string

func (*Image) Decode

func (i *Image) Decode(enc interface{}) error

func (*Image) ParentHtmlTag

func (i *Image) ParentHtmlTag() string

type ListItem

type ListItem struct {
	BaseBlock
}

A list block (unordered)

func (*ListItem) AsHtml

func (l *ListItem) AsHtml() string

func (*ListItem) Decode

func (l *ListItem) Decode(enc interface{}) error

func (*ListItem) ParentHtmlTag

func (l *ListItem) ParentHtmlTag() string

type OrderedListItem

type OrderedListItem struct {
	BaseBlock
}

A list block (ordered)

func (*OrderedListItem) AsHtml

func (l *OrderedListItem) AsHtml() string

func (*OrderedListItem) Decode

func (l *OrderedListItem) Decode(enc interface{}) error

func (*OrderedListItem) ParentHtmlTag

func (l *OrderedListItem) ParentHtmlTag() string

type Paragraph

type Paragraph struct {
	BaseBlock
}

A paragraph block

func (*Paragraph) AsHtml

func (p *Paragraph) AsHtml() string

func (*Paragraph) Decode

func (p *Paragraph) Decode(enc interface{}) error

func (*Paragraph) ParentHtmlTag

func (p *Paragraph) ParentHtmlTag() string

type Preformatted

type Preformatted struct {
	BaseBlock
}

A preformatted block

func (*Preformatted) AsHtml

func (p *Preformatted) AsHtml() string

func (*Preformatted) Decode

func (p *Preformatted) Decode(enc interface{}) error

func (*Preformatted) ParentHtmlTag

func (p *Preformatted) ParentHtmlTag() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL