Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Code on web in color!

by jeffa (Bishop)
on Nov 15, 2003 at 16:34 UTC ( [id://307323]=note: print w/replies, xml ) Need Help??


in reply to Code on web in color!

Congradulations! You reinvented Perl::Tidy. :)
use strict; use warnings; use Perl::Tidy; use CGI qw(:standard); open FH, '<', '/path/to/perlfile.pl' or die $!; my $content = do {local $/;<FH>}; my $html; perltidy( source => \$content, destination => \$html, argv => '-html -npod -css=/path/to/perltidy.css', errorfile => '/dev/null', ); print header, start_html( -title => 'Colorized Perl', -style => { src => '/URL/to/perltidy.css' }, ), $html, end_html, ;
Here is my perltidy.css file should you want to use it.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Code on web in color!
by mushu (Initiate) on Mar 02, 2004 at 02:07 UTC
    Oh well...I thought it was cool anyway...thanks for pointing that out. At least my code doesn't need the overhead of a library. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://307323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2024-04-18 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found