package ast

Import Path
	github.com/yuin/goldmark/ast (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 9 packages

Involved Source Files Package ast defines AST nodes that represent markdown elements. block.go inline.go
Package-Level Type Names (total 31, in which 30 are exported)
/* sort exporteds by: | */
An Attribute is an attribute of the Node Name []byte Value interface{} func (*BaseNode).Attributes() []Attribute func Node.Attributes() []Attribute
AutoLinkType defines kind of auto links. func NewAutoLink(typ AutoLinkType, value *Text) *AutoLink const AutoLinkEmail const AutoLinkURL
A BaseBlock struct implements the Node interface partialliy. BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type
A BaseInline struct implements the Node interface partialliy. BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type
A BaseNode struct implements the Node interface partialliy. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . FirstChild implements Node.FirstChild . HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . LastChild implements Node.LastChild . NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text .
A Blockquote struct represents an blockquote block of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewBlockquote() *Blockquote
A CodeBlock interface represents an indented code block of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw. Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewCodeBlock() *CodeBlock
A CodeSpan struct represents a code span of Markdown text. BaseInline BaseInline BaseInline.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . Inline implements Inline.Inline . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsBlank returns true if this node consists of spaces, otherwise false. IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewCodeSpan() *CodeSpan
A Document struct is a root node of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines Meta returns metadata of this document. NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetMeta sets given metadata to this document. SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type . *T : Node func NewDocument() *Document func (*BaseNode).OwnerDocument() *Document func (*Document).OwnerDocument() *Document func Node.OwnerDocument() *Document func github.com/yuin/goldmark/parser.ASTTransformer.Transform(node *Document, reader text.Reader, pc parser.Context) func golang.org/x/pkgsite/internal/postgres.(*ASTTransformer).Transform(node *Document, reader text.Reader, pc parser.Context)
An Emphasis struct represents an emphasis of Markdown text. BaseInline BaseInline BaseInline.BaseNode BaseNode Level is a level of the emphasis. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewEmphasis(level int) *Emphasis
A FencedCodeBlock struct represents a fenced code block of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode Info returns a info text of this fenced code block. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw. Kind implements Node.Kind. Language returns an language in an info string. Language returns nil if this node does not have an info string. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewFencedCodeBlock(info *Text) *FencedCodeBlock
A Heading struct represents headings like SetextHeading and ATXHeading. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode Level returns a level of this heading. This value is between 1 and 6. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewHeading(level int) *Heading
An HTMLBlock struct represents an html block of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode ClosureLine is a line that closes this html block. Type is a type of this html block. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . HasClosure returns true if this html block has a closure line, otherwise false. InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw. Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewHTMLBlock(typ HTMLBlockType) *HTMLBlock
HTMLBlockType represents kinds of an html blocks. See https://spec.commonmark.org/0.29/#html-blocks func NewHTMLBlock(typ HTMLBlockType) *HTMLBlock const HTMLBlockType1 const HTMLBlockType2 const HTMLBlockType3 const HTMLBlockType4 const HTMLBlockType5 const HTMLBlockType6 const HTMLBlockType7
An Image struct represents an image of the Markdown text. baseLink.BaseInline BaseInline baseLink.BaseInline.BaseNode BaseNode Destination is a destination(URL) of this link. Title is a title of this link. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . Inline implements Inline.Inline. InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewImage(link *Link) *Image
A List struct represents a list of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode IsTight is a true if this list is a 'tight' list. See https://spec.commonmark.org/0.29/#loose for details. Marker is a marker character like '-', '+', ')' and '.'. Start is an initial number of this ordered list. If this list is not an ordered list, Start is 0. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes CanContinue returns true if this list can continue with the given mark and a list type, otherwise false. ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsOrdered returns true if this list is an ordered list, otherwise false. IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewList(marker byte) *List
A ListItem struct represents a list item of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode Offset is an offset position of this item. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewListItem(offset int) *ListItem
A Node interface defines basic AST node functionalities. AppendChild append a node child to the tail of the children. Attribute returns a (attribute value, true) if an attribute associated with the given name is found, otherwise (nil, false) AttributeString returns a (attribute value, true) if an attribute associated with the given name is found, otherwise (nil, false) Attributes returns a list of attributes. This may be a nil if there are no attributes. ChildCount returns a total number of children. Dump dumps an AST tree structure to stdout. This function completely aimed for debugging. level is a indent level. Implementer should indent informations with 2 * level spaces. FirstChild returns a first child of this node. HasBlankPreviousLines returns true if the row before this node is blank, otherwise false. This method is valid only for block nodes. HasChildren returns true if this node has any children, otherwise false. InsertAfterinserts a node insertee after a node v1. If v1 is not children of this node, InsertBefore append a insetee to the tail of the children. InsertBefore inserts a node insertee before a node v1. If v1 is not children of this node, InsertBefore append a insetee to the tail of the children. IsRaw returns true if contents should be rendered as 'raw' contents. Kind returns a kind of this node. LastChild returns a last child of this node. Lines returns text segments that hold positions in a source. This method is valid only for block nodes. NextSibling returns a next sibling node of this node. OwnerDocument returns this node's owner document. If this node is not a child of the Document node, OwnerDocument returns nil. Parent returns a parent node of this node. PreviousSibling returns a previous sibling node of this node. RemoveAttributes removes all attributes from this node. RemoveChild removes a node child from this node. If a node child is not children of this node, RemoveChild nothing to do. RemoveChildren removes all children from this node. ReplaceChild replace a node v1 with a node insertee. If v1 is not children of this node, ReplaceChild append a insetee to the tail of the children. SetAttribute sets the given value to the attributes. SetAttributeString sets the given value to the attributes. SetBlankPreviousLines sets whether the row before this node is blank. This method is valid only for block nodes. SetLines sets text segments that hold positions in a source. This method is valid only for block nodes. SetNextSibling sets a next sibling node to this node. SetParent sets a parent node to this node. SetPreviousSibling sets a previous sibling node to this node. SortChildren sorts childrens by comparator. Text returns text values of this node. Type returns a type of this node. *AutoLink *Blockquote *CodeBlock *CodeSpan *Document *Emphasis *FencedCodeBlock *Heading *HTMLBlock *Image *Link *List *ListItem *Paragraph *RawHTML *String *Text *TextBlock *ThematicBreak *github.com/yuin/goldmark/extension/ast.DefinitionDescription *github.com/yuin/goldmark/extension/ast.DefinitionList *github.com/yuin/goldmark/extension/ast.DefinitionTerm *github.com/yuin/goldmark/extension/ast.Footnote *github.com/yuin/goldmark/extension/ast.FootnoteBacklink *github.com/yuin/goldmark/extension/ast.FootnoteLink *github.com/yuin/goldmark/extension/ast.FootnoteList *github.com/yuin/goldmark/extension/ast.Strikethrough *github.com/yuin/goldmark/extension/ast.Table *github.com/yuin/goldmark/extension/ast.TableCell *github.com/yuin/goldmark/extension/ast.TableHeader *github.com/yuin/goldmark/extension/ast.TableRow *github.com/yuin/goldmark/extension/ast.TaskCheckBox *github.com/yuin/goldmark/parser.Delimiter *github.com/yuin/goldmark-emoji/ast.Emoji func (*BaseNode).FirstChild() Node func (*BaseNode).LastChild() Node func (*BaseNode).NextSibling() Node func (*BaseNode).Parent() Node func (*BaseNode).PreviousSibling() Node func Node.FirstChild() Node func Node.LastChild() Node func Node.NextSibling() Node func Node.Parent() Node func Node.PreviousSibling() Node func github.com/yuin/goldmark/parser.BlockParser.Open(parent Node, reader text.Reader, pc parser.Context) (Node, parser.State) func github.com/yuin/goldmark/parser.DelimiterProcessor.OnMatch(consumes int) Node func github.com/yuin/goldmark/parser.InlineParser.Parse(parent Node, block text.Reader, pc parser.Context) Node func github.com/yuin/goldmark/parser.Parser.Parse(reader text.Reader, opts ...parser.ParseOption) Node func DumpHelper(v Node, source []byte, level int, kv map[string]string, cb func(int)) func IsParagraph(node Node) bool func MergeOrAppendTextSegment(parent Node, s textm.Segment) func MergeOrReplaceTextSegment(parent Node, n Node, s textm.Segment) func MergeOrReplaceTextSegment(parent Node, n Node, s textm.Segment) func Walk(n Node, walker Walker) error func (*BaseNode).AppendChild(self, v Node) func (*BaseNode).InsertAfter(self, v1, insertee Node) func (*BaseNode).InsertBefore(self, v1, insertee Node) func (*BaseNode).RemoveChild(self, v Node) func (*BaseNode).RemoveChildren(self Node) func (*BaseNode).ReplaceChild(self, v1, insertee Node) func (*BaseNode).SetNextSibling(v Node) func (*BaseNode).SetParent(v Node) func (*BaseNode).SetPreviousSibling(v Node) func Node.AppendChild(self, child Node) func Node.InsertAfter(self, v1, insertee Node) func Node.InsertBefore(self, v1, insertee Node) func Node.RemoveChild(self, child Node) func Node.RemoveChildren(self Node) func Node.ReplaceChild(self, v1, insertee Node) func Node.SetNextSibling(Node) func Node.SetParent(Node) func Node.SetPreviousSibling(Node) func (*Text).Merge(node Node, source []byte) bool func github.com/yuin/goldmark/parser.ProcessDelimiters(bottom Node, pc parser.Context) func github.com/yuin/goldmark/parser.BlockParser.Close(node Node, reader text.Reader, pc parser.Context) func github.com/yuin/goldmark/parser.BlockParser.Continue(node Node, reader text.Reader, pc parser.Context) parser.State func github.com/yuin/goldmark/parser.BlockParser.Open(parent Node, reader text.Reader, pc parser.Context) (Node, parser.State) func github.com/yuin/goldmark/parser.CloseBlocker.CloseBlock(parent Node, block text.Reader, pc parser.Context) func github.com/yuin/goldmark/parser.Context.ClearDelimiters(bottom Node) func github.com/yuin/goldmark/parser.InlineParser.Parse(parent Node, block text.Reader, pc parser.Context) Node func github.com/yuin/goldmark/renderer.Renderer.Render(w io.Writer, source []byte, n Node) error func github.com/yuin/goldmark/renderer/html.RenderAttributes(w util.BufWriter, node Node, filter util.BytesFilter)
NodeKind indicates more specific type than NodeType. ( T) String() string T : expvar.Var T : fmt.Stringer func NewNodeKind(name string) NodeKind func (*AutoLink).Kind() NodeKind func (*Blockquote).Kind() NodeKind func (*CodeBlock).Kind() NodeKind func (*CodeSpan).Kind() NodeKind func (*Document).Kind() NodeKind func (*Emphasis).Kind() NodeKind func (*FencedCodeBlock).Kind() NodeKind func (*Heading).Kind() NodeKind func (*HTMLBlock).Kind() NodeKind func (*Image).Kind() NodeKind func (*Link).Kind() NodeKind func (*List).Kind() NodeKind func (*ListItem).Kind() NodeKind func Node.Kind() NodeKind func (*Paragraph).Kind() NodeKind func (*RawHTML).Kind() NodeKind func (*String).Kind() NodeKind func (*Text).Kind() NodeKind func (*TextBlock).Kind() NodeKind func (*ThematicBreak).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*DefinitionDescription).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*DefinitionList).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*DefinitionTerm).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*Footnote).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*FootnoteBacklink).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*FootnoteLink).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*FootnoteList).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*Strikethrough).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*Table).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*TableCell).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*TableHeader).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*TableRow).Kind() NodeKind func github.com/yuin/goldmark/extension/ast.(*TaskCheckBox).Kind() NodeKind func github.com/yuin/goldmark/parser.(*Delimiter).Kind() NodeKind func github.com/yuin/goldmark-emoji/ast.(*Emoji).Kind() NodeKind func github.com/yuin/goldmark/parser.IDs.Generate(value []byte, kind NodeKind) []byte func github.com/yuin/goldmark/renderer.NodeRendererFuncRegisterer.Register(NodeKind, renderer.NodeRendererFunc) var KindAutoLink var KindBlockquote var KindCodeBlock var KindCodeSpan var KindDocument var KindEmphasis var KindFencedCodeBlock var KindHeading var KindHTMLBlock var KindImage var KindLink var KindList var KindListItem var KindParagraph var KindRawHTML var KindString var KindText var KindTextBlock var KindThematicBreak var github.com/yuin/goldmark/extension/ast.KindDefinitionDescription var github.com/yuin/goldmark/extension/ast.KindDefinitionList var github.com/yuin/goldmark/extension/ast.KindDefinitionTerm var github.com/yuin/goldmark/extension/ast.KindFootnote var github.com/yuin/goldmark/extension/ast.KindFootnoteBacklink var github.com/yuin/goldmark/extension/ast.KindFootnoteLink var github.com/yuin/goldmark/extension/ast.KindFootnoteList var github.com/yuin/goldmark/extension/ast.KindStrikethrough var github.com/yuin/goldmark/extension/ast.KindTable var github.com/yuin/goldmark/extension/ast.KindTableCell var github.com/yuin/goldmark/extension/ast.KindTableHeader var github.com/yuin/goldmark/extension/ast.KindTableRow var github.com/yuin/goldmark/extension/ast.KindTaskCheckBox var github.com/yuin/goldmark-emoji/ast.KindEmoji
A NodeType indicates what type a node belongs to. func (*BaseBlock).Type() NodeType func (*BaseInline).Type() NodeType func (*Document).Type() NodeType func Node.Type() NodeType const TypeBlock const TypeDocument const TypeInline
A Paragraph struct represents a paragraph of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewParagraph() *Paragraph func github.com/yuin/goldmark/extension/ast.NewDefinitionList(offset int, para *Paragraph) *ast.DefinitionList func github.com/yuin/goldmark/parser.ParagraphTransformer.Transform(node *Paragraph, reader text.Reader, pc parser.Context)
A RawHTML struct represents an inline raw HTML of the Markdown text. BaseInline BaseInline BaseInline.BaseNode BaseNode Segments *textm.Segments AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . Inline implements Inline.Inline. InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewRawHTML() *RawHTML
A String struct is a textual content that has a concrete value BaseInline BaseInline BaseInline.BaseNode BaseNode Value []byte AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . Inline implements Inline.Inline. InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsCode returns true if this text should be rendered without any modifications. IsRaw returns true if this text should be rendered without unescaping back slash escapes and resolving references. Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetCode sets whether this text should be rendered without any modifications. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SetRaw sets whether this text should be rendered as raw contents. SortChildren implements Node.SortChildren Text implements Node.Text. Type implements Node.Type *T : Node func NewString(v []byte) *String
A Text struct represents a textual content of the Markdown text. BaseInline BaseInline BaseInline.BaseNode BaseNode Segment is a position in a source text. AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump. FirstChild implements Node.FirstChild . HardLineBreak returns true if this node ends with a hard line break. See https://spec.commonmark.org/0.29/#hard-line-breaks for details. HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . Inline implements Inline.Inline. InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw returns true if this text should be rendered without unescaping back slash escapes and resolving references. Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines Merge merges a Node n into this node. Merge returns true if the given node has been merged, otherwise false. NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetHardLineBreak sets whether this node ends with a hard line break. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SetRaw sets whether this text should be rendered as raw contents. SetSoftLineBreak sets whether this node ends with a new line. SoftLineBreak returns true if this node ends with a new line, otherwise false. SortChildren implements Node.SortChildren Text implements Node.Text. Type implements Node.Type *T : Node func NewRawTextSegment(v textm.Segment) *Text func NewText() *Text func NewTextSegment(v textm.Segment) *Text func NewAutoLink(typ AutoLinkType, value *Text) *AutoLink func NewFencedCodeBlock(info *Text) *FencedCodeBlock
A TextBlock struct is a node whose lines should be rendered without any containers. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewTextBlock() *TextBlock
A ThematicBreak struct represents a thematic break of Markdown text. BaseBlock BaseBlock BaseBlock.BaseNode BaseNode AppendChild implements Node.AppendChild . Attribute implements Node.Attribute. AttributeString implements Node.AttributeString. Attributes implements Node.Attributes ChildCount implements Node.ChildCount . Dump implements Node.Dump . FirstChild implements Node.FirstChild . HasBlankPreviousLines implements Node.HasBlankPreviousLines. HasChildren implements Node.HasChildren . InsertAfter implements Node.InsertAfter . InsertBefore implements Node.InsertBefore . IsRaw implements Node.IsRaw Kind implements Node.Kind. LastChild implements Node.LastChild . Lines implements Node.Lines NextSibling implements Node.NextSibling . OwnerDocument implements Node.OwnerDocument Parent implements Node.Parent . PreviousSibling implements Node.PreviousSibling . RemoveAttributes implements Node.RemoveAttributes RemoveChild implements Node.RemoveChild . RemoveChildren implements Node.RemoveChildren . ReplaceChild implements Node.ReplaceChild . SetAttribute implements Node.SetAttribute. SetAttributeString implements Node.SetAttributeString SetBlankPreviousLines implements Node.SetBlankPreviousLines. SetLines implements Node.SetLines SetNextSibling implements Node.SetNextSibling . SetParent implements Node.SetParent . SetPreviousSibling implements Node.SetPreviousSibling . SortChildren implements Node.SortChildren Text implements Node.Text . Type implements Node.Type *T : Node func NewThematicBreak() *ThematicBreak
Walker is a function that will be called when Walk find a new node. entering is set true before walks children, false after walked children. If Walker returns error, Walk function immediately stop walking. func Walk(n Node, walker Walker) error
WalkStatus represents a current status of the Walk function. const WalkContinue const WalkSkipChildren const WalkStop
Package-Level Functions (total 30, in which 27 are exported)
DumpHelper is a helper function to implement Node.Dump. kv is pairs of an attribute name and an attribute value. cb is a function called after wrote a name and attributes.
IsParagraph returns true if the given node implements the Paragraph interface, otherwise false.
MergeOrAppendTextSegment merges a given s into the last child of the parent if it can be merged, otherwise creates a new Text node and appends it to after current last child.
MergeOrReplaceTextSegment merges a given s into a previous sibling of the node n if a previous sibling of the node n is *Text, otherwise replaces Node n with s.
NewBlockquote returns a new Blockquote node.
NewCodeBlock returns a new CodeBlock node.
NewCodeSpan returns a new CodeSpan node.
NewDocument returns a new Document node.
NewEmphasis returns a new Emphasis node with the given level.
NewFencedCodeBlock return a new FencedCodeBlock node.
NewHeading returns a new Heading node.
NewHTMLBlock returns a new HTMLBlock node.
NewImage returns a new Image node.
NewList returns a new List node.
NewListItem returns a new ListItem node.
NewNodeKind returns a new Kind value.
NewParagraph returns a new Paragraph node.
NewRawHTML returns a new RawHTML node.
NewRawTextSegment returns a new Text node with the given source position. The new node should be rendered as raw contents.
NewString returns a new String node.
NewText returns a new Text node.
NewTextBlock returns a new TextBlock node.
NewTextSegment returns a new Text node with the given source position.
NewThematicBreak returns a new ThematicBreak node.
Walk walks a AST tree by the depth first search algorithm.
Package-Level Variables (total 21, in which 19 are exported)
KindBlockquote is a NodeKind of the Blockquote node.
KindCodeBlock is a NodeKind of the CodeBlock node.
KindCodeSpan is a NodeKind of the CodeSpan node.
KindDocument is a NodeKind of the Document node.
KindEmphasis is a NodeKind of the Emphasis node.
KindFencedCodeBlock is a NodeKind of the FencedCodeBlock node.
KindHeading is a NodeKind of the Heading node.
KindHTMLBlock is a NodeKind of the HTMLBlock node.
KindImage is a NodeKind of the Image node.
KindList is a NodeKind of the List node.
KindListItem is a NodeKind of the ListItem node.
KindParagraph is a NodeKind of the Paragraph node.
KindRawHTML is a NodeKind of the RawHTML node.
KindString is a NodeKind of the String node.
KindText is a NodeKind of the Text node.
KindTextBlock is a NodeKind of the TextBlock node.
KindThematicBreak is a NodeKind of the ThematicBreak node.
Package-Level Constants (total 19, in which 15 are exported)
AutoLinkEmail indicates that an autolink is an email address.
AutoLinkURL indicates that an autolink is a generic URL.
HTMLBlockType1 represents type 1 html blocks
HTMLBlockType2 represents type 2 html blocks
HTMLBlockType3 represents type 3 html blocks
HTMLBlockType4 represents type 4 html blocks
HTMLBlockType5 represents type 5 html blocks
HTMLBlockType6 represents type 6 html blocks
HTMLBlockType7 represents type 7 html blocks
TypeBlock indicates that a node is kind of block nodes.
TypeDocument indicates that a node is kind of document nodes.
TypeInline indicates that a node is kind of inline nodes.
WalkContinue indicates that Walk can continue to walk.
WalkSkipChildren indicates that Walk wont walk on children of current node.
WalkStop indicates no more walking needed.