Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Code Highlighting in the code tag

by spudzeppelin (Pilgrim)
on Aug 10, 2001 at 03:08 UTC ( #103704=note: print w/replies, xml ) Need Help??

in reply to Code Highlighting in the code tag

It sounds like an interesting exercise, but one that wouldn't be particularly nasty: there are already syntax-coloring filters for perl out there (consider that both vim and cooledit have them, and cooledit has the peculiar misfortune of being written in python). It shouldn't require much more than turning the ANSI escape sequences in the syntax-highlighting routines in vim into the corresponding <SPAN> tags in HTML. Getting <SPAN> recognized inside of <CODE> is another matter altogether -- <CODE> is designed to indicate to the browser that as much as possible within the block is to be treated literally.

Spud Zeppelin *

Replies are listed 'Best First'.
Re: Re: Code Highlighting in the code tag
by mischief (Hermit) on Aug 10, 2001 at 12:11 UTC
    Using <code> tags in your post doesn't actually put a <code> tag in the html output when you view it (check the source). One of the reasons I suggested it is because there's already some kind of magick going on with <code> tags, so I figured that it might be as easy as putting in a sub for the code highlighting along with $code = highlight_code($code) if $user_prefs{'wants_highlighting'} in the bit that deals with the code. (Dammit! I've got <code> on the brain now after using it 16 times in this post. :-)
Re: Re: Code Highlighting in the code tag
by Beatnik (Parson) on Aug 10, 2001 at 03:12 UTC
    While we're discussing syntax coloring in editors, Glimmer has syntax coloring since way before it was called Glimmer. But then again, what use is that in the Monastery? Looking into PerlTidy is probably a good thing.

    ... Quidquid perl dictum sit, altum viditur.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://103704]
[corenth]: Good morning (in my neck of the woods)
[Cosmic37]: hello perly kings and queens
[jedikaiti]: 'ello Monks
[Cosmic37]: and monkeys too...
[Cosmic37]: is anyone doing machine learning with Perl?
[Cosmic37]: I was using gneural code in C and it was interesting but did not have back propagation for neural networks
[corenth]: Cosmic, poking at it, but not really.
[Cosmic37]: I read that its possible to use the FANN library with Perl so I might try that now...
[corenth]: i have a question. I used map{ blah();blah(); blah();}@stuff; and it used up a ton of memory vs. the for(@stuff){} equivalent. What gives? (if anyone knows)
[Cosmic37]: FANN also has LGPL license which I like and its supposed to be quite a capable library from what I read

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2018-02-20 18:13 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.