fence

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: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FencedContainerAttributeFilter = html.GlobalAttributeFilter

HeadingAttributeFilter defines attribute names which heading elements can have

View Source
var KindFencedContainer = ast.NewNodeKind("FencedContainer")

KindFencedContainer is a NodeKind of the FencedContainer node.

Functions

func New

func New() goldmark.Extender

func NewFencedContainerParser

func NewFencedContainerParser() parser.BlockParser

NewFencedContainerParser returns a new BlockParser that parses fenced code blocks.

Types

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 fenced divs / fenced containers / fences in markdown

Fences are a way to wrap other elements in divs and giving those divs attributes such as ids or css classes using the same syntax as with headings.

:::{#big-div .add-border} this is some text

## with a header

:::{.background-green .font-big} ```R X <- as.data.table(iris) X[Species != "virginica", mean(Sepal.Length), Species] ``` ::: :::

func (*Extender) Extend

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

This implements the Extend method for goldmark-fences.Extender

type FencedContainer

type FencedContainer struct {
	ast.BaseBlock

	Title string
	// contains filtered or unexported fields
}

A FencedContainer struct represents a fenced code block of Markdown text.

func NewFencedContainer

func NewFencedContainer() *FencedContainer

NewFencedContainer return a new FencedContainer node.

func (*FencedContainer) Dump

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

Dump implements Node.Dump .

func (*FencedContainer) Kind

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

Kind implements Node.Kind.

func (*FencedContainer) SetTitle

func (n *FencedContainer) SetTitle(title string)

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