merge: resolve conflict with origin/main
This commit is contained in:
commit
e76ace674f
3 changed files with 35 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ Typst, Markdown, etc.)—diagnostics included.
|
||||||
|
|
||||||
- Async compilation via `vim.system()`
|
- Async compilation via `vim.system()`
|
||||||
- Built-in presets for Typst, LaTeX (latexmk, pdflatex, tectonic), Markdown,
|
- Built-in presets for Typst, LaTeX (latexmk, pdflatex, tectonic), Markdown,
|
||||||
GitHub-flavored Markdown, AsciiDoc, and Quarto
|
GitHub-flavored Markdown, AsciiDoc, PlantUML, Mermaid, and Quarto
|
||||||
- Compiler errors via `vim.diagnostic` or quickfix
|
- Compiler errors via `vim.diagnostic` or quickfix
|
||||||
- Previewer auto-close on buffer deletion
|
- Previewer auto-close on buffer deletion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ in Neovim. It provides a unified interface for any compilation workflow —
|
||||||
LaTeX, Typst, Markdown, or anything else with a CLI compiler.
|
LaTeX, Typst, Markdown, or anything else with a CLI compiler.
|
||||||
|
|
||||||
The plugin ships with opt-in presets for common tools (Typst, LaTeX, Pandoc,
|
The plugin ships with opt-in presets for common tools (Typst, LaTeX, Pandoc,
|
||||||
AsciiDoc, Quarto) and supports fully custom providers.
|
AsciiDoc, PlantUML, Mermaid, Quarto) and supports fully custom providers.
|
||||||
See |preview-presets|.
|
See |preview-presets|.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
@ -180,6 +180,8 @@ override individual fields by passing a table instead: >lua
|
||||||
`markdown` pandoc → HTML (standalone, embedded)
|
`markdown` pandoc → HTML (standalone, embedded)
|
||||||
`github` pandoc → HTML (GitHub-styled, `-f gfm` input)
|
`github` pandoc → HTML (GitHub-styled, `-f gfm` input)
|
||||||
`asciidoctor` asciidoctor → HTML (AsciiDoc with SSE reload)
|
`asciidoctor` asciidoctor → HTML (AsciiDoc with SSE reload)
|
||||||
|
`plantuml` plantuml → SVG (UML diagrams, `.puml`)
|
||||||
|
`mermaid` mmdc → SVG (Mermaid diagrams, `.mmd`)
|
||||||
`quarto` quarto render → HTML (scientific publishing)
|
`quarto` quarto render → HTML (scientific publishing)
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,37 @@ M.plantuml = {
|
||||||
open = true,
|
open = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
---@type preview.ProviderConfig
|
||||||
|
M.mermaid = {
|
||||||
|
ft = 'mermaid',
|
||||||
|
cmd = { 'mmdc' },
|
||||||
|
args = function(ctx)
|
||||||
|
return { '-i', ctx.file, '-o', ctx.output }
|
||||||
|
end,
|
||||||
|
output = function(ctx)
|
||||||
|
return (ctx.file:gsub('%.mmd$', '.svg'))
|
||||||
|
end,
|
||||||
|
error_parser = function(output)
|
||||||
|
local diagnostics = {}
|
||||||
|
for line in output:gmatch('[^\r\n]+') do
|
||||||
|
local lnum = line:match('^%s*Parse error on line (%d+)')
|
||||||
|
if lnum then
|
||||||
|
table.insert(diagnostics, {
|
||||||
|
lnum = tonumber(lnum) - 1,
|
||||||
|
col = 0,
|
||||||
|
message = line,
|
||||||
|
severity = vim.diagnostic.severity.ERROR,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return diagnostics
|
||||||
|
end,
|
||||||
|
clean = function(ctx)
|
||||||
|
return { 'rm', '-f', (ctx.file:gsub('%.mmd$', '.svg')) }
|
||||||
|
end,
|
||||||
|
open = true,
|
||||||
|
}
|
||||||
|
|
||||||
---@type preview.ProviderConfig
|
---@type preview.ProviderConfig
|
||||||
M.quarto = {
|
M.quarto = {
|
||||||
ft = 'quarto',
|
ft = 'quarto',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue