in reply to Re^5: Feature Request: Adding Colors to Source Code (trivial)
in thread Feature Request: Adding Colors to Source Code
Nodes are not rendered before they are inserted into the database and making that happen even in part is no simple task. (...) So the increased load will not be per node update as you appeared to assume but per node display.
I assumed there was some kind of node cache and didn't think about user settings. When nodes are rendered on request, I can think of many reasons for not syntax colouring code.
(Pseudo code)
I very often provide pseudo code. Even for that, syntax colouring can work very well.
then write an external solution such that clicking "download code" pops up a web page containing highlighted Perl code.
If I'm writing anything, it will be for inline code tags.
Or you could write it as an HTTP proxy and even implement Vautrin's trivial automatic Perl code detector so that only Perl code gets highlighted (and it wouldn't be limited to just PerlMonks).
Hm, I like the proxy idea and will probably give it a try soon.
Since this is such a vital feature, I'm really surprised that you haven't implemented this already. It will just take you a couple of minutes, I'm sure.
It is simple to implement the Perl tools needed for this in a framework that is also Perl. It is, however, not quite as trivial to implement this in something that doesn't support Perl, mostly because the two reasonably good tools available to colour Perl are both written in Perl. Any solution involving the d/l code link would be much easier, but that isn't what I'm interested in. It is extra work when reading the site - I want the *inline* code blocks to be rendered in a pretty readable way.
Should anyone know how to hook something like this into Mozilla, please let me know. I've tried looking for this holy grail but have not yet found it.
Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Feature Request: Adding Colors to Source Code (trivial)
by tye (Sage) on Mar 08, 2004 at 18:15 UTC | |
by Juerd (Abbot) on Mar 08, 2004 at 18:19 UTC |