Documentation ¶
Index ¶
- Constants
- func Render(input string) string
- type AlignType
- type BlockQuoteNode
- type BrNode
- type CellNode
- type CodeNode
- type DefLinkNode
- type EmphasisNode
- type HTMLNode
- type HeadingNode
- type HrNode
- type ImageNode
- type Lexer
- type LinkNode
- type ListItemNode
- type ListNode
- type Mark
- type Node
- type NodeType
- type Options
- type ParagraphNode
- type Pos
- type RefNode
- type RenderFn
- type RowNode
- type TableNode
- type TextNode
Constants ¶
const ( Header = iota Data )
Cell types
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockQuoteNode ¶
BlockQuote represent
func (*BlockQuoteNode) Render ¶
func (n *BlockQuoteNode) Render() string
Render return the html representation of BlockQuote
type CellNode ¶
CellNode represent table-data/cell that holds simple text(may be emphasis) Note: the text in <th> elements are bold and centered by default.
type DefLinkNode ¶
DefLinkNode refresent single reference to link-definition
func (*DefLinkNode) Render ¶
func (n *DefLinkNode) Render() string
Deflink have no representation(Transparent node)
type EmphasisNode ¶
EmphasisNode holds plain-text wrapped with style. (strong, em, del, code)
func (*EmphasisNode) Render ¶
func (n *EmphasisNode) Render() string
Return the html representation of emphasis text.
func (*EmphasisNode) Tag ¶
func (n *EmphasisNode) Tag() (s string)
Tag return the tagName based on the Style field.
type HeadingNode ¶
Heading holds heaing element with specific level(1-6).
func (*HeadingNode) Render ¶
func (n *HeadingNode) Render() string
Render return the html representation based on heading level.
type Lexer ¶
type Lexer interface {
// contains filtered or unexported methods
}
Lexer interface, used to composed it inside the parser
type ListItemNode ¶
ListItem represent single item in ListNode that may contains nested nodes.
func (*ListItemNode) Render ¶
func (n *ListItemNode) Render() (s string)
Render return the html representation of list-item
type ListNode ¶
type ListNode struct { NodeType Pos Ordered bool Items []*ListItemNode }
ListNode holds list items nodes in ordered or unordered states.
type Mark ¶
type Mark struct { Input string // contains filtered or unexported fields }
Mark
func (*Mark) AddRenderFn ¶
AddRenderFn let you pass NodeType, and RenderFn function and override the default Node rendering
type NodeType ¶
type NodeType int
NodeType identifies the type of a parse tree node.
const ( NodeText NodeType = iota // A plain text NodeParagraph // A Paragraph NodeEmphasis // An emphasis(strong, em, ...) NodeHeading // A heading (h1, h2, ...) NodeBr // A link break NodeHr // A horizontal rule NodeImage // An image NodeRefImage // A image reference NodeList // A list of ListItems NodeListItem // A list item node NodeLink // A link(href) NodeRefLink // A link reference NodeDefLink // A link definition NodeTable // A table of NodeRows NodeRow // A row of NodeCells NodeCell // A table-cell(td) NodeCode // A code block(wrapped with pre) NodeBlockQuote // A blockquote NodeHTML // An inline HTML )
type Options ¶
Mark options
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions return an options struct with default configuration it's means that only Gfm, and Tables set to true.
type ParagraphNode ¶
ParagraphNode hold simple paragraph node contains text that may be emphasis.
func (*ParagraphNode) Render ¶
func (n *ParagraphNode) Render() (s string)
Render return the html representation of ParagraphNode
type RefNode ¶
type RefNode struct { NodeType Pos Text, Ref, Raw string // contains filtered or unexported fields }
RefLink holds link with refrence to link definition