feat(nvim): add rst snippets for working with PDFs

Fixes #45
This commit is contained in:
Oliver Davies 2023-01-13 01:37:46 +00:00
parent 86e1be0ced
commit 9c612e49fe

View file

@ -1,3 +1,4 @@
local fmta = require("luasnip.extras.fmt").fmta
local ls = require "luasnip"
local i = ls.insert_node
@ -12,11 +13,37 @@ local fill_line = function(char)
end
local M = {
class = { ".. class:: ", i(1) },
footer = { ".. footer:: ", i(1) },
link = { ".. _", i(1), ":" },
raw = { ".. raw:: ", i(1) },
-- TODO: add an optional new line and ":width" property.
image = { ".. image:: ", i(1) },
head = f(fill_line "=", {}),
sub = f(fill_line "-", {}),
subsub = f(fill_line "^", {}),
-- Add a page break with an optional page template.
pb = fmta(
[[
.. raw:: pdf
PageBreak<>
]],
{ i(0) }
),
-- Add a new speaker note.
ta = fmta(
[[
.. raw:: pdf
TextAnnotation "<>"
]],
{ i(0) }
)
}
return M