newLISP-Documentation-Highlight

Provide syntax hightlighting in newLISP documentation

当前为 2014-11-20 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name newLISP-Documentation-Highlight
  3. // @namespace http://lambda.que.jp/
  4. // @version 20141120
  5. // @description Provide syntax hightlighting in newLISP documentation
  6. // @grant GM_addStyle
  7. // @grant GM_getResourceText
  8. // @match http://www.newlisp.org/*/newlisp_manual.html
  9. // @match http://www.newlisp.org/*/CodePatterns.html
  10. // @require http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js
  11. // @require http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/highlight.min.js
  12. // @require http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/languages/lisp.min.js
  13. // @resource default.css http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css
  14. // @resource github.css http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/github.min.css
  15. // @resource zenburn.css http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/zenburn.min.css
  16. // @author KOBAYASHI Shigeru (kosh)
  17. // @license Public domain
  18. // ==/UserScript==
  19.  
  20. GM_addStyle([
  21. GM_getResourceText("zenburn.css"),
  22. "pre code { font-size: 110%; font-family: Consolas, 'Courier New', Courier, Monaco, monospace; }",
  23. "span.arw { color: inherit; }"
  24. ].join("\n"));
  25.  
  26. var code = $("<code/>").addClass("lisp");
  27. $("pre").wrapInner(code);
  28.  
  29. hljs.configure({languages:["lisp", "c", "bash"]});
  30. hljs.initHighlighting();