[NTG-context] callback.register

Li Yanrui (李延瑞) liyanrui.m2 at gmail.com
Sat Apr 10 02:50:25 CEST 2010


2010/4/10 Wolfgang Werners-Lucchini <wwl at musensturm.de>:
>> there are two user hooks:
>>
>> tasks.appendaction("processors","before","modules.mine.whatever_a")
>> tasks.appendaction("processors","after","modules.mine.whatever_b")
>> -----------------------------------------
>
> My example looks now
>
> \starttext
> \startluacode
> function MyPreLB(head,gc)
>  texio.write("\n")
>  for n in node.traverse(head) do
>    if node.type(n.id) == "glyph" then
>      texio.write(string.char(n.char))
>    elseif node.type(n.id) == "glue" then
>      texio.write(' ')
>    end
>  end
>  texio.write("\n")
>  return head
> end
> tasks.appendaction("processors","before","MyPreLB")
> \stopluacode
> Dies ist ein Test.
> \stoptext
>
> Is it correct to return 'head'?
>

Maybe 'return head, true', because I found a few functions in the beta
do so. Such as 'scripts.preprocess'.

-- 
Best regards,

Li Yanrui (李延瑞)


More information about the ntg-context mailing list