An Image struct represents an image of the Markdown text.baseLink.BaseInlineBaseInlinebaseLink.BaseInline.BaseNodeBaseNode 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.
*Image : Node
func NewImage(link *Link) *Image
A Link struct represents a link of the Markdown text.baseLink.BaseInlineBaseInlinebaseLink.BaseInline.BaseNodeBaseNode 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.
*Link : Node
func NewLink() *Link
func NewImage(link *Link) *Image
A List struct represents a list of Markdown text.BaseBlockBaseBlockBaseBlock.BaseNodeBaseNode IsTight is a true if this list is a 'tight' list.
See https://spec.commonmark.org/0.30/#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.
*List : Node
func NewList(marker byte) *List
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
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)
A String struct is a textual content that has a concrete value.BaseInlineBaseInlineBaseInline.BaseNodeBaseNodeValue[]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.
*String : Node
func NewString(v []byte) *String
A Text struct represents a textual content of the Markdown text.BaseInlineBaseInlineBaseInline.BaseNodeBaseNode 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.30/#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.
*Text : 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
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
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.
NewAutoLink returns a new AutoLink node.
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.
NewLink returns a new Link 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 19)
KindAutoLink is a NodeKind of the AutoLink node.
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.
KindLink is a NodeKind of the Link 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 15)
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.
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.