summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/page-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2020-01-26 19:35:43 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2020-01-26 19:35:43 +0100
commit43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca (patch)
tree9b339c63cd28528e5062fe980e964808df619374 /tex/context/base/mkiv/page-ini.lua
parent5189b2143a30a39cd3533569cbef3f06422cc1d9 (diff)
downloadcontext-43fc66771a0c9d27cc0b7fe7a69392ea313bd0ca.tar.gz
2020-01-26 18:37:00
Diffstat (limited to 'tex/context/base/mkiv/page-ini.lua')
-rw-r--r--tex/context/base/mkiv/page-ini.lua32
1 files changed, 27 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua
index 3d5534128..17f4c44da 100644
--- a/tex/context/base/mkiv/page-ini.lua
+++ b/tex/context/base/mkiv/page-ini.lua
@@ -16,6 +16,8 @@ local texgetcount = tex.getcount
local context = context
local ctx_doifelse = commands.doifelse
+local implement = interfaces.implement
+
local data = table.setmetatableindex("table")
local last = 0
local pages = structures.pages
@@ -177,19 +179,19 @@ luatex.registerpageactions(function()
end
end)
-interfaces.implement {
+implement {
name = "markpage",
arguments = "2 strings",
actions = pages.mark
}
-interfaces.implement {
+implement {
name = "doifelsemarkedpage",
arguments = "string",
actions = { marked, ctx_doifelse }
}
-interfaces.implement {
+implement {
name = "markedpages",
arguments = "string",
actions = function(name)
@@ -200,7 +202,7 @@ interfaces.implement {
end
}
-interfaces.implement {
+implement {
name = "startmarkpages",
arguments = "string",
actions = function(name)
@@ -208,7 +210,7 @@ interfaces.implement {
end
}
-interfaces.implement {
+implement {
name = "stopmarkpages",
arguments = "string",
actions = function(name)
@@ -217,3 +219,23 @@ interfaces.implement {
end
end
}
+
+local tonut = nodes.tonut
+local nextlist = nodes.nuts.traversers.list
+local texlists = tex.lists
+
+implement {
+ name = "doifelsependingpagecontent",
+ actions = function()
+ local h = texlists.contrib_head
+ -- local t = texlists.contrib_tail
+ local p = false
+ if h then
+ for n in nextlist, tonut(h) do
+ p = true
+ break
+ end
+ end
+ ctx_doifelse(p)
+ end,
+}