Last active
March 5, 2019 08:03
-
-
Save digital-carver/6401390 to your computer and use it in GitHub Desktop.
A Greasemonkey script to enable syntax highlighting when viewing module sources on CPAN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name CPANSyntaxHighlight | |
| // @namespace abiteasier.in | |
| // @description Enable syntax highlighting when viewing the source on CPAN | |
| // @include http://cpansearch.perl.org/src/* | |
| // @version 0.9 | |
| // @require http://yandex.st/highlightjs/7.3/highlight.min.js | |
| // @resource syntaxHighlightCSS http://yandex.st/highlightjs/7.3/styles/github.min.css | |
| // @grant GM_addStyle | |
| // @grant GM_getResourceText | |
| // ==/UserScript== | |
| var syntax_highlighter_CSS = GM_getResourceText("syntaxHighlightCSS"); | |
| GM_addStyle(syntax_highlighter_CSS); | |
| var p = document.getElementsByTagName('pre')[0]; | |
| p.className += ' language-perl'; | |
| hljs.highlightBlock(p); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installable from http://userscripts.org/scripts/show/176984