Versions in this module Expand all Collapse all v0 v0.2.1 Sep 9, 2026 Changes in this version + const DefaultCurrencyCode + const DefaultLocale + const DefaultPageFormat + const PageOrientationLandscape + const PageOrientationPortrait + const UnsupportedCSSPropertyCode + var ErrLimitExceeded = limitmarker.ErrExceeded + func DefaultTemplateFuncMap(defaultLocale, payloadLocale string) htmltmpl.FuncMap + func DefaultTemplateFuncMapWithContext(ctx FuncContext) htmltmpl.FuncMap + func FormatLocalizedTime(t time.Time, locale, style string) string + func Render(outputPath string, options ...RenderOption) error + func RenderContext(ctx context.Context, outputPath string, options ...RenderOption) error + func RenderToBytes(input RenderInput) ([]byte, error) + func RenderToBytesContext(ctx context.Context, input RenderInput) ([]byte, error) + func RenderToFile(input RenderInput, outputPath string) error + func RenderToFileContext(ctx context.Context, input RenderInput, outputPath string) error + func RenderToWriter(input RenderInput, out io.Writer) error + func RenderToWriterContext(ctx context.Context, input RenderInput, out io.Writer) error + func RenderWithInput(input RenderInput) error + func RenderWithInputContext(ctx context.Context, input RenderInput) error + func SupportedCSSProperties() []string + type AssetInput struct + CSS TextSource + CSSLayers []CSSLayerInput + Flow JSONSource + HTML TextSource + HTMLLayers []HTMLLayerInput + SourceData JSONSource + func MigrateAssetInputLegacyCSSToSingleLayer(in AssetInput, layerName string) AssetInput + func (in AssetInput) ResolveAssets() (Assets, error) + func (in AssetInput) ResolveWithBaseDir(baseDir string) (Assets, error) + type Assets struct + CSS string + CSSLayers []CSSLayer + Flow Flow + HTML string + HTMLLayers []HTMLLayer + SourceData map[string]any + func (a Assets) Validate() error + type BudgetError struct + Actual int64 + Limit int64 + Stage string + func (e *BudgetError) Error() string + func (e *BudgetError) Is(target error) bool + type CSSLayer struct + CSS string + Name string + Optional bool + type CSSLayerInput struct + Name string + Optional bool + Source TextSource + func LegacyCSSSourceAsLayer(source TextSource, layerName string) CSSLayerInput + func (l CSSLayerInput) Resolve(index int) (CSSLayer, bool, error) + type CSSSupportDiagnostic = templateload.CSSSupportDiagnostic + func AnalyzeCSSSupport(cssText string) ([]CSSSupportDiagnostic, error) + type ConfinedFileResolver struct + Root string + func (r ConfinedFileResolver) ReadDir(ctx context.Context, name string) ([]fs.DirEntry, error) + func (r ConfinedFileResolver) ReadFile(ctx context.Context, name string, maxBytes int64) ([]byte, error) + type DiagnosticCode string + const DiagnosticAsset + const DiagnosticCanceled + const DiagnosticInvalidInput + const DiagnosticLayout + const DiagnosticLimit + const DiagnosticOutput + const DiagnosticTemplate + type DiagnosticError struct + Code DiagnosticCode + Err error + Layer string + Page int + Section string + Stage string + func (e *DiagnosticError) Error() string + func (e *DiagnosticError) Unwrap() error + type Flow struct + MainFlow []Section + PageNumber Section + func (f Flow) Validate() error + type FontRegistration struct + Family string + Sources []string + Style string + type FuncContext struct + DefaultCurrencyCode string + DefaultLocale string + Now func() time.Time + PayloadLocale string + type FuncMapFactory func(defaultLocale, payloadLocale string) htmltmpl.FuncMap + type FuncMapFactoryWithContext func(ctx FuncContext) htmltmpl.FuncMap + type HTMLLayer struct + HTML string + Name string + Optional bool + type HTMLLayerInput struct + Name string + Optional bool + Source TextSource + func (l HTMLLayerInput) Resolve(index int) (HTMLLayer, bool, error) + type JSONSource struct + FS fs.FS + FSPath string + FilePath string + Object any + Raw []byte + Text string + func (s JSONSource) DecodeInto(target any, label string) error + func (s JSONSource) IsSet() bool + type LimitError struct + Actual int64 + Limit int64 + Resource string + func (e *LimitError) Error() string + func (e *LimitError) Is(target error) bool + type Logger interface + Warnf func(format string, args ...any) + type PageMargins struct + Bottom float64 + Left float64 + Right float64 + Top float64 + type PayloadConfig struct + I18nVars map[string]string + IncludeSource bool + LocalePath string + Runtime map[string]string + Static map[string]any + type RenderInput struct + AllowPartialRender bool + AssetBaseDir string + AssetInput *AssetInput + Assets Assets + DefaultCurrencyCode string + DefaultLocale string + DefaultMargins PageMargins + EnableI18nTemplateMacros bool + FontRegistrations []FontRegistration + FuncMapFactory FuncMapFactory + FuncMapFactoryEx FuncMapFactoryWithContext + I18nSource JSONSource + Limits RenderLimits + Logger Logger + Now func() time.Time + OutputPath string + PageFormat string + PageHeight float64 + PageOrientation string + PageWidth float64 + ResourceResolver ResourceResolver + SourceData any + WarningWriter io.Writer + type RenderLimits struct + Depth int + ImageBytes int64 + ImagePixels int64 + Nodes int + OutputBytes int64 + Pages int + Rows int + SourceBytes int64 + TemplateOutputBytes int64 + func DefaultRenderLimits() RenderLimits + type RenderOption func(*RenderInput) error + func WithAssetBaseDir(path string) RenderOption + func WithAssetInput(assetInput AssetInput) RenderOption + func WithAssets(assets Assets) RenderOption + func WithConfinedResourceRoot(root string) RenderOption + func WithDefaultCurrencyCode(code string) RenderOption + func WithDefaultLocale(locale string) RenderOption + func WithDefaultMargins(margins PageMargins) RenderOption + func WithFontRegistrations(registrations ...FontRegistration) RenderOption + func WithFuncMapFactory(factory FuncMapFactory) RenderOption + func WithFuncMapFactoryEx(factory FuncMapFactoryWithContext) RenderOption + func WithI18nSource(source JSONSource) RenderOption + func WithI18nTemplateMacros(enabled bool) RenderOption + func WithLegacyPartialRendering(enabled bool) RenderOption + func WithLogger(logger Logger) RenderOption + func WithNow(now func() time.Time) RenderOption + func WithPageFormat(format string) RenderOption + func WithPageHeight(height float64) RenderOption + func WithPageMarginsLeftRight(value float64) RenderOption + func WithPageMarginsTopBottom(value float64) RenderOption + func WithPageOrientation(orientation string) RenderOption + func WithPageSize(width, height float64) RenderOption + func WithPageWidth(width float64) RenderOption + func WithRenderLimits(limits RenderLimits) RenderOption + func WithSourceData(source any) RenderOption + func WithTrustedFileAccess() RenderOption + func WithWarningWriter(w io.Writer) RenderOption + type ResourceResolver interface + ReadDir func(ctx context.Context, name string) ([]fs.DirEntry, error) + ReadFile func(ctx context.Context, name string, maxBytes int64) ([]byte, error) + type Section struct + Payload PayloadConfig + Template string + Transformer string + func (s Section) Validate() error + type TextSource struct + FS fs.FS + FSPath string + FilePath string + Raw []byte + Text string + func (s TextSource) IsSet() bool + func (s TextSource) Resolve(label string) (string, error) + type TrustedFileResolver struct + func (TrustedFileResolver) ReadDir(ctx context.Context, name string) ([]fs.DirEntry, error) + func (TrustedFileResolver) ReadFile(ctx context.Context, name string, maxBytes int64) ([]byte, error) v0.1.0 Sep 9, 2026