Disable parse rule within a template

65 views
Skip to first unread message

Soren Bjornstad

unread,
Dec 20, 2020, 2:52:08 PM12/20/20
to TiddlyWiki
Using the official KaTeX plugin, I am hoping for a way to disable KaTeX rendering in a tiddler when rendering that tiddler using a specific template.

Use case: I'm programmatically extracting HTML content from TiddlyWiki by using Node to render it through a template, but I want to preserve the math notation specifically as is because the target system already natively supports LaTeX within $$ delimiters. (If I don't do anything special to the math fragments, I get a corrupted version of the markup shown twice in my output!)

I see that KaTeX is implemented as an inline parse rule, `latex-parser`, but I don't want to turn that off globally, because I still want the markup to render normally when viewing the wiki, just not when extracting content from it. The `\rules except` pragma doesn't appear to disable the rule in tiddlers transcluded into a tiddler, only within that exact tiddler. Is there some other way to adjust the parse rules?

Jeremy Ruston

unread,
Dec 21, 2020, 12:46:07 PM12/21/20
to TiddlyWiki Group
Hi Soren

If you’re working on Node.js then the easiest way to approach this might be to set up two wiki folders with the same content (see how editions/tw5.com-server inherits the content from editions/tw5.com in the core repo), with one of them lacking the KaTeX plugin. You’d then use that wiki for your static renderings.

Best wishes

Jeremy

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9a442ca8-81fd-4c0f-a106-aeb1d758dd58n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages