math

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package math is CORE-08's BASELINE math battery: a self-contained goldmark.Option that renders Pandoc/Marp-style `$…$` (inline) and `$$…$$` (block) LaTeX. Common math becomes native MathML via the vendored latex2mathml; heavy constructs the construct-detection predicate flags (detect.go) degrade to a PNG-only raster <img> via go-latex/latex.

No reusable goldmark-integration library exists for this layer (unlike emoji or chroma highlighting), so the $-trigger InlineParser, the custom math AST node, and the NodeRenderer are a genuine from-scratch build, shaped after the bespoke inline parsers in chase/markdown.

Index

Constants

This section is empty.

Variables

View Source
var KindMath = ast.NewNodeKind("Math")

KindMath is the NodeKind for mathNode.

Functions

func Option

func Option(mode string) goldmark.Option

Option returns the composable goldmark.Option for the math battery, honoring press.Options.MathMode: "" (or "mathml") enables the battery; "off" disables it entirely (a no-op Option that never registers the $-parser, so `$x$` stays literal text). TRD 03-09 folds this into the one-parse engine's pressExtraOpts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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