render

package
v1.6.69 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package render provides a pipeline for rendering parsed Asciidoc back into text Asciidoc

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elements

func Elements(cxt Target, prefix string, elementList ...asciidoc.Element) (err error)

Types

type AttributeFilter

type AttributeFilter uint32
const (
	AttributeFilterNone AttributeFilter = 0
	AttributeFilterAll  AttributeFilter = math.MaxUint32
)
const (
	AttributeFilterID AttributeFilter = 1 << iota
	AttributeFilterTitle
	AttributeFilterStyle
	AttributeFilterCols
	AttributeFilterText
	AttributeFilterAlt
	AttributeFilterHeight
	AttributeFilterWidth
	AttributeFilterPDFWidth
	AttributeFilterRole
	AttributeFilterAlign
	AttributeFilterFloat
)

type Option

type Option func(r *Renderer)

func Wrap

func Wrap(lineLength int) Option

type RenderOptions

type RenderOptions struct {
	WrapLength int `name:"wrap" default:"0" help:"the maximum length of a line" group:"Output:"`
}

func (RenderOptions) ToOptions

func (ro RenderOptions) ToOptions() []Option

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer(options ...Option) *Renderer

func (Renderer) Name

func (p Renderer) Name() string

func (Renderer) Process

func (p Renderer) Process(cxt context.Context, input *pipeline.Data[*asciidoc.Document], index int32, total int32) (outputs []*pipeline.Data[string], extra []*pipeline.Data[*asciidoc.Document], err error)

type Section

type Section interface {
	GetASCIISection() *asciidoc.Section
}

type Target

type Target interface {
	EnsureNewLine()
	WriteRune(r rune)
	WriteString(s string)
	String() string
	EnableWrap()
	DisableWrap()
	FlushWrap()
	StartBlock()
	EndBlock()
	Subtarget() Target
}

func NewUnwrappedTarget

func NewUnwrappedTarget(parent context.Context) Target

func NewWrappedTarget

func NewWrappedTarget(parent context.Context, wrapLength int) Target

Jump to

Keyboard shortcuts

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