Skip to content

Make math rendering opt-in with Trait - #82

Open
ajevans99 wants to merge 1 commit into
gonzalezreal:mainfrom
ajevans99:ajevans99-make-math-opt-in
Open

Make math rendering opt-in with Trait#82
ajevans99 wants to merge 1 commit into
gonzalezreal:mainfrom
ajevans99:ajevans99-make-math-opt-in

Conversation

@ajevans99

Copy link
Copy Markdown

Summary

  • Add a disabled-by-default SwiftPM Math trait
  • Include SwiftUIMath only when Math is enabled
  • Conditionally compile math parsing, rendering, configuration, and tests
  • Preserve standard Markdown and code-block rendering without math support
  • Update documentation and configure the demo to opt in

Motivation

SwiftUIMath bundles roughly 7.4 MB of font resources. Applications that do not render math currently inherit this cost unnecessarily.

This change makes math support explicitly opt-in while leaving the rest of Textual’s Markdown functionality unchanged.

Usage

.package(
  url: "https://github.com/gonzalezreal/textual",
  from: "0.5.0",
  traits: [.defaults, "Math"]
)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: b682fcd7-3123-4be3-b0b5-b0deda224b80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant