refactor(presets): add reload field, remove synctex field

Problem: the synctex field only handled PDF forward search and left
HTML live-preview and typst watch mode unsupported.

Solution: add reload = function(ctx) returning { 'typst', 'watch',
ctx.file } to typst (long-running watch mode), reload = true to
markdown and github (SSE push after each pandoc compile), and remove
synctex = true from latex (the -synctex=1 arg in latex.args remains
for .synctex.gz generation).
This commit is contained in:
Barrett Ruth 2026-03-03 16:23:41 -05:00
parent 6c1609cba8
commit 6757c05dd2
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 27 additions and 0 deletions

View file

@ -107,6 +107,9 @@ M.typst = {
return parse_typst(output)
end,
open = true,
reload = function(ctx)
return { 'typst', 'watch', ctx.file }
end,
}
---@type preview.ProviderConfig
@ -117,6 +120,7 @@ M.latex = {
return {
'-pdf',
'-interaction=nonstopmode',
'-synctex=1',
'-pdflatex=pdflatex -file-line-error -interaction=nonstopmode %O %S',
ctx.file,
}
@ -150,6 +154,7 @@ M.markdown = {
return { 'rm', '-f', (ctx.file:gsub('%.md$', '.html')) }
end,
open = true,
reload = true,
}
---@type preview.ProviderConfig
@ -179,6 +184,7 @@ M.github = {
return { 'rm', '-f', (ctx.file:gsub('%.md$', '.html')) }
end,
open = true,
reload = true,
}
return M