diff --git a/lua/opdavies/snippets/ft/rst.lua b/lua/opdavies/snippets/ft/rst.lua index 657dae1..661d9c5 100644 --- a/lua/opdavies/snippets/ft/rst.lua +++ b/lua/opdavies/snippets/ft/rst.lua @@ -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