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:
parent
6c1609cba8
commit
6757c05dd2
2 changed files with 27 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue