Documentation ¶
Index ¶
- Variables
- func NewBlockParser(parseDollarBlocks bool) parser.BlockParser
- func NewBlockRenderer() renderer.NodeRenderer
- func NewInlineBracketParser() parser.InlineParser
- func NewInlineDollarParser() parser.InlineParser
- func NewInlineRenderer() renderer.NodeRenderer
- type Block
- type BlockRenderer
- type Extension
- type Inline
- type InlineRenderer
- type Option
Constants ¶
This section is empty.
Variables ¶
var KindBlock = ast.NewNodeKind("MathBlock")
KindBlock is the node kind for math blocks
var KindInline = ast.NewNodeKind("MathInline")
KindInline is the kind for math inline
var Math = &Extension{ enabled: true, parseDollarBlock: true, parseDollarInline: true, }
Math represents a math extension with default rendered delimiters
Functions ¶
func NewBlockParser ¶
func NewBlockParser(parseDollarBlocks bool) parser.BlockParser
NewBlockParser creates a new math BlockParser
func NewBlockRenderer ¶
func NewBlockRenderer() renderer.NodeRenderer
NewBlockRenderer creates a new renderer for math Blocks
func NewInlineBracketParser ¶
func NewInlineBracketParser() parser.InlineParser
NewInlineDollarParser returns a new inline parser
func NewInlineDollarParser ¶
func NewInlineDollarParser() parser.InlineParser
NewInlineDollarParser returns a new inline parser
func NewInlineRenderer ¶
func NewInlineRenderer() renderer.NodeRenderer
NewInlineRenderer returns a new renderer for inline math
Types ¶
type Block ¶
Block represents a display math block e.g. $$...$$ or \[...\]
type BlockRenderer ¶
type BlockRenderer struct{}
BlockRenderer represents a renderer for math Blocks
func (*BlockRenderer) RegisterFuncs ¶
func (r *BlockRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs registers the renderer for math Blocks
type Extension ¶
type Extension struct {
// contains filtered or unexported fields
}
Extension is a math extension
func NewExtension ¶
NewExtension creates a new math extension with the provided options
type Inline ¶
type Inline struct {
ast.BaseInline
}
Inline represents inline math e.g. $...$ or \(...\)
type InlineRenderer ¶
type InlineRenderer struct{}
InlineRenderer is an inline renderer
func (*InlineRenderer) RegisterFuncs ¶
func (r *InlineRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs registers the renderer for inline math nodes
type Option ¶
type Option interface {
SetOption(e *Extension)
}
Option is the interface Options should implement
func WithBlockDollarParser ¶
WithBlockDollarParser enables or disables the parsing of $$...$$
func WithInlineDollarParser ¶
WithInlineDollarParser enables or disables the parsing of $...$