summaryrefslogtreecommitdiff
path: root/rst_context.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-12 18:52:11 +0200
committerPhilipp Gesang <pgesang@ix.urz.uni-heidelberg.de>2010-09-12 18:52:11 +0200
commit76cf9b771dd680c4b05c2a0c59c0ec84d0f36b0d (patch)
tree38e7988d4f367243ff8c946a54d9df8ea5236a02 /rst_context.lua
parentf14eb1fcfb3bdac66b528d50c44003879935a5a1 (diff)
downloadcontext-rst-76cf9b771dd680c4b05c2a0c59c0ec84d0f36b0d.tar.gz
revised simple table implementation; first step
Diffstat (limited to 'rst_context.lua')
-rw-r--r--rst_context.lua16
1 files changed, 11 insertions, 5 deletions
diff --git a/rst_context.lua b/rst_context.lua
index 863f2da..1f49bff 100644
--- a/rst_context.lua
+++ b/rst_context.lua
@@ -10,6 +10,12 @@
-- CREATED: 31/08/10 19:35:15 CEST
--------------------------------------------------------------------------------
--
+--- TODO
+-- - Find an appropriate way to handle generic tables irrespective of the grid
+-- settings. The problem is:
+-- http://archive.contextgarden.net/message/20100912.112605.8a1aaf13.en.html
+-- Seems we'll have to choose either the grid or split tables as default. Not
+-- good.
require "lpeg"
@@ -724,7 +730,7 @@ end
function rst_context.simple_table(tab)
local head
local nr = 1
- if tab.has_head then
+ if tab.head_end then
head = [[
\\setupTABLE[c][each] [frame=on]
\\setupTABLE[r][each] [frame=on]
@@ -734,13 +740,13 @@ function rst_context.simple_table(tab)
]]
while nr <= tab.head_end do
local row = tab[nr]
- if not row.separator and not row.ignore then
+ if not row.ignore then
dbg_write(">hr>" .. #row)
head = head .. [[\\bTR]]
for nc,cell in ipairs(row) do
dbg_write("%7s | ", cell.content)
if cell.span then
- head = head .. string.format([=[\\bTH[nc=%s]%s\\eTH]=], cell.span, cell.content)
+ head = head .. string.format([=[\\bTH[nc=%s]%s\\eTH]=], cell.span.x, cell.content)
else
head = head .. [[\\bTH ]] .. cell.content .. [[\\eTH]]
end
@@ -773,13 +779,13 @@ function rst_context.simple_table(tab)
local body = ""
while nr <= #tab do
local row = tab[nr]
- if not row.separator and not row.ignore then
+ if not row.ignore then
dbg_write(">tr>" .. #row)
body = body .. [[\\bTR]]
for nc,cell in ipairs(row) do
dbg_write("%7s | ", cell.content)
if cell.span then
- body = body .. string.format([=[\\bTC[nc=%s]%s\\eTC]=], cell.span, cell.content)
+ body = body .. string.format([=[\\bTC[nc=%s]%s\\eTC]=], cell.span.x, cell.content)
else
body = body .. [[\\bTC ]] .. cell.content .. [[\\eTC]]
end