refactor(presets): use --katex instead of --embed-resources --mathml

Problem: `--embed-resources` with `--mathml` caused pandoc to inline all
assets at compile time, adding ~15s per save for KaTeX-heavy documents.

Solution: Default to `--katex`, which inserts a CDN `<script>` tag and
defers rendering to the browser. Users can opt into `--embed-resources`
or `--mathml` via `extra_args`.
This commit is contained in:
Barrett Ruth 2026-03-06 14:26:09 -05:00
parent e513fc57d1
commit 8049730803
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 6 additions and 8 deletions

View file

@ -224,7 +224,7 @@ M.markdown = {
ft = 'markdown',
cmd = { 'pandoc' },
args = function(ctx)
return { ctx.file, '-s', '--embed-resources', '--mathml', '-o', ctx.output }
return { ctx.file, '-s', '--katex', '-o', ctx.output }
end,
output = function(ctx)
return (ctx.file:gsub('%.md$', '.html'))
@ -249,8 +249,7 @@ M.github = {
'gfm',
ctx.file,
'-s',
'--embed-resources',
'--mathml',
'--katex',
'--css',
'https://cdn.jsdelivr.net/gh/pixelbrackets/gfm-stylesheet@master/dist/gfm.css',
'-o',