Hi All,
I'm trying to update a ConTeXt module of mine. It does some data gathering during the ConTeXt run, and then processes it after the run is complete. This used to work last year:
local id, err = callback.register('stop_run', new_stop_run_function)
But now err is set to "callback 'stop_run' is frozen (actions performed at the end of a run)".
After trying various approaches for a couple of hours, I'm calling for help. :)
Here's what I ended up with:
\startluacode
print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST1')
local function after_run (head, groupcode)
print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST2')
return head, true
end
nodes.tasks.appendaction('finalizers','after','after_run')
\stopluacode
\starttext
\input knuth
\stoptext
In the output, I see the TEST1 line, but not the TEST2 line.
I have no idea if 'finalizers' is the right parameter, but I didn't see any others that looked like it could be synonymous with 'stop_run'.