docs: replace all setup() references with vim.g.preview (#43)

This commit is contained in:
Barrett Ruth 2026-03-04 19:39:00 -05:00 committed by GitHub
parent f1aed82f42
commit 7895b67c21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 27 deletions

View file

@ -49,7 +49,7 @@ luarocks install preview.nvim
**Q: How do I define a custom provider?**
```lua
require('preview').setup({
vim.g.preview = {
rst = {
cmd = { 'rst2html' },
args = function(ctx)
@ -59,15 +59,15 @@ require('preview').setup({
return ctx.file:gsub('%.rst$', '.html')
end,
},
})
}
```
**Q: How do I override a preset?**
```lua
require('preview').setup({
vim.g.preview = {
typst = { env = { TYPST_FONT_PATHS = '/usr/share/fonts' } },
})
}
```
**Q: How do I automatically open the output file?**
@ -77,7 +77,7 @@ open the output with `vim.ui.open()` after the first successful compilation in
toggle/watch mode. For a specific application, pass a command table:
```lua
require('preview').setup({
vim.g.preview = {
typst = { open = { 'sioyek', '--new-instance' } },
})
}
```