I had really wanted to use the Kate syntax stuff, because it's pure Perl, but after I had it working, I decided that its Perl syntax highlighting wasn't good enough, and I wanted Vim's. So, I did what I had wanted to avoid and used Text::VimColor. I worked out some bugs, learned a lot about RTF, and added nice little things like proper option parsing.
I put it on my hacks page, along with a sample output file. Reading the RTF::Writer source with a clearer head made the problem I'd had with dashes clear. (It also makes me think that RTF::Writer needs to stop doing what it's doing.)
There's just one big thing bugging me, now. I can't find a way to change the background color of the document, which I think will have to be done with a default stylesheet or something. I'd create a file with a black background to inspect its contents, but I don't even see how to do that in TextEdit.
With a white background, the margins are white, and extra whitespace at the end of the file is white. I really want to be able to set the default background, to address this problem correctly.
Next up, I may attempt to write a very crude Vim colorscheme parser. With that done, it just becomes a matter of automating the highlighting of text in a Keynote text box.
Re:Syntax::Highlight::Universal
rjbs on 2007-09-05T15:54:34
I don't get it. How can CSS help me produce color RTF?Re:Syntax::Highlight::Universal
mpeters on 2007-09-05T16:01:55
Well, I feel silly. For some reason I thought you were doing syntax hilighting into HTML and then converting to RTF. But you're using RTF::Writer, duh. Sorry for the noise...Re:Syntax::Highlight::Universal
rjbs on 2007-09-05T16:34:52
No problem. If nothing else, now I know I can look at one more highlighting engine eventually! Thanks.
Re:Kate, Vim, tidy?
rjbs on 2007-12-10T19:05:57
I haven't tried it, but I'm guessing it will be -- only because it will be exactly what I'm used to seeing in my editor.
I'll try to check it out.Re:Kate, Vim, tidy?
n1vux on 2007-12-18T19:48:35
PerlTidy is adjustable.The Perl Advent Calendar uses perltidy -nnn -html -css=../style.css [* *] so the CSS file sets the colors.
You could edit that file to get the VIM look with PerlTidy. PerlTidy can also adapt its indenting etc. to suit most standards. E.g., I think PBP has Tidy definition of it's recommended format. Spod5 is a perl-based pod-to-S5 slide systm that can filter code through perltidy.