mdext

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mdext provides pandoc-flavoured goldmark extensions for the glu Markdown pipeline: fenced divs (::: {.class} … :::), bracketed spans (text{.class}) and a pandoc-style heading identifier generator that keeps non-ASCII letters.

Index

Constants

This section is empty.

Variables

View Source
var BracketedSpans goldmark.Extender = &bracketedSpans{}

BracketedSpans is the goldmark extender enabling pandoc bracketed spans.

View Source
var FencedDivs goldmark.Extender = &fencedDivs{}

FencedDivs is the goldmark extender enabling pandoc fenced divs.

View Source
var KindBracketedSpan = ast.NewNodeKind("BracketedSpan")

KindBracketedSpan is the NodeKind of the BracketedSpan node.

View Source
var KindFencedDiv = ast.NewNodeKind("FencedDiv")

KindFencedDiv is the NodeKind of the FencedDiv node.

Functions

func NewPandocIDs

func NewPandocIDs() parser.IDs

NewPandocIDs returns a parser.IDs implementation with pandoc's auto_identifiers algorithm: keep letters, digits, '_', '-' and '.', lowercase everything, turn spaces into hyphens, strip everything before the first letter, fall back to "section" for letterless headings.

Types

type BracketedSpan

type BracketedSpan struct {
	ast.BaseInline
}

A BracketedSpan node represents a pandoc bracketed span: [inline content]{.class key=value}.

func (*BracketedSpan) Dump

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

Dump implements ast.Node.Dump.

func (*BracketedSpan) Kind

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

Kind implements ast.Node.Kind.

type BracketedSpanHTMLRenderer

type BracketedSpanHTMLRenderer struct{}

BracketedSpanHTMLRenderer renders a BracketedSpan as a span element carrying all authored attributes.

func (*BracketedSpanHTMLRenderer) RegisterFuncs

RegisterFuncs implements renderer.NodeRenderer.

type FencedDiv

type FencedDiv struct {
	ast.BaseBlock
}

A FencedDiv node represents one pandoc fenced div: a line of at least three colons carrying attributes opens a block container, a line of colons alone closes the innermost open one.

func (*FencedDiv) Dump

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

Dump implements ast.Node.Dump.

func (*FencedDiv) Kind

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

Kind implements ast.Node.Kind.

type FencedDivHTMLRenderer

type FencedDivHTMLRenderer struct{}

FencedDivHTMLRenderer renders a FencedDiv as a div element carrying all authored attributes.

func (*FencedDivHTMLRenderer) RegisterFuncs

RegisterFuncs implements renderer.NodeRenderer.

Jump to

Keyboard shortcuts

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