On 2/11/2015 12:15 PM, Andreas Schneider wrote:
Am 10.02.2015 22:45, schrieb Hans Hagen:

\startluacode
    function xml.functions.processJSON(t)
        buffers.assign("foo","\\startJSON\n" .. tostring(xml.text(t))
.. "\n\\stopJSON")
        context.getbuffer { "foo" }
    end
\stopluacode

\startxmlsetups xml:json
    \pushcatcodetable
    \setcatcodetable\ctxcatcodes
    \xmlfunction{#1}{processJSON}
    \popcatcodetable
\stopxmlsetups

(If needed I can make a better plugin for this ... remind me later
this year.)


Thank you very much, Hans!

That works like a charm!
 From my perspective, no changes are necessary. I personally like some
technical trickery in my ConTeXt code, especially if it's as slim as
your solution. (Mainly because that helps me understand the inner
workings and hopefully makes me find solutions like this on my own :-))

so then you have to wikify it (or add it to the t-vim module docu)

So thanks again for that quick and very helpful answer!

Best regards,
Andreas
___________________________________________________________________________________

If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : [email protected] /
http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


--

-----------------------------------------------------------------
                                          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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to