On 1/9/2013 9:57 PM, Andre Caldas wrote:
Another question...
function userdata.processmystuff(head)
Shall I use this? userdata = userdata or {}
\startbuffer whatever \hbox{you} want \stopbuffer
How do I identify a specific node? Like...
\startbuffer Will this be \boxtobechanged{transparent?} \stopbuffer
Here is a start. I've added the markers code to the beta so that we have an abstract way to deal with such matters. \setupbodyfont[dejavu] \definemarker[mymarker] \definecolor[mymarker:1][r=.6] \definecolor[mymarker:2][g=.6] \definecolor[mymarker:3][r=.6,g=.6] \startluacode local setcolor = nodes.tracers.colors.setlist local getmarker = nodes.markers.get local hlist_code = nodes.codes.hlist local traverse_id = node.traverse_id function userdata.processmystuff(head) for n in traverse_id(hlist_code,head) do local m = getmarker(n,"mymarker") if m then setcolor(n.list,"mymarker:" .. m) end end return head, true end nodes.tasks.appendaction("processors", "after", "userdata.processmystuff") nodes.tasks.disableaction("processors", "userdata.processmystuff") \stopluacode \starttext \startluacode nodes.tasks.enableaction("processors", "userdata.processmystuff") \stopluacode Node lists are processed \hbox \boxmarker{mymarker}{1} {nested from \hbox{inside} out} which is not what you might expect. But, \hbox {coloring} does not \hbox {happen} really nested here, more \hbox {in} \hbox \boxmarker{mymarker}{2} {the} \hbox {order} \hbox {of} \hbox \boxmarker{mymarker}{3} {processing}. \startluacode nodes.tasks.disableaction("processors", "userdata.processmystuff") \stopluacode \stoptext It's somewhat experimental. Up to you to update the wiki. I've added the example to the cld manual. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------