Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread Taco Hoekwater
Hi, > it actually depends on what you do ... anyway here is some insight (as > xml-tex old-timer you'll probably recognize the madness) What I am mostly trying to do is to have as much of the xml processing in lua as possible. > > % \enabletrackers[context*] > > \starttext > > % here is

Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread mf
My 2 cents: local xmlflush = lxml.flush local function text_or_xml(...) for i,v in ipairs(arg) do if "table" == type(v) then xmlflush(v) else context(v) end end end function xml.functions.heading(t) text_or_xml( "\\section{" , t , "}" ) end Massimiliano Il giorno

Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread Hans Hagen
On 9/19/2018 2:50 PM, Taco Hoekwater wrote: Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’

[NTG-context] xml in lua advice ?

2018-09-19 Thread Taco Hoekwater
Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’ could have embedded xml tags that should be