ast

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 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 Breadcrumb struct {
	Page  *tree.Page
	Items []*BreadcrumbItem
}
func (ast *Breadcrumb) ToHTML(w *html.Writer)
type BreadcrumbItem struct {
	Title string
	URL   string
}

type BulletList

type BulletList struct {
	Items []*ListItem
}

func (*BulletList) ToHTML

func (ast *BulletList) ToHTML(w *html.Writer)

type Callout

type Callout struct {
	Title   string
	Text    *Text
	Content string
	Nodes   []Node
}

func (*Callout) AppendNode

func (ast *Callout) AppendNode(node Node)

func (*Callout) GetNodes

func (ast *Callout) GetNodes() []Node

func (*Callout) ToHTML

func (ast *Callout) ToHTML(w *html.Writer)

type ChildList

type ChildList struct {
	Items []*ChildListItem
}

func (*ChildList) AddItem

func (ast *ChildList) AddItem(row *ChildListItem) *ChildListItem

func (*ChildList) NewItem

func (ast *ChildList) NewItem() *ChildListItem

func (*ChildList) ToHTML

func (ast *ChildList) ToHTML(w *html.Writer)

type ChildListItem

type ChildListItem struct {
	Title string
	URL   string
}

type Code

type Code struct {
	Language string
	Lines    []string
	Text     string
}

func (*Code) ToHTML

func (ast *Code) ToHTML(w *html.Writer)

type Container

type Container interface {
	GetNodes() []Node
	AppendNode(node Node)
}

type ContainerEx

type ContainerEx interface {
	Container
	ShouldProcessChildren() bool
}

type DB

type DB struct {
	ID            string
	PropertyNames []string
	Entries       []*DBEntry
}

func (*DB) NewEntry

func (ast *DB) NewEntry() *DBEntry

func (*DB) ToHTML

func (ast *DB) ToHTML(w *html.Writer)

type DBEntry

type DBEntry struct {
	ID         string
	Properties []*DBEntryProperty
	Content    *DBEntryContent
	Title      string
}

func (*DBEntry) NewProperty

func (ast *DBEntry) NewProperty(name string, value DBEntryPropertyValue) *DBEntryProperty

func (*DBEntry) Render

func (ast *DBEntry) Render(w *html.Writer)

func (*DBEntry) ToHTML

func (ast *DBEntry) ToHTML(w *html.Writer)

type DBEntryContent

type DBEntryContent struct {
	Nodes []Node
	HTML  string
}

func (*DBEntryContent) AppendNode

func (ast *DBEntryContent) AppendNode(node Node)

func (*DBEntryContent) GetNodes

func (ast *DBEntryContent) GetNodes() []Node

func (*DBEntryContent) Render

func (ast *DBEntryContent) Render(w *html.Writer)

func (*DBEntryContent) ToHTML

func (ast *DBEntryContent) ToHTML(w *html.Writer)

type DBEntryProperty

type DBEntryProperty struct {
	Name    string
	Value   DBEntryPropertyValue
	Content string
}

func (*DBEntryProperty) Render

func (v *DBEntryProperty) Render(w *html.Writer)

func (*DBEntryProperty) ToHTML

func (v *DBEntryProperty) ToHTML(w *html.Writer)

type DBEntryPropertyBoolValue

type DBEntryPropertyBoolValue struct {
	Value bool
}

func NewDBEntryPropertyBoolValue

func NewDBEntryPropertyBoolValue(value bool) *DBEntryPropertyBoolValue

func (*DBEntryPropertyBoolValue) ToHTML

func (v *DBEntryPropertyBoolValue) ToHTML(w *html.Writer)

type DBEntryPropertyRichTextValue

type DBEntryPropertyRichTextValue struct {
	Value *Text
}

func NewDBEntryPropertyRichTextValue

func NewDBEntryPropertyRichTextValue(value *Text) *DBEntryPropertyRichTextValue

func (*DBEntryPropertyRichTextValue) ToHTML

type DBEntryPropertyTagsValue

type DBEntryPropertyTagsValue struct {
	Values []*DBEntryTag
}

func NewDBEntryPropertyTagsValue

func NewDBEntryPropertyTagsValue(values []*DBEntryTag) *DBEntryPropertyTagsValue

func (*DBEntryPropertyTagsValue) ToHTML

func (v *DBEntryPropertyTagsValue) ToHTML(w *html.Writer)

type DBEntryPropertyTextValue

type DBEntryPropertyTextValue struct {
	Value string
}

func NewDBEntryPropertyTextValue

func NewDBEntryPropertyTextValue(value string) *DBEntryPropertyTextValue

func (*DBEntryPropertyTextValue) ToHTML

func (v *DBEntryPropertyTextValue) ToHTML(w *html.Writer)

type DBEntryPropertyTitleValue

type DBEntryPropertyTitleValue struct {
	Value string
}

func NewDBEntryPropertyTitleValue

func NewDBEntryPropertyTitleValue(value string) *DBEntryPropertyTitleValue

func (*DBEntryPropertyTitleValue) ToHTML

func (v *DBEntryPropertyTitleValue) ToHTML(w *html.Writer)

type DBEntryPropertyValue

type DBEntryPropertyValue interface {
	ToHTML(w *html.Writer)
}

type DBEntryTag

type DBEntryTag struct {
	Name  string
	Color string
}

type Divider

type Divider struct {
}

func (*Divider) ToHTML

func (ast *Divider) ToHTML(w *html.Writer)

type File

type File struct {
	ExternalHref string
	Name         string
}

func (*File) ToHTML

