element

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code []Element

func (Code) Append

func (c Code) Append(els []Element) Element

func (Code) Text

func (c Code) Text() string

type CodeBlock

type CodeBlock []Element

func (CodeBlock) Append

func (cb CodeBlock) Append(els []Element) Element

func (CodeBlock) Text

func (cb CodeBlock) Text() string

type Element

type Element interface {
	Text() string
	Append([]Element) Element
}

func MakePlain

func MakePlain(tok token.Token) Element

type Emphasis

type Emphasis []Element

func (Emphasis) Append

func (em Emphasis) Append(els []Element) Element

func (Emphasis) Text

func (em Emphasis) Text() string

type Empty

type Empty struct{}

func (Empty) Text

func (e Empty) Text() string
type Header struct {
	Title      string
	Author     string
	Date       time.Time
	Attributes map[string]string
}

func (Header) Append

func (h Header) Append(_ []Element) Element

func (Header) Text

func (h Header) Text() string

type Image

type Image struct {
	Src string
	Alt string
}

func (Image) Text

func (i Image) Text() string
type Link struct {
	URL   string
	Title string
}

func (Link) Append

func (l Link) Append(_ []Element) Element

func (Link) Text

func (l Link) Text() string

type List

type List []ListItem

func (List) Append

func (l List) Append(els []Element) Element

func (List) Text

func (l List) Text() string

type ListItem

type ListItem []Element

func (ListItem) Append

func (li ListItem) Append(els []Element) Element

func (ListItem) Text

func (li ListItem) Text() string

type Paragraph

type Paragraph struct {
	Elements []Element
}

func (Paragraph) Append

func (p Paragraph) Append(els []Element) Element

func (Paragraph) Text

func (p Paragraph) Text() string

type ParseResult

type ParseResult struct {
	Element Element
	Inner   []token.Token
}

func NewCodeBlockFromTokens

func NewCodeBlockFromTokens(p ReadUnreader) (ParseResult, bool)

func NewHeaderFromTokens

func NewHeaderFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewLinkFromTokens

func NewLinkFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewListFromTokens

func NewListFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewListItemFromTokens

func NewListItemFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewParagraphFromTokens

func NewParagraphFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewStyleFromTokens

func NewStyleFromTokens(tr ReadUnreader) (ParseResult, bool)

func NewSubTitleFromTokens

func NewSubTitleFromTokens(tr ReadUnreader) (ParseResult, bool)

type ReadUnreader

type ReadUnreader interface {
	Read(n int) ([]token.Token, bool)
	Unread(n int) bool
}

type Strong

type Strong []Element

func (Strong) Append

func (st Strong) Append(els []Element) Element

func (Strong) Text

func (st Strong) Text() string

type SubSubTitle

type SubSubTitle string

func (SubSubTitle) Append

func (st SubSubTitle) Append(_ []Element) Element

func (SubSubTitle) Text

func (st SubSubTitle) Text() string

type SubTitle

type SubTitle string

func (SubTitle) Append

func (st SubTitle) Append(_ []Element) Element

func (SubTitle) Text

func (st SubTitle) Text() string

type WhiteSpace

type WhiteSpace string

func (WhiteSpace) Append

func (ws WhiteSpace) Append(_ []Element) Element

func (WhiteSpace) Text

func (ws WhiteSpace) Text() string

type Word

type Word string

func (Word) Append

func (w Word) Append(_ []Element) Element

func (Word) Text

func (w Word) Text() string

Jump to

Keyboard shortcuts

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