package mml

Import Path
	github.com/d2lang/mathjax-go/internal/mml (on go.dev)

Dependency Relation
	imports 7 packages, and imported by 3 packages

Involved Source Files attributes.go definitions.go factory.go maction_selection.go mfenced.go Package mml defines MathJax's internal MathML tree representation.
Package-Level Type Names (total 8)
/* sort by: | */
Attributes preserves MathJax's four attribute layers: explicit, inherited, per-node defaults, and global math attributes. Clone returns an independent shallow copy. (*Attributes) DefaultNames() []string Defaults returns the per-kind default map. Explicit returns the mutable explicit-attribute map. (*Attributes) ExplicitNames() []string Get resolves explicit, inherited, default, and global layers in that order. GetDefault resolves the per-kind default and global layers. GetExplicit returns only an explicitly set value. GetInherited resolves the inherited layer and its default/global prototypes. (*Attributes) GlobalNames() []string Globals returns the global math-attribute map. HasDefault reports whether name has a kind or global default. Inherited returns the mutable inherited-attribute map. (*Attributes) InheritedNames() []string IsSet reports whether name is explicit or directly inherited. Set sets an explicit attribute. SetInherited sets an inherited value. SetList sets explicit attributes in the source map's insertion order. func NewAttributes(defaults, global *ordered.Map[Property]) *Attributes func (*Attributes).Clone() *Attributes
Definition describes behavior shared by all nodes of one kind. Defaults *ordered.Map[Property] Flags Flags func (*Factory).Definition(kind string) (Definition, bool) func (*Factory).Register(kind string, definition Definition)
Factory constructs nodes with registered kind definitions and shared global math attributes. It is intentionally small so parser and layout packages can evolve independently. Create constructs kind and links children. CreateFencedNodes ports MmlMfenced.addFakeNodes/fakeNode. Its caller must apply the original incoming inheritance context to the returned operators, rather than copying the resolved attributes of their mfenced parent. Definition returns a registered definition. Globals returns the shared global math-attribute map. Register registers or replaces a node definition. Text constructs an internal text node. func NewFactory() *Factory func NewMathJaxFactory() *Factory
FencedNodes are MmlMfenced's non-authored operator nodes. A non-nil value distinguishes an initialized fence with no operators from one whose MML inheritance pass has not run. These nodes do not participate in Walk/Find. Close *Node Open *Node Separators []*Node
Flags contains node-kind behavior that MathJax expresses through its MML node subclasses. Arity int CoreIndex int Embellished bool HasNewline bool Inferred bool LinebreakContainer bool NotParent bool Spacelike bool Token bool
Node is one node in MathJax's internal MathML tree. Kind-specific state that is not an attribute lives in Properties. Attributes *Attributes Children []*Node Fenced *FencedNodes Flags Flags Kind string OperatorLspace/OperatorRspace are MmlMo's dictionary-derived defaults, distinct from explicit/inherited lspace/rspace attributes (in ems). OperatorLspace/OperatorRspace are MmlMo's dictionary-derived defaults, distinct from explicit/inherited lspace/rspace attributes (in ems). Parent *Node PrevClass TeXClass PrevLevel int Properties *ordered.Map[Property] TeXClass TeXClass Text string AppendChild appends child and returns it. ChildIndex returns child's index, or -1 if child is absent. Clone deep-copies n without retaining a parent pointer. Core returns the child containing an embellished operator, or n. CoreMO follows embellished children to their core mo node. Find returns all descendants, including n, whose kind matches. IsKind reports whether n has kind. ParentNode returns the semantic parent, skipping inferred/not-parent nodes. Property returns internal node state. RemoveChild removes child and returns an error when it is absent. RemoveProperty removes internal node state. ReplaceChild replaces oldChild and returns an error when it is absent. SetChildren replaces n's children and maintains parent pointers. SetProperty sets internal node state. Walk visits n and its descendants in pre-order. func NewNode(kind string, defaults, global *ordered.Map[Property], children ...*Node) *Node func NewText(text string) *Node func (*Factory).Create(kind string, children ...*Node) *Node func (*Factory).Text(text string) *Node func (*Node).AppendChild(child *Node) *Node func (*Node).Clone() *Node func (*Node).Core() *Node func (*Node).CoreMO() *Node func (*Node).Find(kind string) []*Node func (*Node).ParentNode() *Node func github.com/d2lang/mathjax-go/internal/pipeline.Compiler.Compile(tex string, display bool) (*Node, error) func github.com/d2lang/mathjax-go/internal/tex.(*Compiler).Compile(source string, display bool) (*Node, error) func NewNode(kind string, defaults, global *ordered.Map[Property], children ...*Node) *Node func (*Factory).Create(kind string, children ...*Node) *Node func (*Factory).CreateFencedNodes(node *Node) func (*Node).AppendChild(child *Node) *Node func (*Node).ChildIndex(child *Node) int func (*Node).RemoveChild(child *Node) error func (*Node).ReplaceChild(newChild, oldChild *Node) error func (*Node).SetChildren(children []*Node) func github.com/d2lang/mathjax-go/internal/pipeline.Typesetter.Typeset(root *Node, options pipeline.Options) (string, error) func github.com/d2lang/mathjax-go/internal/svg.(*Typesetter).Typeset(root *Node, options pipeline.Options) (string, error)
Property is a MathML attribute or internal-property value.
TeXClass is a TeX atom class used by MathJax's spacing rules. func TeXSpacing(left, right TeXClass, script bool) string const TeXClassBin const TeXClassClose const TeXClassInner const TeXClassNone const TeXClassOp const TeXClassOpen const TeXClassOrd const TeXClassPunct const TeXClassRel const TeXClassVCenter
Package-Level Functions (total 8)
IsInherit reports whether value is the Inherit sentinel.
MactionSelectionNumber applies the numeric coercions used by the source maction selected getter to supported scalar attribute values.
NewAttributes constructs an attribute set. Inputs are cloned; nil inputs are treated as empty maps.
NewFactory returns an empty factory.
NewMathJaxFactory returns the complete pinned MathJax 3.2.2 registry. Each factory owns immutable definitions; Create clones their attribute maps.
NewNode creates a node with empty attribute and property maps.
NewText creates an internal text node.
TeXSpacing returns MathJax's named space between two TeX atom classes. script suppresses entries marked as display/text-style-only. Negative table entries are the ones retained in scripts in MathJax's TEXSPACE encoding.
Package-Level Variables (total 2)
Inherit marks a default that resolves directly from the math node's global attributes, matching MathJax's _inherit_ sentinel.
Package-Level Constants (total 11)
const TeXClassOp TeXClass = 1
UnboundedArity is the integer representation used by the Go tree for MathJax's JavaScript Infinity arity. Negative one remains reserved for the inferred-mrow content model.