Skip to content

Latest commit

 

History

History
94 lines (66 loc) · 2.51 KB

README.md

File metadata and controls

94 lines (66 loc) · 2.51 KB

pandoc.kak

pandoc integration for kakoune

pandoc.kak provides a simple mean to use pandoc to convert documents written in markdown (e.g. Pandoc's markdown variant), LaTex, HTML and other formats.

pandoc.kak provides a way to preview markdown documents as pdf using zathura.

pandoc.kak provides syntax highlighting for latex at this point (experimental).

Installation

Add pandoc.kak to the plugin manager of your choise, put it into your autoload or source it manually.

Then reload Kakoune config or restart Kakoune and run :plug-install.

plug "basbebe/pandoc.kak" %{
    # your config
}

Then reload Kakoune config or restart Kakoune and run :plug-install.

Otherwise

hook global WinSetOption filetype=(asciidoc|fountain|html|latex|markdown) %{
    require-module pandoc
}

Usage

pandoc.kak provides the following commands:

  • pandoc -- Converts the current document with the pandoc options given as arguments. If no arguments are given, a pdf file will be produced.
  • pandoc-preview -- Creates a temporary pdf file next to the current buffer and opens it with zathura. Every time the document is saved, the preview is being updated. Takes pandoc options as arguments.
  • pandoc-beautify -- Beautifies the current buffer using Pandoc. Assumes buffer is markdown text.

Pandoc uses pandoc-options to let you specify custom pandoc options for the current buffer (or globally). Those options will always be applied.
Example for an entry in kakrc:

set-option global pandoc_options "-d default"

Example config

hook global WinSetOption filetype=(asciidoc|fountain|html|latex|markdown) %{
    require-module pandoc
    set-option global pandoc_options '-d default'
}

@@ Similar projects

Contributing

Pull requests are welcome.

License

The Unlicense


Inspired by vim-pandoc