glamour

package
v0.4.0-beta.29 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package renderer renders the given AST to certain formats.

Index

Constants

View Source
const WalkJump goldast.WalkStatus = 100

WalkJump indicates that the walker should jump to the next node.

Variables

This section is empty.

Functions

func TestJumpRenderBlock

func TestJumpRenderBlock(t *testing.T)

func TestJumpRenderHeading

func TestJumpRenderHeading(t *testing.T)

func TestNormalRender

func TestNormalRender(t *testing.T)

func TestRenderContext

func TestRenderContext(t *testing.T)

Types

type GlamourFlushNode

type GlamourFlushNode struct{ goldast.BaseBlock }

func (*GlamourFlushNode) Kind

func (n *GlamourFlushNode) Kind() goldast.NodeKind

type GlamourNodeRenderer

type GlamourNodeRenderer struct {
	Context *renderer.Context
}

func NewGlamourNodeRenderer

func NewGlamourNodeRenderer(context *renderer.Context) *GlamourNodeRenderer

func (*GlamourNodeRenderer) RegisterFuncs

type GlamourRenderer

type GlamourRenderer struct {
	Section string
	Context *renderer.Context
	// contains filtered or unexported fields
}

func NewGlamourRenderer

func NewGlamourRenderer(actualRenderer goldrenderer.Renderer, context *renderer.Context) *GlamourRenderer

NewRenderer returns a new Renderer with given options.

func (*GlamourRenderer) AddOptions

func (r *GlamourRenderer) AddOptions(opts ...goldrenderer.Option)

func (*GlamourRenderer) Render

func (r *GlamourRenderer) Render(w io.Writer, source []byte, n goldast.Node) error

Render will individually render the child (block) nodes. This is required as Glamour buffers block node renders until the end of the document, which means execution blocks are run before any output is seen.

type JumpError

type JumpError struct {
	ToNode       goldast.Node
	ReturnToNode goldast.Node
}

func (JumpError) Error

func (e JumpError) Error() string

type Rundown

type Rundown struct {
	goldmark.Markdown

	Context *renderer.Context
}

Jump to

Keyboard shortcuts

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