On Tue, 26 Dec 2017, Pablo Rodriguez wrote:
On 12/21/2017 10:53 PM, Aditya Mahajan wrote:
[...] Can you post a minimal working example. I don't use XML so it is difficult for me to understand how these commands are used in practice.
Aditya,
many thanks for your reply and your help.
A minimal sample would be:
\startbuffer[demo] <doc> <p>b</p> <code><a class="sourceLine" id="cb1-1" data-line-number="1"> <span class="kw"><p></span>a<span class="kw"></p></span> <span class="co"><!--comment--></span></a></code> </doc> \stopbuffer
\startxmlsetups xml:initialize \xmlsetsetup{#1}{doc|p|code}{xml:*} \stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:p \startpar\xmlflush{#1}\stoppar \stopxmlsetups
\startxmlsetups xml:code \xmlprettyprinttext{#1}{xml} \stopxmlsetups
\starttext \xmlprocessbuffer{main}{demo}{} \stoptext
But if this is too tricky to you, maybe it isn’t a good idea to extend the module to XML usage.
There are (at least) two reasons for that:
- I’m the only user who asked for this (too much trouble for a single user).
- Easier alternatives would be to improve the ConTeXt core or the context-highlight module.
It isn't too difficult to support this. See attached file. This will clutter your PWD with temp files. To avoid that, create a subdirectory called "output" and set \setupvimtyping[directory=output] Then all the temp files will be stored in the directory "output".