extras

package module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KindSuperscript = ast.NewNodeKind("Superscript")
	KindSubscript   = ast.NewNodeKind("Subscript")
	KindInsert      = ast.NewNodeKind("Insert")
	KindMark        = ast.NewNodeKind("Mark")
	KindDelete      = ast.NewNodeKind("Delete")
)
View Source
var DeleteTag = InlineTag{
	TagKind:        KindDelete,
	Char:           '~',
	Number:         2,
	Html:           "del",
	ParsePriority:  400,
	RenderPriority: 400,
}
View Source
var InsertTag = InlineTag{
	TagKind:        KindInsert,
	Char:           '+',
	Number:         2,
	Html:           "ins",
	ParsePriority:  501,
	RenderPriority: 501,
}
View Source
var MarkTag = InlineTag{
	TagKind:        KindMark,
	Char:           '=',
	Number:         2,
	Html:           "mark",
	ParsePriority:  550,
	RenderPriority: 550,
}
View Source
var SubscriptTag = InlineTag{
	TagKind:        KindSubscript,
	Char:           '~',
	Number:         1,
	Html:           "sub",
	ParsePriority:  602,
	RenderPriority: 602,
}
View Source
var SuperscriptTag = InlineTag{
	TagKind:        KindSuperscript,
	Char:           '^',
	Number:         1,
	Html:           "sup",
	ParsePriority:  600,
	RenderPriority: 600,
}

Functions

func New

func New(config Config) goldmark.Extender

func NewInlineTagHTMLRenderer added in v0.4.0

func NewInlineTagHTMLRenderer(tag InlineTag, opts ...html.Option) renderer.NodeRenderer

NewInlineTagHTMLRenderer returns a new NodeRenderer that renders Inline nodes to HTML.

Types

type Config

type Config struct {
	Superscript SuperscriptConfig
	Subscript   SubscriptConfig
	Insert      InsertConfig
	Mark        MarkConfig
	Delete      DeleteConfig
}

Config configures the extras extension.

type DeleteConfig added in v0.2.0

type DeleteConfig struct {
	Enable bool
}

type InlineTag added in v0.5.0

type InlineTag struct {
	TagKind        ast.NodeKind
	Char           byte
	Number         int
	Html           string
	ParsePriority  int
	RenderPriority int
}

type InsertConfig

type InsertConfig struct {
	Enable bool
}

InsertConfig configures the insert extension.

type MarkConfig

type MarkConfig struct {
	Enable bool
}

MarkConfig configures the mark extension.

type SubscriptConfig

type SubscriptConfig struct {
	Enable bool
}

SubscriptConfig configures the subscript extension.

type SuperscriptConfig

type SuperscriptConfig struct {
	Enable bool
}

SuperscriptConfig configures the superscript extension.