docs: add FAQ entry for redirecting markdown output to /tmp (#56)

Problem: the `markdown` and `github` presets write `.html` output to the
working directory, which clutters the project.

Solution: add a FAQ entry to both `README.md` and `doc/preview.txt`
showing how to override the `output` field to redirect to `/tmp`.
This commit is contained in:
Barrett Ruth 2026-03-11 15:43:13 -04:00 committed by GitHub
parent 39406c559c
commit 535d4cfd5e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 36 additions and 1 deletions

View file

@ -82,6 +82,22 @@ vim.g.preview = {
}
```
**Q: Markdown compilation drops `.html` files in my working directory. How do I
send output to `/tmp` instead?**
Override the `output` field. The `args` function references `ctx.output`, so the
compiled file lands wherever `output` points:
```lua
vim.g.preview = {
github = {
output = function(ctx)
return '/tmp/' .. vim.fn.fnamemodify(ctx.file, ':t:r') .. '.html'
end,
},
}
```
**Q: How do I set up SyncTeX (forward/inverse search)?**
See `:help preview-synctex` for full recipes covering Zathura, Sioyek, and