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 ¶
- Variables
- func Generate(root ir.Node, mode ir.Mode, limits source.Limits) display.Alt
- func GenerateContext(ctx context.Context, root ir.Node, mode ir.Mode, limits source.Limits) (out display.Alt, err error)
- func GenerateFormula(root *ir.Formula, mode ir.Mode, limits source.Limits) display.Alt
- func GenerateFormulaContext(ctx context.Context, formula *ir.Formula, mode ir.Mode, limits source.Limits) (out display.Alt, err error)
Constants ¶
This section is empty.
Variables ¶
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 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 ¶
GenerateFormula derives alternative text for a formula root and its formula-scoped equation tags.
Types ¶
This section is empty.