newLISP-Documentation-Highlight

Provide syntax hightlighting in newLISP documentation

当前为 2015-04-28 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name      newLISP-Documentation-Highlight
// @namespace http://lambda.que.jp/
// @version   20141120
// @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
// @match   http://newlisp.nfshost.com/*/newlisp_manual.html
// @match   http://newlisp.nfshost.com/*/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; }",
    "span.arw { color: inherit; }"
].join("\n"));

var code = $("<code/>").addClass("lisp");
$("pre").wrapInner(code);

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