Help us shape the future of Go! Take the 2026 Go Developer Survey

render

package
v0.153.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPageAndPageInner

func GetPageAndPageInner(rctx *Context) (any, any)

GetPageAndPageInner returns the current page and the inner page for the given context.

func NewBaseContext

func NewBaseContext(rctx *Context, renderer any, n ast.Node, src []byte, getSourceSample func() []byte, ordinal int) hooks.BaseContext

NewBaseContext creates a new BaseContext.

func TextPlain

func TextPlain(n ast.Node, source []byte) string

TextPlain returns a plain text representation of the given node. This will resolve any leftover HTML entities. This will typically be entities inserted by e.g. the typographer extension. Goldmark's Node.Text was deprecated in 1.7.8.

Types

type BufWriter

type BufWriter struct {
	*bytes.Buffer
}

func (*BufWriter) Available

func (b *BufWriter) Available() int

func (*BufWriter) Buffered

func (b *BufWriter) Buffered() int

func (*BufWriter) Flush

func (b *BufWriter) Flush() error

type Context

type Context struct {
	*BufWriter
	ContextData
	// contains filtered or unexported fields
}

func (*Context) GetAndIncrementOrdinal

func (ctx *Context) GetAndIncrementOrdinal(kind ast.NodeKind) int

func (*Context) PeekPid

func (ctx *Context) PeekPid() uint64

PeekPid returns the current page ID without removing it from the stack.

func (*Context) PeekValue

func (ctx *Context) PeekValue(k ast.NodeKind) any

func (*Context) PopPid

func (ctx *Context) PopPid() uint64

PopPid pops the last page ID from the stack.

func (*Context) PopPos

func (ctx *Context) PopPos() int

func (*Context) PopRenderedString

func (ctx *Context) PopRenderedString() string

func (*Context) PopValue

func (ctx *Context) PopValue(k ast.NodeKind) any

func (*Context) PushPid

func (ctx *Context) PushPid(pid uint64)

PushPid pushes a new page ID to the stack.

func (*Context) PushPos

func (ctx *Context) PushPos(n int)

func (*Context) PushValue

func (ctx *Context) PushValue(k ast.NodeKind, v any)

type ContextData

type ContextData interface {
	RenderContext() converter.RenderContext
	DocumentContext() converter.DocumentContext
}

type RenderContextDataHolder

type RenderContextDataHolder struct {
	Rctx converter.RenderContext
	Dctx converter.DocumentContext
}

func (*RenderContextDataHolder) DocumentContext

func (ctx *RenderContextDataHolder) DocumentContext() converter.DocumentContext

func (*RenderContextDataHolder) RenderContext

func (ctx *RenderContextDataHolder) RenderContext() converter.RenderContext

Jump to

Keyboard shortcuts

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