= adoc-pdf-live.nvim
Very simple live preview plugin for AsciiDoc PDF documents. HTML live preview is
perfect with the
https://asciidoctor.cn/docs/editing-asciidoc-with-live-preview/[browser
plugins], but for PDF documents there’s nothing available.
This is a plugin I made for my own use, so I’ve only tested it on
https://github.com/neovim/neovim[neovim nightly 0.5]. Feel free to open an issue
or pull request to fix anything on your system. This is my first vim plugin ever
as well, so there’s probably lots to improve.
image::./images/screenshot.png[screenshot, align=center, width=90%]
== Installation
Plug ‘marioortizmanero/adoc-pdf-live.nvim’
use {
‘marioortizmanero/adoc-pdf-live.nvim’,
config = “require(‘adoc_pdf_live’).setup()”
}
== Usage
You must setup the plugin in order to use it. For the basic setup with the
default options:
[source, lua]
require(‘adoc_pdf_live’).setup()
Or, to specify your own custom options (the example lists the default values):
[source, lua]
require(‘adoc_pdf_live’).setup {
enabled = false,
– The viewer command must be like command <file>
viewer = ‘zathura’,
binary = ‘asciidoctor-pdf’,
params = ‘’,
debug = false,
style = ‘’,
style_regex = ‘style\.ya?ml’
}
See the configuration section in the documentation for more information about
the available options.
Once you have an AsciiDoc file open, you can use the :AdocPdfLiveStart command
to compile the document whenever the file is saved. :AdocPdfLiveOpen will
additionally open your preferred PDF viewer, and :AdocPdfLiveStop will stop
the plugin. For more commands, see its section in the documentation.
It’s highly recommended to use a PDF viewer like
https://pwmt.org/projects/zathura/[zathura] which automatically reloads the file
when it’s modified, so that the live reloading is seamless.
https://github.com/asciidoctor/asciidoctor-pdf/blob/main/docs/theming-guide.adoc[Yaml
style files] are roughly supported. This plugin will automatically look for one
and enable it when compiling the PDF, with the style_regex option. You can
override it with the style option or the :AdocPdfLiveStyle STYLE command.
评论