diff options
author | Hans Hagen <pragma@wxs.nl> | 2009-10-16 16:13:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2009-10-16 16:13:00 +0200 |
commit | 7f9b179ad5be5000f67192f283d20e7120402bd9 (patch) | |
tree | 18f83a8cbfe7fed1c2a6939fb4b2cf10473abbbe /tex/context/base/page-lin.lua | |
parent | c878054f6360d50885dbdab96643a8f3ac61c46c (diff) | |
download | context-7f9b179ad5be5000f67192f283d20e7120402bd9.tar.gz |
beta 2009.10.16 16:13
Diffstat (limited to 'tex/context/base/page-lin.lua')
-rw-r--r-- | tex/context/base/page-lin.lua | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/tex/context/base/page-lin.lua b/tex/context/base/page-lin.lua index 0efb6314e..c8f5161d8 100644 --- a/tex/context/base/page-lin.lua +++ b/tex/context/base/page-lin.lua @@ -42,15 +42,16 @@ nodes.lines.scratchbox = nodes.lines.scratchbox or 0 -- cross referencing function nodes.lines.number(n) + n = tonumber(n) local cr = cross_references[n] or 0 cross_references[n] = nil return cr end -local function resolve(n,m) +local function resolve(n,m) -- we can now check the 'line' flag (todo) while n do local id = n.id - if id == whatsit then + if id == whatsit then -- why whatsit local a = has_attribute(n,line_reference) if a then cross_references[a] = m @@ -62,6 +63,33 @@ local function resolve(n,m) end end +function nodes.lines.finalize(t) + local getnumber = nodes.lines.number + for _,p in next, t do + for _,r in next, p do + if r.metadata.kind == "line" then + local e = r.entries + e.linenumber = getnumber(e.text or 0) + end + end + end +end + +local filters = jobreferences.filters +local helpers = structure.helpers + +jobreferences.registerfinalizer(nodes.lines.finalize) + +filters.line = filters.line or { } + +function filters.line.default(data) + helpers.title(data.entries.linenumber or "?",data.metadata) +end + +function filters.line.page(data,prefixspec,pagespec) -- redundant + helpers.prefixpage(data,prefixspec,pagespec) +end + -- boxed variant nodes.lines.boxed = { } |