Compare commits
3 commits
build/nix-
...
docs/pre-r
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b458ae2ab | |||
| 3b42f27594 | |||
| 9260eaf8af |
2 changed files with 16 additions and 13 deletions
17
README.md
17
README.md
|
|
@ -1,6 +1,6 @@
|
||||||
# preview.nvim
|
# preview.nvim
|
||||||
|
|
||||||
**Async document compilation for Neovim**
|
**Universal document previewer for Neovim**
|
||||||
|
|
||||||
An extensible framework for compiling documents (LaTeX, Typst, Markdown, etc.)
|
An extensible framework for compiling documents (LaTeX, Typst, Markdown, etc.)
|
||||||
asynchronously with error diagnostics.
|
asynchronously with error diagnostics.
|
||||||
|
|
@ -8,7 +8,8 @@ asynchronously with error diagnostics.
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Async compilation via `vim.system()`
|
- Async compilation via `vim.system()`
|
||||||
- Built-in presets for Typst, LaTeX, Markdown, and GitHub-flavored Markdown
|
- Built-in presets for Typst, LaTeX (latexmk, pdflatex, tectonic), Markdown,
|
||||||
|
GitHub-flavored Markdown, AsciiDoc, and Quarto
|
||||||
- Compiler errors as native `vim.diagnostic`
|
- Compiler errors as native `vim.diagnostic`
|
||||||
- User events for extensibility (`PreviewCompileStarted`,
|
- User events for extensibility (`PreviewCompileStarted`,
|
||||||
`PreviewCompileSuccess`, `PreviewCompileFailed`)
|
`PreviewCompileSuccess`, `PreviewCompileFailed`)
|
||||||
|
|
@ -38,13 +39,13 @@ luarocks install preview.nvim
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require('preview').setup({
|
require('preview').setup({
|
||||||
typst = {
|
rst = {
|
||||||
cmd = { 'typst', 'compile' },
|
cmd = { 'rst2html' },
|
||||||
args = function(ctx)
|
args = function(ctx)
|
||||||
return { ctx.file }
|
return { ctx.file, ctx.output }
|
||||||
end,
|
end,
|
||||||
output = function(ctx)
|
output = function(ctx)
|
||||||
return ctx.file:gsub('%.typ$', '.pdf')
|
return ctx.file:gsub('%.rst$', '.html')
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
@ -61,8 +62,8 @@ require('preview').setup({
|
||||||
**Q: How do I automatically open the output file?**
|
**Q: How do I automatically open the output file?**
|
||||||
|
|
||||||
Set `open = true` on your provider (all built-in presets have this enabled) to
|
Set `open = true` on your provider (all built-in presets have this enabled) to
|
||||||
open the output with `vim.ui.open()` after the first successful compilation. For
|
open the output with `vim.ui.open()` after the first successful compilation in
|
||||||
a specific application, pass a command table:
|
toggle/watch mode. For a specific application, pass a command table:
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
require('preview').setup({
|
require('preview').setup({
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@ preview.nvim is an extensible framework for compiling documents asynchronously
|
||||||
in Neovim. It provides a unified interface for any compilation workflow —
|
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,
|
||||||
and supports fully custom providers. See |preview.nvim-presets|.
|
AsciiDoc, Quarto) and supports fully custom providers.
|
||||||
|
See |preview.nvim-presets|.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
REQUIREMENTS *preview.nvim-requirements*
|
REQUIREMENTS *preview.nvim-requirements*
|
||||||
|
|
@ -89,9 +90,10 @@ Provider fields:~
|
||||||
|preview.Context|.
|
|preview.Context|.
|
||||||
|
|
||||||
`open` boolean|string[] Open the output file after the first
|
`open` boolean|string[] Open the output file after the first
|
||||||
successful compilation. `true` uses
|
successful compilation in toggle/watch
|
||||||
|vim.ui.open()|. A string[] is run as
|
mode. `true` uses |vim.ui.open()|. A
|
||||||
a command with the output path appended.
|
string[] is run as a command with the
|
||||||
|
output path appended.
|
||||||
|
|
||||||
`reload` boolean|string[]|function
|
`reload` boolean|string[]|function
|
||||||
Reload the output after recompilation.
|
Reload the output after recompilation.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue