node-ext.lua /size: 835 b    last modification: 2020-07-01 14:35
1if not modules then modules = { } end modules ['node-ext'] = {
2    version   = 1.001,
3    comment   = "companion to node-ini.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--[[ldx--
10<p>Serializing nodes can be handy for tracing. Also, saving and
11loading node lists can come in handy as soon we are going to
12use external applications to process node lists.</p>
13--ldx]]--
14
15function nodes.show(stack)
16--  logs.writer(table.serialize(stack))
17end
18
19function nodes.save(stack,name) -- *.ltn : luatex node file
20--  if name then
21--      file.savedata(name,table.serialize(stack))
22--  else
23--      logs.writer(table.serialize(stack))
24--  end
25end
26
27function nodes.load(name)
28--  return file.loaddata(name)
29--  -- todo
30end
31