math

package
v0.97.12 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package math implements the :::math directive, which renders a raw LaTeX source block inside a .vaelor-math container.

Syntax:

:::math
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
:::

Body is treated as raw LaTeX and emitted HTML-escaped inside a <div class="vaelor-math"> container, styled as a math-like block.

KaTeX rendering limitation (v1): full client-side KaTeX rendering requires injecting <script> tags into the document <head>, which the current directives framework does not expose (CSS() is the only per-directive theme hook). For v1 we ship a serif/italic math-styled block that reads as a math excerpt even without KaTeX. Full KaTeX support is deferred to a follow-up task that extends the Handler interface with a HeadHTML() (or equivalent) hook; when added, the runtime can inject the KaTeX CSS/JS CDN bundle and iterate .vaelor-math elements calling katex.render(el.textContent, el).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() directives.Handler

New returns a fresh math Handler. init() already registers a default instance; exposed for callers that want to register explicitly.

Types

This section is empty.

Jump to

Keyboard shortcuts

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