flowrender

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFlowElements

func BuildFlowElements(templateSource, templateName, cssStyle string, data any) ([]pdfdom.PDFElementNode, error)

BuildFlowElements executes a named HTML template, applies CSS styling, and converts the resulting document flow into PDFDOM elements.

func BuildFlowElementsFromSourcesWithFuncs

func BuildFlowElementsFromSourcesWithFuncs(templateSources []string, templateName, cssStyle string, data any, funcs htmltmpl.FuncMap) ([]pdfdom.PDFElementNode, error)

func BuildFlowElementsFromSourcesWithOptions

func BuildFlowElementsFromSourcesWithOptions(templateSources []string, templateName, cssStyle string, data any, funcs htmltmpl.FuncMap, options BuildOptions) ([]pdfdom.PDFElementNode, error)

func BuildFlowElementsWithFuncs

func BuildFlowElementsWithFuncs(templateSource, templateName, cssStyle string, data any, funcs htmltmpl.FuncMap) ([]pdfdom.PDFElementNode, error)

BuildFlowElementsWithFuncs executes a named HTML template with custom template functions, applies CSS styling, and converts the resulting document flow into PDFDOM elements.

Types

type BuildOptions

type BuildOptions struct {
	Context                context.Context
	MaxTemplateOutputBytes int64
	MaxNodes               int
	MaxRows                int
	MaxDepth               int
	Complexity             *ComplexityBudget
	AllowInvalidAttributes bool
	Warnf                  func(string, ...any)
}

type ComplexityBudget

type ComplexityBudget struct {
	Nodes int
	Rows  int
}

type ComplexityLimitError

type ComplexityLimitError struct {
	Kind   string
	Limit  int
	Actual int
}

func (*ComplexityLimitError) Error

func (e *ComplexityLimitError) Error() string

func (*ComplexityLimitError) Is

func (e *ComplexityLimitError) Is(target error) bool

type PreparationStats

type PreparationStats struct {
	TemplateParses   int
	StylesheetParses int
}

PreparationStats reports parsing performed during this prepared flow's render-scoped lifetime.

type PreparedFlow

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

PreparedFlow caches immutable parsing work for one render. Callers should create a new instance for each render; no cross-render cache is retained.

func PrepareFlow

func PrepareFlow(templateSources []string, cssStyle string) (*PreparedFlow, error)

PrepareFlow parses reusable template and stylesheet inputs for one render.

func (*PreparedFlow) Build

func (prepared *PreparedFlow) Build(templateName string, data any, funcs htmltmpl.FuncMap, options BuildOptions) ([]pdfdom.PDFElementNode, error)

Build executes one flow section using the render-scoped prepared inputs.

func (*PreparedFlow) Stats

func (prepared *PreparedFlow) Stats() PreparationStats

Stats returns preparation counts. More than one template parse indicates that the render used distinct function-map signatures.

Jump to

Keyboard shortcuts

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