Skip to content

Add optional KaTeX math rendering toggle (usekatex / usemath) for web UI#95

Open
nmaguiar wants to merge 1 commit intomainfrom
codex/add-katex-support-for-rendering
Open

Add optional KaTeX math rendering toggle (usekatex / usemath) for web UI#95
nmaguiar wants to merge 1 commit intomainfrom
codex/add-katex-support-for-rendering

Conversation

@nmaguiar
Copy link
Contributor

@nmaguiar nmaguiar commented Jan 30, 2026

Motivation

  • Provide an optional, non-breaking way to render LaTeX math in the browser UI similar to the existing Mermaid support so users can opt-in to math rendering when desired.
  • Avoid changing default behavior or core Mini-A arguments while exposing the feature to the web UI and server endpoints.

Description

  • Add usekatex and alias usemath parameters to mini-a-web.yaml, expose usekatex in the /info response as usekatex, and normalize the usemath alias to usekatex before use in the server startup logic.
  • Keep the KaTeX toggle out of core Mini-A runtime args by deleting usekatex from global.maArgs so it only impacts the browser UI and server state.
  • Wire the browser markdown pipeline in public/index.md to optionally load KaTeX assets and the showdown-katex extension, dynamically build a showdown.Converter with the extension when enabled, and add functions ensureKatexAssets / configureKatexAvailability to manage asset loading.
  • Integrate feature detection into the UI flow by reading usekatex from /info inside configureFeatureAvailability() and calling configureKatexAvailability(); document the new flag in USAGE.md.

Testing

  • No automated tests were executed for this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant