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

Re^2: Syntax highlighting for CPAN

by LanX (Saint)
on Mar 24, 2011 at 13:18 UTC ( [id://895245]=note: print w/replies, xml ) Need Help??


in reply to Re: Syntax highlighting for CPAN
in thread Syntax highlighting for CPAN

Thank you, ...

...but do you know why it's necessary to use yet another syntax parser for Perl?

The quality is below perltidy -html (i.e. w/o reformating), e.g. if you look at the bottom of CGI.pm you will see the hash key -values highlighted.³

Thats not much better than the pure JS solution that Corion already proposed for perlmonksı, which could easily be adopted for CPAN and automated using scriptmonkey.

Talking about automation, I couldn't find an option to save highlighting as default (e.g. in cookie).²

Sorry if I may sound overly negative, I really appreciate the effort!

It's just my mentality to ask for insight and discuss other solutions.

Cheers Rolf

1) see Free Nodelet hack: Syntax colouring

2) Hmm the setting is supposed to be stored automatically in a cookie, but I have problems to make this work in my FF.

3) seems like I misinterpreted the mechanism, looks like another pure client-side JS solution for highlighting. My Idea was rather to use perltidy for adding highlight-<span>s on the server side, and to control the CSS settings via JS on the client side. Should be much faster, too.

Replies are listed 'Best First'.
Re^3: Syntax highlighting for CPAN
by DStaal (Chaplain) on Mar 24, 2011 at 15:28 UTC

    As for reasons why to use yet another parser, it might have something to do with wanting to parse code snippets, which may not even be complete valid Perl, and which are embedded in other text.

    Most of the parsers I know tend to assume what you feed to them is supposed to be valid code, and is all supposed to be code.

      Good point, but IMHO perltidy is quite tolerant, I once spoke to a PHP haker who used it (well he had to care about regexing the comment symbols)

      IMHO false positives with keyword based highlighting is so distracting, that it's rapidly switched off.

      But maybe it's just me...

      Cheers Rolf

Re^3: Syntax highlighting for CPAN
by Your Mother (Archbishop) on Mar 24, 2011 at 14:15 UTC
    Talking about automation, I couldn't find an option to save highlighting as default (e.g. in cookie).²

    It did save the highlighting for me; though I notice that /js/jquery-cookie.js is 404ing.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-18 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found