Documentation
¶
Index ¶
- type BaseNode
- func (b *BaseNode) Accept(visitor Visitor) error
- func (b *BaseNode) AddChild(child Node)
- func (b *BaseNode) Children() []Node
- func (b *BaseNode) Parent() Node
- func (b *BaseNode) Range() Range
- func (b *BaseNode) RemoveChild(child Node)
- func (b *BaseNode) SetParent(parent Node)
- func (b *BaseNode) Type() NodeType
- type Code
- type CodeBlock
- type Document
- type Emphasis
- type Heading
- type Link
- type List
- type ListItem
- type Node
- type NodeType
- type NotedownParser
- type Paragraph
- type Parser
- type Position
- type Range
- type Strong
- type Text
- type Visitor
- type WalkFunc
- type Walker
- type Wikilink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseNode ¶
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode provides common functionality for all nodes
func NewBaseNode ¶
NewBaseNode creates a new base node
func (*BaseNode) RemoveChild ¶
RemoveChild removes a child node
type CodeBlock ¶
CodeBlock represents a code block node
func NewCodeBlock ¶
NewCodeBlock creates a new code block node
type Document ¶
Document represents the root document node
func (*Document) AddChild ¶
AddChild overrides BaseNode.AddChild to set the concrete Document as parent
func (*Document) FindListItemAtLine ¶
FindListItemAtLine finds the list item that contains the given line number
type Emphasis ¶
type Emphasis struct {
*BaseNode
}
Emphasis represents emphasized text (*text* or _text_)
type Heading ¶
Heading represents a heading node
func NewHeading ¶
NewHeading creates a new heading node
type List ¶
List represents a list node
func (*List) GetListItems ¶
GetListItems returns all ListItem children of this List
type ListItem ¶
type ListItem struct {
*BaseNode
TaskList bool
TaskState string // The actual task state value (e.g., " ", "x", "wip", "in-progress")
}
ListItem represents a list item node
func NewListItem ¶
NewListItem creates a new list item node
func (*ListItem) FindParentList ¶
FindParentList finds the parent List node for a given ListItem
func (*ListItem) GetListItemIndex ¶
GetListItemIndex returns the index of this ListItem within its parent List
func (*ListItem) GetSiblingListItems ¶
GetSiblingListItems returns all sibling ListItems in the same parent List
type Node ¶
type Node interface {
Type() NodeType
Range() Range
Parent() Node
SetParent(Node)
Children() []Node
AddChild(Node)
RemoveChild(Node)
Accept(Visitor) error
}
Node represents a node in the document tree
type NotedownParser ¶
type NotedownParser struct {
// contains filtered or unexported fields
}
NotedownParser implements the Parser interface using goldmark
func (*NotedownParser) Parse ¶
func (p *NotedownParser) Parse(source []byte) (*Document, error)
Parse parses markdown source bytes into a document tree
func (*NotedownParser) ParseString ¶
func (p *NotedownParser) ParseString(source string) (*Document, error)
ParseString parses markdown source string into a document tree
type Paragraph ¶
type Paragraph struct {
*BaseNode
}
Paragraph represents a paragraph node
func NewParagraph ¶
NewParagraph creates a new paragraph node
type Parser ¶
type Parser interface {
Parse(source []byte) (*Document, error)
ParseString(source string) (*Document, error)
}
Parser defines the interface for parsing markdown documents
type Position ¶
type Position struct {
Line int // 1-based line number
Column int // 1-based column number
Offset int // 0-based byte offset
}
Position represents a position in the source document
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker provides utilities for traversing document trees
type Wikilink ¶
Wikilink represents a wikilink node ([[page]] or [[page|display]])
func NewWikilink ¶
NewWikilink creates a new wikilink node