package render

import "github.com/gohugoio/hugo/markup/goldmark/internal/render"

Index

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. 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

Source Files

context.go

Version
v0.140.2
Published
Dec 30, 2024
Platform
windows/amd64
Imports
10 packages
Last checked
13 hours ago

Tools for package owners.