newLISP-Documentation-Highlight

Provide syntax hightlighting in newLISP documentation

As of 2014-10-01. See the latest version.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name      newLISP-Documentation-Highlight
// @namespace http://lambda.que.jp/
// @version   20141001
// @description  Provide syntax hightlighting in newLISP documentation
// @grant   GM_addStyle
// @grant   GM_getResourceText
// @match   http://www.newlisp.org/*/newlisp_manual.html
// @match   http://www.newlisp.org/*/CodePatterns.html
// @require http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
// @require http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/highlight.min.js
// @require http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/languages/lisp.min.js
// @resource default.css http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css
// @resource github.css  http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/github.min.css
// @resource zenburn.css http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/zenburn.min.css
// @author KOBAYASHI Shigeru (kosh)
// @license Public domain
// ==/UserScript==

GM_addStyle([
    GM_getResourceText("zenburn.css"),
    "pre code {",
    "  font-size: 110%;",
    "  font-family: Consolas, 'Courier New', Courier, Monaco, monospace;",
    "}",
].join("\n"));

$("pre").each(function(i, block) {
    // wrap <pre></pre> to <pre><code></code></pre>
    var code = $("<code></code>").html($(this).html());
    code.addClass("lisp");
    $(this).html(code);
});

hljs.configure({languages:["lisp", "c", "bash"]});
hljs.initHighlighting();