IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New You're being too lazy
Let me outline how to do it in such a way that you'll find most of your work already done for you.

Install gvim. Write a small utility to save the current file to a filename with an extension indicating the current filetype. (.html, .pl, .c, etc) Then run the following shell command:
\ngvim -f +"syn on" +"run\\! syntax/2html.vim" +"wq" +"q" $filename\n

Now read back $filename.html. Post-process that slightly if you want.

(You may not need to escape ! depending on how you execute this - in bash I need it.)

This will work somewhat better if gvim has access to X. (According to the documentation it does a better job of picking colors, whatever that means.)

Voila!

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Au contraire
I'm more interested in the system being self-contained. With such a constraint, implementing this suggestion entails quite a bit more work than "shell out to gvim"...
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New You can still leverage the effort though...
Many editors have syntax highlighting files.

If you write a parser that parses some editor's syntax highlighting files and then displays based on that, then you at least don't have to write your own syntax files - you just need the parsing and the display code.

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New "just"...
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New Compared to what you save...
the effort that you'd have to expend is the merest trifle. :-P

Cheers,
Ben
I have come to believe that idealism without discipline is a quick road to disaster, while discipline without idealism is pointless. -- Aaron Ward (my brother)
New Compared to doing nothing and laughing at Peter...
It's a lot of work, and not nearly as satisfying...
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     Comparing Big Lists in Perl - (pwhysall) - (21)
         I'd probably do something like this - (broomberg) - (20)
             Thanks - (pwhysall) - (14)
                 ROFL - (admin) - (12)
                     Why rofl? - (pwhysall) - (11)
                         That's not the issue. - (admin) - (10)
                             All of them. You. - (pwhysall) - (3)
                                 So, you want EMACS in *Z*? -NT - (folkert) - (2)
                                     *I* can't think of a single *valid* objection. -NT - (pwhysall)
                                     No, gvim - (broomberg)
                             You're being too lazy - (ben_tilly) - (5)
                                 Au contraire - (admin) - (4)
                                     You can still leverage the effort though... - (ben_tilly) - (3)
                                         "just"... -NT - (admin) - (2)
                                             Compared to what you save... - (ben_tilly) - (1)
                                                 Compared to doing nothing and laughing at Peter... - (admin)
                 Don't forget the pretty print feature as well... - (ChrisR)
             Here's the whole (working, ugly) program - (pwhysall) - (4)
                 Suggestion - (broomberg) - (2)
                     Thanks. - (pwhysall) - (1)
                         My pleasure - (broomberg)
                 sig_array global bad. - (broomberg)

Due to a vast miscalculation, it was accidentally swallowed by a small dog.
123 ms