Taco Hoekwater wrote:
Mojca Miklavec wrote:
It needs a bit longer definition of \typeTEX. The next def seems to do it.
\def\typeTEX {\bgroup \def\processinlineverbatim##1% {\processingverbatimtrue \localcatcodestrue \def\endofverbatimcommand{\TEXendofcommand##1}% \bgroup \aftergroup\endofverbatimcommand \futurelet\next\doprocessinlineverbatim}% \initializetyping{TEX}% \startverbatimcolor \processinlineverbatim\egroup }
Thank you, this works better (not that I understand what it does ;) But, I finally understand why I was confused yesterday. \setupcolors[state=start] \setuptype[option=TEX] \type{\a} does nothing (and this was what I first tried and thought that this is not supported yet; non-existing options never raise an error anyway). But today I tried: \setuptype[option=TEX] \type{\ab[cd]} % [ and ] are highlighted \type{\a\b\c} % only \b and \c highlighted \type+\ab[cd]{ef} %+ % everything highlighted OK So, if the first (bug/feature?) gets fixed and the bugfix that stops green highlighting after \type is applied, it would be much cleaner to define: \definetype[RAW] [\c!option=RAW] \definetype[MP] [\c!option=MP] ... \definetype[XML] [\c!option=XML] (as counterparts to \definetyping) than keeping those lenghty definitions for each file type separately. Btw: in the meantime (I last tried it in April) a bug that prevented typing |, _ or \ (I don't remember which one exactly) after the first position got fixed. Whenever that happened and whoever did it: thank you very much! Taco, you sent some patch for XML syntax highlighting some time ago. I don't know if you fixed this one as well: <!-- some text --> The both minus signs in "-->" are highlighted wrong as well. The code inside <!-- ... --> is gray, but it would be great to have both delimiters highligted as "comment" as well. I'm thinking about piping the code to vim, letting the vim process it and return something like \highlight[Conditional]{if}\highlight[Delimiter]{(}\highlight[Identifier]{i} ... One should modify the 2html.vim file (vim can already nicely transform the highlighted code into HTML, so ConTeXt shouldn't be so difficult). Vim already has over 400 sytax file definitions (probably equivalent to some hundred thousans lines of syntax definitions in ConTeXt). Well, I don't know (yet) how to do it, but if someone on the list has more experience with vim, please feel free to contribute. Mojca