ast

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseBlock added in v0.18.1

type BaseBlock struct {
	BaseNode
}

type BaseInline added in v0.18.1

type BaseInline struct {
	BaseNode
}

type BaseNode added in v0.18.1

type BaseNode struct {
	// contains filtered or unexported fields
}

func (*BaseNode) NextSibling added in v0.18.1

func (n *BaseNode) NextSibling() Node

func (*BaseNode) PrevSibling added in v0.18.1

func (n *BaseNode) PrevSibling() Node

func (*BaseNode) SetNextSibling added in v0.18.1

func (n *BaseNode) SetNextSibling(node Node)

func (*BaseNode) SetPrevSibling added in v0.18.1

func (n *BaseNode) SetPrevSibling(node Node)

type Blockquote added in v0.18.1

type Blockquote struct {
	BaseBlock

	Children []Node
}

func (*Blockquote) Type added in v0.18.1

func (*Blockquote) Type() NodeType

type Bold added in v0.18.1

type Bold struct {
	BaseInline

	// Symbol is "*" or "_".
	Symbol  string
	Content string
}

func (*Bold) Type added in v0.18.1

func (*Bold) Type() NodeType

type BoldItalic added in v0.18.1

type BoldItalic struct {
	BaseInline

	// Symbol is "*" or "_".
	Symbol  string
	Content string
}

func (*BoldItalic) Type added in v0.18.1

func (*BoldItalic) Type() NodeType

type Code added in v0.18.1

type Code struct {
	BaseInline

	Content string
}

func (*Code) Type added in v0.18.1

func (*Code) Type() NodeType

type CodeBlock added in v0.18.1

type CodeBlock struct {
	BaseBlock

	Language string
	Content  string
}

func (*CodeBlock) Type added in v0.18.1

func (*CodeBlock) Type() NodeType

type Heading added in v0.18.1

type Heading struct {
	BaseBlock

	Level    int
	Children []Node
}

func (*Heading) Type added in v0.18.1

func (*Heading) Type() NodeType

type HorizontalRule added in v0.18.1

type HorizontalRule struct {
	BaseBlock

	// Symbol is "*" or "-" or "_".
	Symbol string
}

func (*HorizontalRule) Type added in v0.18.1

func (*HorizontalRule) Type() NodeType

type Image added in v0.18.1

type Image struct {
	BaseInline

	AltText string
	URL     string
}

func (*Image) Type added in v0.18.1

func (*Image) Type() NodeType

type Italic added in v0.18.1

type Italic struct {
	BaseInline

	// Symbol is "*" or "_".
	Symbol  string
	Content string
}

func (*Italic) Type added in v0.18.1

func (*Italic) Type() NodeType

type LineBreak added in v0.18.1

type LineBreak struct {
	BaseBlock
}

func (*LineBreak) Type added in v0.18.1

func (*LineBreak) Type() NodeType
type Link struct {
	BaseInline

	Text string
	URL  string
}

func (*Link) Type added in v0.18.1

func (*Link) Type() NodeType

type Node

type Node interface {
	// Type returns a node type.
	Type() NodeType

	// PrevSibling returns a previous sibling node of this node.
	PrevSibling() Node

	// NextSibling returns a next sibling node of this node.
	NextSibling() Node

	// SetPrevSibling sets a previous sibling node to this node.
	SetPrevSibling(Node)

	// SetNextSibling sets a next sibling node to this node.
	SetNextSibling(Node)
}

type NodeType added in v0.18.1

type NodeType uint32
const (
	UnknownNode NodeType = iota
	// Block nodes.
	LineBreakNode
	ParagraphNode
	CodeBlockNode
	HeadingNode
	HorizontalRuleNode
	BlockquoteNode
	// Inline nodes.
	TextNode
	BoldNode
	ItalicNode
	BoldItalicNode
	CodeNode
	ImageNode
	LinkNode
	TagNode
	StrikethroughNode
)

type Paragraph added in v0.18.1

type Paragraph struct {
	BaseBlock

	Children []Node
}

func (*Paragraph) Type added in v0.18.1

func (*Paragraph) Type() NodeType

type Strikethrough added in v0.18.1

type Strikethrough struct {
	BaseInline

	Content string
}

func (*Strikethrough) Type added in v0.18.1

func (*Strikethrough) Type() NodeType

type Tag added in v0.18.1

type Tag struct {
	BaseInline

	Content string
}

func (*Tag) Type added in v0.18.1

func (*Tag) Type() NodeType

type Text added in v0.18.1

type Text struct {
	BaseInline

	Content string
}

func (*Text) Type added in v0.18.1

func (*Text) Type() NodeType

Jump to

Keyboard shortcuts

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