Documentation ¶
Index ¶
- type BlockquoteNode
- func (bn *BlockquoteNode) Attr() map[string]string
- func (bn *BlockquoteNode) Children(nodes ...Node) []Node
- func (bn *BlockquoteNode) Markdown() string
- func (bn *BlockquoteNode) New(t html.Token, parent Node) Node
- func (bn *BlockquoteNode) Parent() Node
- func (bn *BlockquoteNode) Tag() string
- func (bn *BlockquoteNode) Text(str ...string) string
- type BreakNode
- func (bn *BreakNode) Attr() map[string]string
- func (bn *BreakNode) Children(nodes ...Node) []Node
- func (bn *BreakNode) Markdown() string
- func (bn *BreakNode) New(t html.Token, parent Node) Node
- func (bn *BreakNode) Parent() Node
- func (bn *BreakNode) Tag() string
- func (bn *BreakNode) Text(str ...string) string
- type CodeNode
- func (bn *CodeNode) Attr() map[string]string
- func (bn *CodeNode) Children(nodes ...Node) []Node
- func (cn *CodeNode) Markdown() string
- func (cn *CodeNode) New(t html.Token, parent Node) Node
- func (bn *CodeNode) Parent() Node
- func (bn *CodeNode) Tag() string
- func (bn *CodeNode) Text(str ...string) string
- type CommonNode
- func (bn *CommonNode) Attr() map[string]string
- func (bn *CommonNode) Children(nodes ...Node) []Node
- func (cn *CommonNode) Markdown() string
- func (cn *CommonNode) New(t html.Token, parent Node) Node
- func (bn *CommonNode) Parent() Node
- func (bn *CommonNode) Tag() string
- func (bn *CommonNode) Text(str ...string) string
- type Document
- type HeaderNode
- func (bn *HeaderNode) Attr() map[string]string
- func (bn *HeaderNode) Children(nodes ...Node) []Node
- func (hn *HeaderNode) Markdown() string
- func (hn *HeaderNode) New(t html.Token, parent Node) Node
- func (bn *HeaderNode) Parent() Node
- func (bn *HeaderNode) Tag() string
- func (bn *HeaderNode) Text(str ...string) string
- type HorizontalNode
- func (bn *HorizontalNode) Attr() map[string]string
- func (bn *HorizontalNode) Children(nodes ...Node) []Node
- func (hn *HorizontalNode) Markdown() string
- func (hn *HorizontalNode) New(t html.Token, parent Node) Node
- func (bn *HorizontalNode) Parent() Node
- func (bn *HorizontalNode) Tag() string
- func (bn *HorizontalNode) Text(str ...string) string
- type HrefNode
- func (bn *HrefNode) Attr() map[string]string
- func (bn *HrefNode) Children(nodes ...Node) []Node
- func (hn *HrefNode) Markdown() string
- func (hn *HrefNode) New(t html.Token, parent Node) Node
- func (bn *HrefNode) Parent() Node
- func (bn *HrefNode) Tag() string
- func (bn *HrefNode) Text(str ...string) string
- type ImageNode
- func (bn *ImageNode) Attr() map[string]string
- func (bn *ImageNode) Children(nodes ...Node) []Node
- func (in *ImageNode) Markdown() string
- func (in *ImageNode) New(t html.Token, parent Node) Node
- func (bn *ImageNode) Parent() Node
- func (bn *ImageNode) Tag() string
- func (bn *ImageNode) Text(str ...string) string
- type Node
- type ParagraphNode
- func (bn *ParagraphNode) Attr() map[string]string
- func (bn *ParagraphNode) Children(nodes ...Node) []Node
- func (pn *ParagraphNode) Markdown() string
- func (pn *ParagraphNode) New(t html.Token, parent Node) Node
- func (bn *ParagraphNode) Parent() Node
- func (bn *ParagraphNode) Tag() string
- func (bn *ParagraphNode) Text(str ...string) string
- type PreNode
- type RootNode
- func (bn *RootNode) Attr() map[string]string
- func (bn *RootNode) Children(nodes ...Node) []Node
- func (bn *RootNode) Markdown() string
- func (bn *RootNode) New(t html.Token, parent Node) Node
- func (bn *RootNode) Parent() Node
- func (rt *RootNode) Tag() string
- func (bn *RootNode) Text(str ...string) string
- type StrongNode
- func (bn *StrongNode) Attr() map[string]string
- func (bn *StrongNode) Children(nodes ...Node) []Node
- func (sn *StrongNode) Markdown() string
- func (sn *StrongNode) New(t html.Token, parent Node) Node
- func (bn *StrongNode) Parent() Node
- func (bn *StrongNode) Tag() string
- func (bn *StrongNode) Text(str ...string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockquoteNode ¶
type BlockquoteNode struct {
// contains filtered or unexported fields
}
BlockquoteNode is used to <blockquote>
func (*BlockquoteNode) Markdown ¶
func (bn *BlockquoteNode) Markdown() string
Markdown renders BlockquoteNode as \n```\n text \n```\n
type BreakNode ¶
type BreakNode struct {
// contains filtered or unexported fields
}
BreakNode is used to <br/>
type CodeNode ¶
type CodeNode struct {
// contains filtered or unexported fields
}
CodeNode is used to <code>
func (*CodeNode) Markdown ¶
Markdown renders CodeNode as <code>text</code> if element class exist, render as <code class="class">text</code>
type CommonNode ¶
type CommonNode struct {
// contains filtered or unexported fields
}
CommonNode is a node that print as normal html, not markdown
func (*CommonNode) Markdown ¶
func (cn *CommonNode) Markdown() string
Markdown renders CommonNode as html tag string ,<tag>text</tag>
type Document ¶
type Document struct {
// contains filtered or unexported fields
}
Document maintains nodes of html content
func NewDocument ¶
NewDocument returns new document with io.Reader
type HeaderNode ¶
type HeaderNode struct {
// contains filtered or unexported fields
}
HeaderNode is used to <h1-6>
func (*HeaderNode) Markdown ¶
func (hn *HeaderNode) Markdown() string
type HorizontalNode ¶
type HorizontalNode struct {
// contains filtered or unexported fields
}
HorizontalNode is used to <hr/>
func (*HorizontalNode) Markdown ¶
func (hn *HorizontalNode) Markdown() string
Markdown renders HorizontalNode as `---\n`
type HrefNode ¶
type HrefNode struct {
// contains filtered or unexported fields
}
HrefNode is used to <a>
type ImageNode ¶
type ImageNode struct {
// contains filtered or unexported fields
}
ImageNode is used to <img>
type Node ¶
type Node interface { New(t html.Token, parent Node) Node Tag() string // node's tag name Text(str ...string) string // get or append node's text Attr() map[string]string // node's attributes Parent() Node // node's parent Children(nodes ...Node) []Node // append or get node's children nodes Markdown() string // render nodes to markdown }
Node defines a simple description iof html node
type ParagraphNode ¶
type ParagraphNode struct {
// contains filtered or unexported fields
}
ParagraphNode is used to <p>
func (*ParagraphNode) Markdown ¶
func (pn *ParagraphNode) Markdown() string
Markdown renders ParagraphNode with \n
type PreNode ¶
type PreNode struct {
// contains filtered or unexported fields
}
PreNode is used to <pre>
type RootNode ¶
type RootNode struct {
// contains filtered or unexported fields
}
RootNode is root node of html document
type StrongNode ¶
type StrongNode struct {
// contains filtered or unexported fields
}
StrongNode is used to <strong> and <em>
func (*StrongNode) Markdown ¶
func (sn *StrongNode) Markdown() string