package ast

Import Path
	github.com/gomarkdown/markdown/ast (on go.dev)

Dependency Relation
	imports 5 packages, and imported by 4 packages

Involved Source Files Package ast defines tree representation of a parsed markdown document. node.go print.go
Package-Level Type Names (total 51)
/* sort by: | */
Aside represents an markdown aside node. Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Aside : Node
An attribute can be attached to block elements. They are specified as {#id .classs key="value"} where quotes for values are mandatory, multiple key/value pairs are separated by whitespace. Attrs map[string][]byte Classes [][]byte ID []byte
BlockQuote represents markdown block quote node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *BlockQuote : Node
Callout is a node that can exist both in text (where it is an actual node) and in a code block. // number of this callout Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Callout : Node func github.com/gomarkdown/markdown/html.(*Renderer).Callout(w io.Writer, node *Callout)
return true if can contain children of a given node type used by custom nodes to over-ride logic in canNodeContain ( CanContain) CanContain(Node) bool
Caption represents a figure, code or quote caption Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Caption : Node func github.com/gomarkdown/markdown/html.(*Renderer).Caption(w io.Writer, caption *Caption, entering bool)
CaptionFigure is a node (blockquote or codeblock) that has a caption Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // This might hold heading ID, if present AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *CaptionFigure : Node func github.com/gomarkdown/markdown/html.(*Renderer).CaptionFigure(w io.Writer, figure *CaptionFigure, entering bool)
CellAlignFlags holds a type of alignment in a table cell. ( CellAlignFlags) String() string CellAlignFlags : expvar.Var CellAlignFlags : fmt.Stringer const TableAlignmentCenter const TableAlignmentLeft const TableAlignmentRight
Citation is a citation node. // Destination is where the citation points to. Multiple ones are allowed. Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node // Potential citation suffix, i.e. [@!RFC1035, p. 144] // 1:1 mapping of destination and citation type AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Citation : Node func github.com/gomarkdown/markdown/html.(*Renderer).Citation(w io.Writer, node *Citation)
CitationTypes holds the type of a citation, informative, normative or suppressed const CitationTypeInformative const CitationTypeNone const CitationTypeNormative const CitationTypeSuppressed
Code represents markdown code node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Code : Node func github.com/gomarkdown/markdown/html.(*Renderer).Code(w io.Writer, node *Code)
CodeBlock represents markdown code block node FenceChar byte FenceLength int FenceOffset int // This holds the info string // Specifies whether it's a fenced code block or an indented one Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *CodeBlock : Node func github.com/gomarkdown/markdown/html.(*Renderer).CodeBlock(w io.Writer, codeBlock *CodeBlock)
Container is a type of node that can contain children // Block level attribute Attribute.Attrs map[string][]byte Attribute.Classes [][]byte Attribute.ID []byte Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Container : Node func (*Container).AsContainer() *Container func (*Leaf).AsContainer() *Container func Node.AsContainer() *Container
CrossReference is a reference node. Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // Destination is where the reference points to // Potential citation suffix, i.e. (#myid, text) AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *CrossReference : Node
Del represents markdown del node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Del : Node
Document represents markdown document node, a root of ast Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Document : Node
DocumentMatter represents markdown node that signals a document division: frontmatter, mainmatter or backmatter. Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node Matter DocumentMatters AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *DocumentMatter : Node func github.com/gomarkdown/markdown/html.(*Renderer).DocumentMatter(w io.Writer, node *DocumentMatter, entering bool)
DocumentMatters holds the type of a {front,main,back}matter in the document const DocumentMatterBack const DocumentMatterFront const DocumentMatterMain const DocumentMatterNone
Emph represents markdown emphasis node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Emph : Node
Footnotes is a node that contains all footnotes Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Footnotes : Node
Hardbreak represents markdown hard break node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Hardbreak : Node func github.com/gomarkdown/markdown/html.(*Renderer).HardBreak(w io.Writer, node *Hardbreak)
Heading represents markdown heading node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // This might hold heading ID, if present // We are a special heading (starts with .#) // Specifies whether it's a title block // This holds the heading level number AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Heading : Node func github.com/gomarkdown/markdown/html.(*Renderer).Heading(w io.Writer, hdr *Heading, entering bool) func github.com/gomarkdown/markdown/html.(*Renderer).HeadingEnter(w io.Writer, hdr *Heading) func github.com/gomarkdown/markdown/html.(*Renderer).HeadingExit(w io.Writer, hdr *Heading) func github.com/gomarkdown/markdown/html.(*Renderer).MakeUniqueHeadingID(hdr *Heading) string
HorizontalRule represents markdown horizontal rule node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *HorizontalRule : Node func github.com/gomarkdown/markdown/html.(*Renderer).HorizontalRule(w io.Writer, node *HorizontalRule)
HTMLBlock represents markdown html node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *HTMLBlock : Node func github.com/gomarkdown/markdown/html.(*Renderer).HTMLBlock(w io.Writer, node *HTMLBlock)
HTMLSpan represents markdown html span node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *HTMLSpan : Node func github.com/gomarkdown/markdown/html.(*Renderer).HTMLSpan(w io.Writer, span *HTMLSpan)
Image represents markdown image node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // Destination is what goes into a href // Title is the tooltip thing that goes in a title attribute AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Image : Node func github.com/gomarkdown/markdown/html.(*Renderer).Image(w io.Writer, node *Image, entering bool)
Index is a node that contains an Index item and an optional, subitem. // ID of the index Item []byte Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node Primary bool Subitem []byte AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Index : Node func github.com/gomarkdown/markdown/html.(*Renderer).Index(w io.Writer, node *Index)
Leaf is a type of node that cannot have children // Block level attribute Attribute.Attrs map[string][]byte Attribute.Classes [][]byte Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Leaf : Node func (*Container).AsLeaf() *Leaf func (*Leaf).AsLeaf() *Leaf func Node.AsLeaf() *Leaf
List represents markdown list node // '*', '+' or '-' in bullet lists Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // '.' or ')' after the number in ordered lists // This is a list of footnotes ListFlags ListType // If not nil, turns this list item into a footnote item and triggers different rendering // for ordered lists this indicates the starting number if > 0 // Skip <p>s around list item data if true AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *List : Node func github.com/gomarkdown/markdown/html.(*Renderer).List(w io.Writer, list *List, entering bool)
ListItem represents markdown list item node // '*', '+' or '-' in bullet lists Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // '.' or ')' after the number in ordered lists // This is a list of footnotes ListFlags ListType // If not nil, turns this list item into a footnote item and triggers different rendering // Skip <p>s around list item data if true AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *ListItem : Node func github.com/gomarkdown/markdown/html.ListItemOpenCR(listItem *ListItem) bool func github.com/gomarkdown/markdown/html.(*Renderer).ListItem(w io.Writer, listItem *ListItem, entering bool)
ListType contains bitwise or'ed flags for list and list item objects. const ListItemBeginningOfList const ListItemContainsBlock const ListItemEndOfList const ListTypeDefinition const ListTypeOrdered const ListTypeTerm
Math represents markdown MathAjax inline node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Math : Node
MathBlock represents markdown MathAjax block node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *MathBlock : Node
Node defines an ast node ( Node) AsContainer() *Container ( Node) AsLeaf() *Leaf ( Node) GetChildren() []Node ( Node) GetParent() Node ( Node) SetChildren(newChildren []Node) ( Node) SetParent(newParent Node) *Aside *BlockQuote *Callout *Caption *CaptionFigure *Citation *Code *CodeBlock *Container *CrossReference *Del *Document *DocumentMatter *Emph *Footnotes *Hardbreak *Heading *HorizontalRule *HTMLBlock *HTMLSpan *Image *Index *Leaf *Link *List *ListItem *Math *MathBlock *NonBlockingSpace *Paragraph *Softbreak *Strong *Subscript *Superscript *Table *TableBody *TableCell *TableFooter *TableHeader *TableRow *Text *github.com/pancsta/asyncmachine-go/scripts/gen_website.Details func GetFirstChild(n Node) Node func GetLastChild(n Node) Node func GetNextNode(n Node) Node func GetPrevNode(n Node) Node func (*Container).GetChildren() []Node func (*Container).GetParent() Node func (*Leaf).GetChildren() []Node func (*Leaf).GetParent() Node func Node.GetChildren() []Node func Node.GetParent() Node func github.com/gomarkdown/markdown.Parse(markdown []byte, p *parser.Parser) Node func github.com/gomarkdown/markdown/parser.(*Parser).AddBlock(n Node) Node func github.com/gomarkdown/markdown/parser.(*Parser).Parse(input []byte) Node func github.com/pancsta/asyncmachine-go/scripts/gen_website.ParserHook(data []byte) (Node, []byte, int) func AppendChild(parent Node, child Node) func AppendChild(parent Node, child Node) func GetFirstChild(n Node) Node func GetLastChild(n Node) Node func GetNextNode(n Node) Node func GetPrevNode(n Node) Node func Print(dst io.Writer, doc Node) func PrintWithPrefix(w io.Writer, doc Node, prefix string) func RemoveFromTree(n Node) func ToString(doc Node) string func Walk(n Node, visitor NodeVisitor) WalkStatus func WalkFunc(n Node, f NodeVisitorFunc) func CanContain.CanContain(Node) bool func (*Container).SetChildren(newChildren []Node) func (*Container).SetParent(newParent Node) func (*Leaf).SetChildren(newChildren []Node) func (*Leaf).SetParent(newParent Node) func Node.SetChildren(newChildren []Node) func Node.SetParent(newParent Node) func NodeVisitor.Visit(node Node, entering bool) WalkStatus func NodeVisitorFunc.Visit(node Node, entering bool) WalkStatus func github.com/gomarkdown/markdown.Render(doc Node, renderer markdown.Renderer) []byte func github.com/gomarkdown/markdown.Renderer.RenderFooter(w io.Writer, ast Node) func github.com/gomarkdown/markdown.Renderer.RenderHeader(w io.Writer, ast Node) func github.com/gomarkdown/markdown.Renderer.RenderNode(w io.Writer, node Node, entering bool) WalkStatus func github.com/gomarkdown/markdown/html.BlockAttrs(node Node) []string func github.com/gomarkdown/markdown/html.IsList(node Node) bool func github.com/gomarkdown/markdown/html.IsListItem(node Node) bool func github.com/gomarkdown/markdown/html.IsListItemTerm(node Node) bool func github.com/gomarkdown/markdown/html.IsListTight(node Node) bool func github.com/gomarkdown/markdown/html.(*Renderer).RenderFooter(w io.Writer, _ Node) func github.com/gomarkdown/markdown/html.(*Renderer).RenderHeader(w io.Writer, ast Node) func github.com/gomarkdown/markdown/html.(*Renderer).RenderNode(w io.Writer, node Node, entering bool) WalkStatus func github.com/gomarkdown/markdown/parser.(*Parser).AddBlock(n Node) Node func github.com/gomarkdown/markdown/parser.(*Parser).Finalize(block Node) func github.com/gomarkdown/markdown/parser.(*Parser).Inline(currBlock Node, data []byte) func github.com/pancsta/asyncmachine-go/scripts/gen_website.RenderHook(w io.Writer, node Node, entering bool) (WalkStatus, bool)
NodeVisitor is a callback to be called when traversing the syntax tree. Called twice for every node: once with entering=true when the branch is first visited, then with entering=false after all the children are done. ( NodeVisitor) Visit(node Node, entering bool) WalkStatus NodeVisitorFunc func Walk(n Node, visitor NodeVisitor) WalkStatus
NodeVisitorFunc casts a function to match NodeVisitor interface Visit calls visitor function NodeVisitorFunc : NodeVisitor func WalkFunc(n Node, f NodeVisitorFunc)
NonBlockingSpace represents markdown non-blocking space node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *NonBlockingSpace : Node func github.com/gomarkdown/markdown/html.(*Renderer).NonBlockingSpace(w io.Writer, node *NonBlockingSpace)
Paragraph represents markdown paragraph node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Paragraph : Node func github.com/gomarkdown/markdown/html.SkipParagraphTags(para *Paragraph) bool func github.com/gomarkdown/markdown/html.(*Renderer).Paragraph(w io.Writer, para *Paragraph, entering bool)
Softbreak represents markdown softbreak node Note: not used currently Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Softbreak : Node
Strong represents markdown strong node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Strong : Node
Subscript is a subscript node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Subscript : Node
Subscript is a superscript node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Superscript : Node
Table represents markdown table node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *Table : Node
TableBody represents markdown table body node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *TableBody : Node func github.com/gomarkdown/markdown/html.(*Renderer).TableBody(w io.Writer, node *TableBody, entering bool)
TableCell represents markdown table cell node // This holds the value for align attribute // How many columns to span Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node // This tells if it's under the header row AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *TableCell : Node func github.com/gomarkdown/markdown/html.(*Renderer).TableCell(w io.Writer, tableCell *TableCell, entering bool)
TableFooter represents markdown table foot node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *TableFooter : Node
TableHeader represents markdown table head node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *TableHeader : Node
TableRow represents markdown table row node Container Container // Block level attribute Container.Attribute.Attrs map[string][]byte Container.Attribute.Classes [][]byte Container.Attribute.ID []byte Container.Children []Node // Markdown content of the block nodes // Text contents of the leaf nodes Container.Parent Node AsContainer returns itself as *Container AsLeaf returns nil GetChildren returns children nodes GetParent returns parent node SetChildren sets children node SetParent sets the parent node *TableRow : Node
Text represents markdown text node Leaf Leaf // Block level attribute Leaf.Attribute.Attrs map[string][]byte Leaf.Attribute.Classes [][]byte Leaf.Attribute.ID []byte // Markdown content of the block nodes // Text contents of the leaf nodes Leaf.Parent Node AsContainer returns nil AsLeaf returns itself as *Leaf GetChildren returns nil because Leaf cannot have children GetParent returns parent node SetChildren will panic if trying to set non-empty children because Leaf cannot have children SetParent sets the parent nodd *Text : Node func github.com/gomarkdown/markdown/html.(*Renderer).Text(w io.Writer, text *Text)
WalkStatus allows NodeVisitor to have some control over the tree traversal. It is returned from NodeVisitor and different values allow Node.Walk to decide which node to go to next. func Walk(n Node, visitor NodeVisitor) WalkStatus func NodeVisitor.Visit(node Node, entering bool) WalkStatus func NodeVisitorFunc.Visit(node Node, entering bool) WalkStatus func github.com/gomarkdown/markdown.Renderer.RenderNode(w io.Writer, node Node, entering bool) WalkStatus func github.com/gomarkdown/markdown/html.(*Renderer).RenderNode(w io.Writer, node Node, entering bool) WalkStatus func github.com/pancsta/asyncmachine-go/scripts/gen_website.RenderHook(w io.Writer, node Node, entering bool) (WalkStatus, bool) const GoToNext const SkipChildren const Terminate
Package-Level Functions (total 11)
AppendChild appends child to children of parent It panics if either node is nil.
GetFirstChild returns first child of node n It's implemented as stand-alone function to keep Node interface small
GetLastChild returns last child of node n It's implemented as stand-alone function to keep Node interface small
GetNextNode returns next sibling of node n (node after n) We can't make it part of Container or Leaf because we loose Node identity
GetPrevNode returns previous sibling of node n (node before n) We can't make it part of Container or Leaf because we loose Node identity
Print is for debugging. It prints a string representation of parsed markdown doc (result of parser.Parse()) to dst. To make output readable, it shortens text output.
PrintWithPrefix is like Print but allows customizing prefix used for indentation. By default it's 2 spaces. You can change it to e.g. tab by passing "\t"
RemoveFromTree removes this node from tree
ToString is like Dump but returns result as a string
Walk traverses tree recursively
WalkFunc is like Walk but accepts just a callback function
Package-Level Constants (total 20)
These are all possible Document divisions.
These are all possible Document divisions.
These are all possible Document divisions.
These are all possible Document divisions.
GoToNext is the default traversal of every node.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the ListItem renderer. Multiple flag values may be ORed together. These are mostly of interest if you are writing a new output format.
SkipChildren tells walker to skip all children of current node.
These are the possible flag values for the table cell renderer. Only a single one of these values will be used; they are not ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the table cell renderer. Only a single one of these values will be used; they are not ORed together. These are mostly of interest if you are writing a new output format.
These are the possible flag values for the table cell renderer. Only a single one of these values will be used; they are not ORed together. These are mostly of interest if you are writing a new output format.
Terminate tells walker to terminate the traversal.