alt

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0, 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

Overview

Package alt derives deterministic plain text and speech from Untie's neutral math IR. It never reads source text, rendering geometry, fonts, or layout fragments.

Text uses a compact linear notation. Semantic roles distinguish quotients from binomials and stacks, matrices from arrays/cases/vectors, and ordinary scripts from limits, overlays, and brace labels. Speech spells operators and structure as words. Unsupported representations are emitted as visible bracket markers. Failures return a deterministic, validated fallback bounded by the configured MaxTextBytes.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidContext reports a nil context.
	ErrInvalidContext = errors.New("alt: nil context")
	// ErrInvalidRoot reports a nil or malformed expression root.
	ErrInvalidRoot = errors.New("alt: invalid expression root")
	// ErrLimitExceeded reports a traversal or output-size limit.
	ErrLimitExceeded = errors.New("alt: limit exceeded")
	// ErrUnsupportedNode reports a node representation this pass cannot explain.
	ErrUnsupportedNode = errors.New("alt: unsupported node")
)

Functions

func Generate

func Generate(root ir.Node, mode ir.Mode, limits source.Limits) display.Alt

Generate derives alternative text with a background context.

func GenerateContext

func GenerateContext(ctx context.Context, root ir.Node, mode ir.Mode, limits source.Limits) (out display.Alt, err error)

GenerateContext derives alternative text with cancellation and caller-owned traversal/output limits. It returns a visible fallback alongside non-context errors so callers that ignore the error still never receive invented text.

func GenerateFormula

func GenerateFormula(root *ir.Formula, mode ir.Mode, limits source.Limits) display.Alt

GenerateFormula derives alternative text for a formula root and its formula-scoped equation tags.

func GenerateFormulaContext

func GenerateFormulaContext(ctx context.Context, formula *ir.Formula, mode ir.Mode, limits source.Limits) (out display.Alt, err error)

GenerateFormulaContext is GenerateContext with equation-tag metadata.

Types

This section is empty.

Jump to

Keyboard shortcuts

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