From mojca.miklavec.lists@gmail.com Thu Sep 8 17:51:48 2005 From: Mojca Miklavec To: dev-context@ntg.nl Subject: [dev-context] Re: some highlighted \type-ing Date: Thu, 08 Sep 2005 17:51:16 +0200 Message-ID: <43205DF4.3090003@gmail.com> In-Reply-To: <43200AA3.1010908@elvenkind.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5411979821195387567==" --===============5411979821195387567== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Taco Hoekwater wrote: > This makes comments behave like PI instructions, but maybe > you want the entire comment grey, including the leading > '' ? > That would be require a much larger patch though. > ... Taco, thank you for the patch. But I figured out that those pieces of code are not human-readable=20 (human-modifiable) and it's stupid to ask for help for every single=20 character that one would like to change. I played a bit, just removed 80% of the stuff from 2html.vim (another=20 15% still waiting to be removed, I just wanted to try to test the code)=20 and changed three lines or so to produce ConTeXt-friendly output. (http://pub.mojca.org/tex/vim/syntax/, you have to move 2context.vim to=20 syntax folder and say :runtime! syntax/2context.vim) To test it I opened a simple file: My testfile: which resulted in: \HiSyntax[Identifier]{<}\HiSyntax[Statement]{html}\HiSyntax[Identifier]{>} \HiSyntax[Identifier]{<}\HiSyntax[Statement]{body}\HiSyntax[Identifier]{>} \HiSyntax[]{ My testfile:=20 }\HiSyntax[Identifier]{<}\HiSyntax[Statement]{img}\HiSyntax[Identifier]{=20 }\HiSyntax[Type]{src}\HiSyntax[Identifier]{=3D}\HiSyntax[String]{"something.a= bc"}\HiSyntax[Identifier]{>} \HiSyntax[Identifier]{} \HiSyntax[Identifier]{} (sorry, slighlty unreadable, but the file is on the above mentioned link=20 as well) Now two questions: 1. How should the output syntax look like and which exceptions should be=20 considered? It's pretty trivial to replace braces with \} or \rightbrace or=20 whatever, tabs by spaces (if requested), ... but I don't know at which=20 level it is better to do that (to replace characters within the script=20 or to change charcodes as in verbatim ...) Input text can probably be=20 just everything that comes to someone's mind. 2. (I don't need the answer yet since I have to play a bit with the=20 script first, I'll ask later once more.) How can I call vim, execute a=20 couple of commands there and somehow "return" the ConTeXt code back? % lots of settings ... \definetyping[HTML][option=3DHTML] \setuptyping[mode=3Dvim] % or engine=3Dvim or ? % option would be passed on to vim with ":set syntax=3D\c!option" \startHTML abc \stopHTML Thank you, Mojca --===============5411979821195387567==--