You can try vim module. It supports all the formats that vim is able to support and it is a builtin module. \usemodule[t-vim] \definevimtyping [TEX] [syntax=context] \definevimtyping [XML] [syntax=xml] \definevimtyping [LUA] [syntax=lua] \starttext \startTEXpage[offset=2em] a \TEX\ inline comment: \inlineTEX{ag%befe} \Lua\ inline comment: \inlineLUA{agb --efe} \startTEX This is text. % a comment, not \comment \stopTEX \startXML <p>This is text.<!--and this is a comment--></p> \stopXML \startLUA if code=="code" then --this is a comment \stopLUA \stopTEXpage \stoptext
On 22 Dec 2017, at 4:16 AM, Pablo Rodriguez
wrote: On 12/21/2017 05:04 PM, Christoph Reller wrote:
Dear Pablo,
At least for XML you could use my module highlight-xml:
\usemodule[highlight-xml] \definetype[xml][option=xml] [...] Note that even partial XML is highlighted correctly. Dear Christoph,
many thanks for your reply.
Your module is really great fine. It supports both \setuptype and \setuptyping options.
It is really a pity that it lacks TeX, since I’m focused on ConTeXt yet (after all, it would be a Spanish introduction to ConTeXt ;-)). XML will come later.
I’m afraid that XML comments are colored the same way with your module and with standard ConTeXt.
Comment marks in are colored as standard tags, I’m afraid. I mean, "<!--" and "-->" are colored in blue as "<p>".
To show a comment as a whole, setting up both comment text and marks in a single and unique color is required.
This is why I thought that SnippetCommentMark and SnippetCommentText would be a fine way to typeset full comments.
Sorry for insisting. It isn’t perfectionism. My friends and family members aren’t computer scientists. I have to explain what a comment is from the very beginning. If colors are misleading, they are lost.
This is why I have to solve this before resuming text composition.
It would be great that you also offered a highlight-tex (with SnippetCommentText and SnippetCommentMark). Or to ease the module loading, it would be useful to have a context-highlight (or similar name).
If your implementation could be latter added (if Hans agrees) to the ConTeXt core.
Many thanks for your help,
Pablo -- http://www.ousia.tk ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________