node-pag.lmt /size: 1116 b    last modification: 2024-01-16 10:22
1if not modules then modules = { } end modules ['node-pag'] = {
2    version   = 1.001,
3    comment   = "companion to node-pag.mkiv",
4    author    = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5    copyright = "PRAGMA ADE / ConTeXt Development Team",
6    license   = "see context related readme files"
7}
8
9-- Currently we have no usage for this and it can even be dangerous to mess with
10-- the list at this stage, so this is effectively just a placeholder. Users can
11-- only mess with before and after hooks.
12
13pagebuilders = pagebuilders or { }
14
15local starttiming, stoptiming = statistics.starttiming, statistics.stoptiming
16
17local actions = nodes.tasks.actions("pagebuilders")
18
19local function processor(head,groupcode,size,packtype,maxdepth,direction)
20    if head then
21        starttiming(pagebuilders)
22        head = actions(head,groupcode,size,packtype,maxdepth,direction)
23        stoptiming(pagebuilders)
24    end
25    return head
26end
27
28callbacks.register("pre_output_filter",processor,"preparing output box")
29
30statistics.register("output preparation time", function()
31    return statistics.elapsedseconds(pagebuilders)
32end)
33