Hi, A while ago Hans provided an example of typesetting a document from a docbook source. I'm attaching an over-simplified version of the initial module (a somewhat more complete version exists, but it still needs lots of work) and a minimum working example with XML. I'm not sure how to extend the xml parser to support typesetting from something like this:
Hello World in C and ConTeXt #include <stdio.h> int main() { printf("Hello, World!\n"); return 0; } \starttext Hello world! \stoptext
Maybe using the vim module would be the right approach here (since the built-in parser only has support for a limited set of languages), but I'm not exactly sure about the implementation to achieve that goal. I started with \startxmlsetups xml:programlisting \dontleavehmode \startframedtext[background=color,backgroundcolor=lightgray] \obeylines \tt \xmlflush{#1} \stopframedtext \stopxmlsetups but something more is needed to properly handle new lines and to properly pass the text to vim, for example. Any hints welcome. Thank you, Mojca