This is one of the reasons I stick with Firefox.
- Copy the contents of the cpan_shjs.js javascript file.
- Open a CPAN source code page, like this one.
- Paste the javascript code in the location bar of your browser. Hit intro.
- Voilà.
- Try clicking on package names to navigate the CPAN.
You’ll have to run the bookmarklet everytime a source page is opened.
So, if you like what you see, create a new bookmark and paste the code in the URL field. Than it’s going to be as easy as pushing a button to highlight a CPAN source.
This script is quite fast because it uses the lightweight SHJS project .
Although it has no line numbering out of the box, it’s doable.
You can theme it easily checking out this themes available here:
http://shjs.sourceforge.net/css/
This one uses SyntaxHighlighter. It’s quite lush, but a little too busy for my taste buds. No package linking implemented, which requires developing a trigger of some sort.
Developed and tested on Firefox 3.5. I have no idea if the rest of the browsing world support bookmarklets well. Try it then let me know if it works.
The hightlighting scripts are hosted on their authors pages. I recommend you change it to a local repository, maybe even your harddisk. Both for performance reasons and to avoid 404 errors on repository changes.
rodrigolive (Rodrigo de Oliveira)
Blah blah blah.