Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 20 additions & 1 deletion doc/preview.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CONTENTS *preview-contents*
7. Lua API ................................................... |preview-api|
8. Events ............................................... |preview-events|
9. Health ............................................... |preview-health|
10. SyncTeX ............................................. |preview-synctex|
10. FAQ ..................................................... |preview-faq|
11. SyncTeX ............................................. |preview-synctex|

==============================================================================
REQUIREMENTS *preview-requirements*
Expand Down Expand Up @@ -314,6 +315,24 @@ Checks: ~
- Each configured provider's binary is executable
- Each configured provider's opener binary (if any) is executable

==============================================================================
FAQ *preview-faq*

Q: Markdown/GFM compilation drops `.html` files in my working directory.
How do I send output to `/tmp` instead?

A: 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,
},
}
<

==============================================================================
SYNCTEX *preview-synctex*

Expand Down
Loading