callout

package
v0.0.0-...-15772ec Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CalloutAttributeFilter = html.GlobalAttributeFilter

CalloutAttributeFilter defines attribute names which callout elements can have

View Source
var KindCallout = ast.NewNodeKind("Callout")

KindCallout is a NodeKind of the Callout node.

Functions

func NewCalloutParser

func NewCalloutParser() parser.BlockParser

NewCalloutParser returns a new BlockParser for callouts.

Types

type Callout

type Callout struct {
	ast.BaseBlock
	Title string
	// contains filtered or unexported fields
}

A Callout struct represents a GitHub-style callout block.

func NewCallout

func NewCallout() *Callout

NewCallout returns a new Callout node.

func (*Callout) Content

func (n *Callout) Content() []byte

Content returns the content of the callout.

func (*Callout) Dump

func (n *Callout) Dump(source []byte, level int)

Dump implements Node.Dump.

func (*Callout) Kind

func (n *Callout) Kind() ast.NodeKind

Kind implements Node.Kind.

func (*Callout) SetContent

func (n *Callout) SetContent(content []byte)

AppendContent appends content to the callout.

func (*Callout) SetTitle

func (n *Callout) SetTitle(title string)

SetTitle sets the title of the callout.

type Config

type Config struct {
	Writer    html.Writer
	HardWraps bool
	XHTML     bool
	Unsafe    bool
}

A Config struct has configurations for the HTML based renderers.

type Extender

type Extender struct {
	// contains filtered or unexported fields
}

Extender allows you to use GitHub-style callouts in markdown

Callouts are blockquotes with special syntax:

> [!NOTE] > This is a note

> [!TIP] > This is a tip

> [!IMPORTANT] > This is important

> [!WARNING] > This is a warning

> [!CAUTION] > This is a caution

func New

func New() *Extender

func (*Extender) Extend

func (e *Extender) Extend(md goldmark.Markdown)

This implements the Extend method for goldmark-callouts.Extender

type Renderer

type Renderer struct {
	Config
}

A Renderer struct is an implementation of renderer.NodeRenderer that renders nodes as (X)HTML.

func (*Renderer) RegisterFuncs

func (r *Renderer) RegisterFuncs(reg renderer.NodeRendererFuncRegisterer)

RegisterFuncs implements NodeRenderer.RegisterFuncs.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL