summaryrefslogtreecommitdiff
path: root/rst_context.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-04 14:13:11 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-04 14:13:11 +0200
commitd64ebfaca1adf349d7d0bd29c2dde84422ba3025 (patch)
treebf51f9c54730fbd92386429447b3b94959d2c925 /rst_context.lua
parent97aa5f28b096e2439d87a617c17eae52171e80d6 (diff)
downloadcontext-rst-d64ebfaca1adf349d7d0bd29c2dde84422ba3025.tar.gz
literal blocks
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