katex

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package katex provides a built-in plugin that ships KaTeX runtime assets and wires them into any page whose rendered HTML contains math markup.

The plugin copies the embedded vendor files (JS, CSS, fonts, init script) under dist/assets/vendor/katex/ during BuildDone, and appends the relevant <script>/<link> entries to RouteData.Scripts and RouteData.Styles during BeforeRender — gated on a per-page detection that scans for class="math". Config key `plugins.config.katex.always: true` forces the assets onto every page regardless of detection.

The `assets/` directory is expected to contain the KaTeX distribution (katex.min.js, katex.min.css, auto-render.min.js, init.js, fonts/*.woff2). Files are placeholders by default — replace them with the real KaTeX release before shipping.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg map[string]any) *plugin.Plugin

New constructs the KaTeX plugin from its config map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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