diff --git a/README.md b/README.md index c7cc7f3..1d4446b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # preview.nvim -**Universal document previewer for Neovim** +**Async document compilation for Neovim** An extensible framework for compiling documents (LaTeX, Typst, Markdown, etc.) asynchronously with error diagnostics. @@ -8,8 +8,7 @@ asynchronously with error diagnostics. ## Features - Async compilation via `vim.system()` -- Built-in presets for Typst, LaTeX (latexmk, pdflatex, tectonic), Markdown, - GitHub-flavored Markdown, AsciiDoc, and Quarto +- Built-in presets for Typst, LaTeX, Markdown, and GitHub-flavored Markdown - Compiler errors as native `vim.diagnostic` - User events for extensibility (`PreviewCompileStarted`, `PreviewCompileSuccess`, `PreviewCompileFailed`) @@ -39,13 +38,13 @@ luarocks install preview.nvim ```lua require('preview').setup({ - rst = { - cmd = { 'rst2html' }, + typst = { + cmd = { 'typst', 'compile' }, args = function(ctx) - return { ctx.file, ctx.output } + return { ctx.file } end, output = function(ctx) - return ctx.file:gsub('%.rst$', '.html') + return ctx.file:gsub('%.typ$', '.pdf') end, }, }) @@ -62,8 +61,8 @@ require('preview').setup({ **Q: How do I automatically open the output file?** 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 in -toggle/watch mode. For a specific application, pass a command table: +open the output with `vim.ui.open()` after the first successful compilation. For +a specific application, pass a command table: ```lua require('preview').setup({ diff --git a/doc/preview.nvim.txt b/doc/preview.nvim.txt index 6cba09a..914f72d 100644 --- a/doc/preview.nvim.txt +++ b/doc/preview.nvim.txt @@ -10,9 +10,8 @@ preview.nvim is an extensible framework for compiling documents asynchronously in Neovim. It provides a unified interface for any compilation workflow — LaTeX, Typst, Markdown, or anything else with a CLI compiler. -The plugin ships with opt-in presets for common tools (Typst, LaTeX, Pandoc, -AsciiDoc, Quarto) and supports fully custom providers. -See |preview.nvim-presets|. +The plugin ships with opt-in presets for common tools (Typst, LaTeX, Pandoc) +and supports fully custom providers. See |preview.nvim-presets|. ============================================================================== REQUIREMENTS *preview.nvim-requirements* @@ -90,10 +89,9 @@ Provider fields:~ |preview.Context|. `open` boolean|string[] Open the output file after the first - successful compilation in toggle/watch - mode. `true` uses |vim.ui.open()|. A - string[] is run as a command with the - output path appended. + successful compilation. `true` uses + |vim.ui.open()|. A string[] is run as + a command with the output path appended. `reload` boolean|string[]|function Reload the output after recompilation.