summaryrefslogtreecommitdiff
path: root/rst_context.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-06 15:22:53 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-06 15:22:53 +0200
commitf87e85ad1dd07bfb4f3c07f2571f5af6401733c9 (patch)
treed9a5f90eba53988d6b459578749bbea2e6801fbe /rst_context.lua
parentd8e6a7412c51e827616cee03a4b657b6cde03b95 (diff)
downloadcontext-rst-f87e85ad1dd07bfb4f3c07f2571f5af6401733c9.tar.gz
grid table prototype
Diffstat (limited to 'rst_context.lua')
-rw-r--r--rst_context.lua41
1 files changed, 41 insertions, 0 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 6a0d2f3..7603509 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -458,4 +458,45 @@ function rst_context.block_quote (tab)
]]
end
+function rst_context.table (str)
+ return [[
+\\startlinecorrection
+]] .. str .. [[
+
+\\stoplinecorrection
+]]
+end
+
+function rst_context.grid_table (str)
+ return [[
+\\setupTABLE[c][first] [background=color, backgroundcolor=grey, style=\tt]
+\\setupTABLE[c][each] [frame=off]
+\\setupTABLE[r][each] [frame=off]
+\\bTABLE[split=repeat,option=stretch]
+\\bTABLEhead
+\\bTR
+ \\bTH Option \\eTH
+ \\bTH Description \\eTH
+\\eTR
+\\eTABLEhead
+\\bTABLEbody
+]] .. str .. [[
+
+\\eTABLEbody
+\\eTABLE
+]]
+end
+
+function rst_context.table_row (tab)
+ local tmp = [[\\bTR]]
+ for n, cell in ipairs(tab) do
+ tmp = tmp .. [[\\bTC]] .. cell .. [[\\eTC]] .. "\n"
+ print (cell)
+ end
+
+ tmp = tmp .. [[\\eTR
+]]
+ return tmp
+end
+
return rst_context