summaryrefslogtreecommitdiff
path: root/rst_context.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rst_context.lua')
-rw-r--r--rst_context.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 57725ed..528ecdf 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -391,4 +391,17 @@ function rst_context.option_item (tab)
]], tab[1], tab[2])
end
+function rst_context.literal_block (str)
+ local stop = P"\n"^0 * -P(1) -- remove trailing blank lines
+ local rstrip = C((1 - stop)^1) * stop
+ str = rstrip:match(str)
+ return [[
+
+\\starttyping[lines=hyphenated]
+]] .. str .. [[
+
+\\stoptyping
+]]
+end
+
return rst_context