Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Code highlighting?

by demerphq (Chancellor)
on Oct 06, 2004 at 16:15 UTC ( #397056=note: print w/replies, xml ) Need Help??


in reply to Code highlighting?

Personally i am in favour of something like this. BUT its not so straightforward, and there are legitimate issues such as load, and theme sensitive color schemes that need to be addressed for such an endeavour. Presumably we could use the HTML output form of Perltidy, but Perltidy is a known resource hog.

You should have a look through the PMD archives as this subject comes up fairly regularly and the comments made before will still be relevent now.


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi

    Flux8


Replies are listed 'Best First'.
Re^2: Code highlighting?
by Your Mother (Archbishop) on Oct 06, 2004 at 18:56 UTC
    theme sensitive color schemes that need to be addressed for such an endeavour...

    This can be addressed by doing the coloring in CSS; post processing (using the Syntax::Highlight::Perl keywords for classes):

    <code class="perl"><span class="Directive">print</span> <span class="Quote">"</span><span class="String">Hello world...

    Then everything is still black unless you have a style sheet with code.perl > .Directive { ... } etc. and each style could have its own code styles companion.

    As much as I'd like to see it, it does seem like a big headache, it would mostly only improve readability of longer code, and even using the faster methods available, it would slow things down a bit.

    Oh, and this node, already listed below by cchampion doesn't mention that Perl::Tidy is customizable with its "formatter" arg to perltidy() though it's difficult to use.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2023-01-29 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?