func (ast *File) ToHTML(w *html.Writer)

type Heading

type Heading struct {
	Level   int
	Text    *Text
	Content string
}

func (*Heading) ToHTML

func (ast *Heading) ToHTML(w *html.Writer)

type Image

type Image struct {
	Href       string
	CachedHref string
}

func (*Image) ToHTML

func (ast *Image) ToHTML(w *html.Writer)

type IndexPage

type IndexPage struct {
	Pages          tree.Pages
	LastUpdated    time.Time
	Items          []*IndexPageItem
	LastUpdatedStr string
}

func (*IndexPage) ToHTML

func (ast *IndexPage) ToHTML(w *html.Writer)

type IndexPageItem

type IndexPageItem struct {
	Page  *tree.Page
	Depth int
}

type LinkPreview

type LinkPreview struct {
	URL         string
	Title       string
	Icon        string
	Name        string
	Description string
	Images      []string
	Link        string
}

func (*LinkPreview) ToHTML

func (ast *LinkPreview) ToHTML(w *html.Writer)

type ListItem

type ListItem struct {
	Text    *Text
	Nodes   []Node
	Checked bool
	Content string
}

func (*ListItem) AppendNode

func (ast *ListItem) AppendNode(node Node)

func (*ListItem) GetNodes

func (ast *ListItem) GetNodes() []Node

func (*ListItem) Render

func (ast *ListItem) Render(w *html.Writer)

func (*ListItem) ToHTML

func (ast *ListItem) ToHTML(w *html.Writer)

type Node

type Node interface {
	ToHTML(w *html.Writer)
}

type NumberedList

type NumberedList struct {
	Items []*ListItem
}

func (*NumberedList) ToHTML

func (ast *NumberedList) ToHTML(w *html.Writer)

type Page

type Page struct {
	Page       *tree.Page
	Title      string
	Content    string
	Breadcrumb string
	Nodes      []Node
}

func (*Page) AppendNode

func (ast *Page) AppendNode(node Node)

func (*Page) GetNodes

func (ast *Page) GetNodes() []Node

func (*Page) ToHTML

func (ast *Page) ToHTML(w *html.Writer)

type Paragraph

type Paragraph struct {
	Text    *Text
	Nodes   []Node
	Content string
}

func (*Paragraph) AppendNode

func (ast *Paragraph) AppendNode(node Node)

func (*Paragraph) GetNodes

func (ast *Paragraph) GetNodes() []Node

func (*Paragraph) ToHTML

func (ast *Paragraph) ToHTML(w *html.Writer)

type Quote

type Quote struct {
	Text    *Text
	Nodes   []Node
	Content string
}

func (*Quote) AppendNode

func (ast *Quote) AppendNode(node Node)

func (*Quote) GetNodes

func (ast *Quote) GetNodes() []Node

func (*Quote) ToHTML

func (ast *Quote) ToHTML(w *html.Writer)

type Table

type Table struct {
	HasColumnHeader bool
	HasRowHeader    bool
	Rows            []*TableRow
	HeaderRow       *TableRow
	BodyRows        []*TableRow
}

func (*Table) AddRow

func (ast *Table) AddRow(row *TableRow) *TableRow

func (*Table) AppendNode

func (ast *Table) AppendNode(node Node)

func (*Table) GetNodes

func (ast *Table) GetNodes() []Node

func (*Table) NewRow

func (ast *Table) NewRow() *TableRow

func (*Table) ShouldProcessChildren

func (ast *Table) ShouldProcessChildren() bool

func (*Table) ToHTML

func (ast *Table) ToHTML(w *html.Writer)

type TableCell

type TableCell struct {
	Text    *Text
	Content string
}

func (*TableCell) WithText

func (ast *TableCell) WithText(text *Text) *TableCell

type TableRow

type TableRow struct {
	Cells []*TableCell

	HeaderCell *TableCell
	BodyCells  []*TableCell
}

func (*TableRow) AddCell

func (ast *TableRow) AddCell(row *TableCell) *TableCell

func (*TableRow) NewCell

func (ast *TableRow) NewCell() *TableCell

type Text

type Text struct {
	Runs []*TextRun
}

func NewHrefText

func NewHrefText(str, url string) *Text

func NewPlainText

func NewPlainText(str string) *Text

func (*Text) ToHTML

func (ast *Text) ToHTML(w *html.Writer)

type TextRun

type TextRun struct {
	Bold          bool
	Italic        bool
	Strikethrough bool
	Underline     bool
	Code          bool
	Color         string
	Href          string
	Text          string
}

func (*TextRun) ToHTML

func (ast *TextRun) ToHTML(w *html.Writer)

type TodoList

type TodoList struct {
	Items []*ListItem
}

func (*TodoList) ToHTML

func (ast *TodoList) ToHTML(w *html.Writer)

type Toggle

type Toggle struct {
	ID      string
	Text    *Text
	Nodes   []Node
	Header  string
	Content string
}

func (*Toggle) AppendNode

func (ast *Toggle) AppendNode(node Node)

func (*Toggle) GetNodes

func (ast *Toggle) GetNodes() []Node

func (*Toggle) ToHTML

func (ast *Toggle) ToHTML(w *html.Writer)

type Video

type Video struct {
	URL         string
	Caption     *Text
	CaptionHTML string
	Youtube     *YoutubeVideo
}

func (*Video) ToHTML

func (ast *Video) ToHTML(w *html.Writer)

type YoutubeVideo

type YoutubeVideo struct {
	URL string
}

Jump to

Keyboard shortcuts

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