Documentation
¶
Index ¶
- Variables
- func ActionAwareParsers() gparser.Parser
- func NewAutoLinkParser() gparser.InlineParser
- func NewTemplateActionParser() gparser.InlineParser
- type Attribute
- type Attributes
- type BlockParser
- type Config
- type Context
- type HeadingConfig
- type HeadingOption
- type InlineParser
- type Option
- type OptionName
- type State
Constants ¶
This section is empty.
Variables ¶
var ( NoChildren = gparser.NoChildren Close = gparser.Close )
var ( NewContextKey = gparser.NewContextKey ProcessDelimiters = gparser.ProcessDelimiters )
var LinkReferenceParagraphTransformer = &linkReferenceParagraphTransformer{}
LinkReferenceParagraphTransformer is a ParagraphTransformer implementation that parses and extracts link reference from paragraphs.
var (
NewReference = gparser.NewReference
)
Functions ¶
func ActionAwareParsers ¶
func NewAutoLinkParser ¶
func NewAutoLinkParser() gparser.InlineParser
NewAutoLinkParser returns a new InlineParser that parses autolinks with Go template action support
func NewTemplateActionParser ¶
func NewTemplateActionParser() gparser.InlineParser
NewTemplateActionParser returns a new InlineParser that parses go template actions
Types ¶
type Attribute ¶
type Attribute struct {
Name []byte
Value interface{}
}
An Attribute is an attribute of the markdown elements.
type Attributes ¶
type Attributes []Attribute
An Attributes is a collection of attributes.
func ParseAttributes ¶
func ParseAttributes(reader text.Reader) (Attributes, bool)
ParseAttributes parses attributes into a map. ParseAttributes returns a parsed attributes and true if could parse attributes, otherwise nil and false.
func (Attributes) Find ¶
func (as Attributes) Find(name []byte) (interface{}, bool)
Find returns a (value, true) if an attribute correspond with given name is found, otherwise (nil, false).
type BlockParser ¶
type BlockParser = gparser.BlockParser
func NewATXHeadingParser ¶
func NewATXHeadingParser(opts ...HeadingOption) BlockParser
NewATXHeadingParser return a new BlockParser that can parse ATX headings.
type HeadingConfig ¶
A HeadingConfig struct is a data structure that holds configuration of the renderers related to headings.
func (*HeadingConfig) SetOption ¶
func (b *HeadingConfig) SetOption(name OptionName, _ interface{})
SetOption implements SetOptioner.
type HeadingOption ¶
type HeadingOption interface {
Option
SetHeadingOption(*HeadingConfig)
}
A HeadingOption interface sets options for heading parsers.
func WithAutoHeadingID ¶
func WithAutoHeadingID() HeadingOption
WithAutoHeadingID is a functional option that enables custom heading ids and auto generated heading ids.
func WithHeadingAttribute ¶
func WithHeadingAttribute() HeadingOption
WithHeadingAttribute is a functional option that enables custom heading attributes.
type InlineParser ¶
type InlineParser = gparser.InlineParser
func NewCodeSpanParser ¶
func NewCodeSpanParser() InlineParser
NewCodeSpanParser return a new InlineParser that parses inline codes surrounded by '`' with template action support.
func NewLinkParser ¶
func NewLinkParser() InlineParser
NewLinkParser returns a new InlineParser that parses links with go template support.
type OptionName ¶
type OptionName = gparser.OptionName