Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I like the idea, and even think it'd be good if this were enabled by default. Just not with the colours that you propose; they burn holes in my screen :)

Not everything in code-blocks is Perl source, but I see no harm in trying to render it as such. After all, only colour changes, not the text itself. Does it matter if some non-code is coloured differently?

Perhaps the Monastery could add <span> tags automatically so that people who want colours can put some colour definitions in their personal CSS. That wouldn't change anything for users that think colours are "gay".

One problem could be server load, but I don't know how well Everything caches, so I can't say much about that. I do know that on my box, Syntax::Highlight::Perl performs better than Perl::Tidy. It isn't as good, though, but I can live with the results. My Scribble service uses S::H::P, and I copied your code so you can have a look at how S::H::P does it: http://tnx.nl/scribble/765WQMX (link dies in 30 days). Colours are not hard coded, but in an external CSS file. Disable CSS and the colours are gone. Ideal, IMO.

Horrible code, by the way...

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }


In reply to Re: syntax highlighting of code in perlmonks forums by Juerd
in thread syntax highlighting of code in perlmonks forums by aquarium

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-29 10:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found