Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: syntax highlighting of code in perlmonks forums

by hbo (Monk)
on Jun 11, 2003 at 07:39 UTC ( [id://264977]=note: print w/replies, xml ) Need Help??


in reply to syntax highlighting of code in perlmonks forums

Parsing Perl well enough to do a good job of syntax highlighting is hard. The ony program I've seen that seems to get it right all the time is perltidy. It's 20,000 lines of Perl, most of which aren't concerned with syntax highlighting. But that gives a sense of the scale of the problem.

So, let's say you had a special tag, <perl_code> has been suggested here, that would run the tag contents through perltidy --html. The highlighting is implemented with a CSS stylesheet, which could be incorporated into the standard site CSS. To turn off the highlighting, or to implement your own style, just add a custom stylesheet.

Of course, it would still be a significant load on the server(s).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found