Documentation
¶
Overview ¶
Package markdown provide AST node types for inline and block KaTeX math expressions.
Package markdown provides KaTeX math expression parsing for goldmark.
Package markdown provides HTML renderer for KaTeX math expressions.
Package markdown provides math rendering for client-side KaTeX ¶
Package markdown provides mermaid diagram rendering extension for goldmark.
Package markdown provides table of contents generation for goldmark.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var KindKaTeXBlock = ast.NewNodeKind("KaTeXBlock")
KindKaTeXBlock is the NodeKind for block KaTeX math.
var KindKaTeXInline = ast.NewNodeKind("KaTeXInline")
KindKaTeXInline is the NodeKind for inline KaTeX math.
Functions ¶
func NewMathExtension ¶
NewMathExtension creates a new math extension for client-side KaTeX rendering.
func NewMermaidExtension ¶ added in v0.0.20
NewMermaidExtension creates a new mermaid diagram rendering extension.
func NewTocExtension ¶
NewTocExtension creates a goldmark extension for table of contents generation.
Types ¶
type KaTeXBlock ¶ added in v0.0.24
type KaTeXBlock struct {
ast.BaseInline
Equation []byte
}
KaTeXBlock represents a block math expression ($$...$$).
func (*KaTeXBlock) Dump ¶ added in v0.0.24
func (n *KaTeXBlock) Dump(source []byte, level int)
Dump outputs the node structure for debugging.
func (*KaTeXBlock) IsBlank ¶ added in v0.0.24
func (n *KaTeXBlock) IsBlank(source []byte) bool
IsBlank checks if the node contains only whitespace.
func (*KaTeXBlock) Kind ¶ added in v0.0.24
func (n *KaTeXBlock) Kind() ast.NodeKind
Kind returns the node kind for block math.
type KaTeXExtender ¶ added in v0.0.24
type KaTeXExtender struct{}
KaTeXExtender implements goldmark.Extender for KaTeX math rendering.
func (*KaTeXExtender) Extend ¶ added in v0.0.24
func (e *KaTeXExtender) Extend(m goldmark.Markdown)
Extend adds KaTeX parser and renderer to the goldmark instance.
type KaTeXHTMLRenderer ¶ added in v0.0.24
KaTeXHTMLRenderer renders KaTeX math nodes as HTML with LaTeX delimiters.
func (*KaTeXHTMLRenderer) RegisterFuncs ¶ added in v0.0.24
func (r *KaTeXHTMLRenderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)
RegisterFuncs registers rendering functions for KaTeX node types.
type KaTeXInline ¶ added in v0.0.24
type KaTeXInline struct {
ast.BaseInline
Equation []byte
}
KaTeXInline represents an inline math expression ($...$).
func (*KaTeXInline) Dump ¶ added in v0.0.24
func (n *KaTeXInline) Dump(source []byte, level int)
Dump outputs the node structure for debugging.
func (*KaTeXInline) Inline ¶ added in v0.0.24
func (n *KaTeXInline) Inline()
Inline marks this as an inline node.
func (*KaTeXInline) IsBlank ¶ added in v0.0.24
func (n *KaTeXInline) IsBlank(source []byte) bool
IsBlank checks if the node contains only whitespace.
func (*KaTeXInline) Kind ¶ added in v0.0.24
func (n *KaTeXInline) Kind() ast.NodeKind
Kind returns the node kind for inline math.
type KaTeXParser ¶ added in v0.0.24
type KaTeXParser struct{}
KaTeXParser parses KaTeX math expressions from markdown.
func (*KaTeXParser) Parse ¶ added in v0.0.24
Parse processes a potential KaTeX math expression starting at the current position. Returns an inline or block math node if a valid expression is found, nil otherwise.
func (*KaTeXParser) Trigger ¶ added in v0.0.24
func (s *KaTeXParser) Trigger() []byte
Trigger returns the byte that triggers this parser ('$').
type ShortcodeProcessor ¶ added in v0.0.33
type ShortcodeProcessor struct {
// contains filtered or unexported fields
}
ShortcodeProcessor processes shortcodes in markdown before goldmark parsing.
func NewShortcodeProcessor ¶ added in v0.0.33
func NewShortcodeProcessor(templates *template.Template) *ShortcodeProcessor
NewShortcodeProcessor creates a new shortcode processor.