summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--js/Makefile.am43
-rw-r--r--js/highlight.pack.js3
-rw-r--r--js/jquery.syntax.brush.apache.js41
-rw-r--r--js/jquery.syntax.brush.applescript.js57
-rw-r--r--js/jquery.syntax.brush.assembly.js37
-rw-r--r--js/jquery.syntax.brush.bash-script.js67
-rw-r--r--js/jquery.syntax.brush.bash.js33
-rw-r--r--js/jquery.syntax.brush.basic.js51
-rw-r--r--js/jquery.syntax.brush.clang.js89
-rw-r--r--js/jquery.syntax.brush.csharp.js47
-rw-r--r--js/jquery.syntax.brush.css.js80
-rw-r--r--js/jquery.syntax.brush.diff.js24
-rw-r--r--js/jquery.syntax.brush.go.js47
-rw-r--r--js/jquery.syntax.brush.haskell.js45
-rw-r--r--js/jquery.syntax.brush.html.js66
-rw-r--r--js/jquery.syntax.brush.io.js45
-rw-r--r--js/jquery.syntax.brush.java.js45
-rw-r--r--js/jquery.syntax.brush.javascript.js40
-rw-r--r--js/jquery.syntax.brush.kai.js29
-rw-r--r--js/jquery.syntax.brush.lisp.js34
-rw-r--r--js/jquery.syntax.brush.lua.js44
-rw-r--r--js/jquery.syntax.brush.ocaml.js73
-rw-r--r--js/jquery.syntax.brush.ooc.js46
-rw-r--r--js/jquery.syntax.brush.pascal.js51
-rw-r--r--js/jquery.syntax.brush.perl5.js52
-rw-r--r--js/jquery.syntax.brush.php-script.js48
-rw-r--r--js/jquery.syntax.brush.php.js15
-rw-r--r--js/jquery.syntax.brush.plain.js10
-rw-r--r--js/jquery.syntax.brush.protobuf.js43
-rw-r--r--js/jquery.syntax.brush.python.js44
-rw-r--r--js/jquery.syntax.brush.ruby.js77
-rw-r--r--js/jquery.syntax.brush.scala.js44
-rw-r--r--js/jquery.syntax.brush.smalltalk.js29
-rw-r--r--js/jquery.syntax.brush.sql.js31
-rw-r--r--js/jquery.syntax.brush.super-collider.js57
-rw-r--r--js/jquery.syntax.brush.xml.js50
-rw-r--r--js/jquery.syntax.brush.yaml.js29
-rw-r--r--js/jquery.syntax.core.js1177
-rw-r--r--js/jquery.syntax.js317
-rw-r--r--js/jquery.syntax.layout.editor.js291
-rw-r--r--js/jquery.syntax.layout.fixed.js70
-rw-r--r--js/jquery.syntax.layout.inline.js13
-rw-r--r--js/jquery.syntax.layout.list.js54
-rw-r--r--js/jquery.syntax.layout.plain.js15
-rw-r--r--js/jquery.syntax.layout.table.js58
-rw-r--r--js/jquery.syntax.layout.yelp.js4
-rw-r--r--js/syntax.html194
-rw-r--r--test/syntax/Makefile11
-rw-r--r--test/syntax/code/actionscript24
-rw-r--r--test/syntax/code/apache19
-rw-r--r--test/syntax/code/asciidoc65
-rw-r--r--test/syntax/code/bash30
-rw-r--r--test/syntax/code/clojure18
-rw-r--r--test/syntax/code/cmake19
-rw-r--r--test/syntax/code/cpp15
-rw-r--r--test/syntax/code/cs38
-rw-r--r--test/syntax/code/css25
-rw-r--r--test/syntax/code/d44
-rw-r--r--test/syntax/code/diff30
-rw-r--r--test/syntax/code/django16
-rw-r--r--test/syntax/code/dockerfile48
-rw-r--r--test/syntax/code/dos24
-rw-r--r--test/syntax/code/erb10
-rw-r--r--test/syntax/code/fsharp48
-rw-r--r--test/syntax/code/go34
-rw-r--r--test/syntax/code/haml14
-rw-r--r--test/syntax/code/haskell38
-rw-r--r--test/syntax/code/http6
-rw-r--r--test/syntax/code/ini12
-rw-r--r--test/syntax/code/java35
-rw-r--r--test/syntax/code/javascript37
-rw-r--r--test/syntax/code/json12
-rw-r--r--test/syntax/code/lisp22
-rw-r--r--test/syntax/code/lua32
-rw-r--r--test/syntax/code/makefile13
-rw-r--r--test/syntax/code/markdown22
-rw-r--r--test/syntax/code/matlab45
-rw-r--r--test/syntax/code/nginx47
-rw-r--r--test/syntax/code/objectivec43
-rw-r--r--test/syntax/code/perl41
-rw-r--r--test/syntax/code/php52
-rw-r--r--test/syntax/code/python12
-rw-r--r--test/syntax/code/r68
-rw-r--r--test/syntax/code/ruby28
-rw-r--r--test/syntax/code/rust55
-rw-r--r--test/syntax/code/scala44
-rw-r--r--test/syntax/code/scheme28
-rw-r--r--test/syntax/code/smalltalk39
-rw-r--r--test/syntax/code/tcl26
-rw-r--r--test/syntax/code/tex17
-rw-r--r--test/syntax/code/vala46
-rw-r--r--test/syntax/code/xml24
-rw-r--r--test/syntax/code/xquery20
-rw-r--r--test/syntax/code/yaml39
-rw-r--r--test/syntax/dita.dita614
-rw-r--r--test/syntax/docbook.docbook517
-rw-r--r--test/syntax/mallard.page713
-rw-r--r--xslt/common/color.xsl955
-rw-r--r--xslt/common/html.xsl368
-rw-r--r--xslt/dita/html/dita2html-block.xsl216
-rw-r--r--xslt/dita/html/dita2html-topic.xsl36
-rw-r--r--xslt/dita/html/dita2html.xsl2
-rw-r--r--xslt/docbook/html/db2html-block.xsl218
-rw-r--r--xslt/docbook/html/db2html-division.xsl14
-rw-r--r--xslt/mallard/html/mal2html-block.xsl245
106 files changed, 5028 insertions, 4165 deletions
diff --git a/.gitignore b/.gitignore
index da1d68b0..df78e4b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
ChangeLog
INSTALL
Makefile
+!/test/**/Makefile
Makefile.in
aclocal.m4
autom4te.cache
diff --git a/js/Makefile.am b/js/Makefile.am
index 6fbd4a0d..bc3eef2e 100644
--- a/js/Makefile.am
+++ b/js/Makefile.am
@@ -1,44 +1,7 @@
jsdir = $(datadir)/yelp-xsl/js
-js_DATA = \
- jquery.js \
- jquery.syntax.brush.apache.js \
- jquery.syntax.brush.applescript.js \
- jquery.syntax.brush.assembly.js \
- jquery.syntax.brush.bash-script.js \
- jquery.syntax.brush.bash.js \
- jquery.syntax.brush.basic.js \
- jquery.syntax.brush.clang.js \
- jquery.syntax.brush.csharp.js \
- jquery.syntax.brush.css.js \
- jquery.syntax.brush.diff.js \
- jquery.syntax.brush.go.js \
- jquery.syntax.brush.haskell.js \
- jquery.syntax.brush.html.js \
- jquery.syntax.brush.io.js \
- jquery.syntax.brush.java.js \
- jquery.syntax.brush.javascript.js \
- jquery.syntax.brush.kai.js \
- jquery.syntax.brush.lisp.js \
- jquery.syntax.brush.lua.js \
- jquery.syntax.brush.ocaml.js \
- jquery.syntax.brush.ooc.js \
- jquery.syntax.brush.pascal.js \
- jquery.syntax.brush.perl5.js \
- jquery.syntax.brush.php-script.js \
- jquery.syntax.brush.php.js \
- jquery.syntax.brush.plain.js \
- jquery.syntax.brush.protobuf.js \
- jquery.syntax.brush.python.js \
- jquery.syntax.brush.ruby.js \
- jquery.syntax.brush.scala.js \
- jquery.syntax.brush.smalltalk.js \
- jquery.syntax.brush.sql.js \
- jquery.syntax.brush.super-collider.js \
- jquery.syntax.brush.xml.js \
- jquery.syntax.brush.yaml.js \
- jquery.syntax.core.js \
- jquery.syntax.layout.yelp.js \
- jquery.syntax.js
+js_DATA = \
+ jquery.js \
+ highlight.pack.js
EXTRA_DIST = $(js_DATA)
diff --git a/js/highlight.pack.js b/js/highlight.pack.js
new file mode 100644
index 00000000..fe36d8d0
--- /dev/null
+++ b/js/highlight.pack.js
@@ -0,0 +1,3 @@
+/*! highlight.js v8.9.1 | BSD3 License | git.io/hljslicense */
+!function(e){if("undefined"!=typeof exports)e(exports);else if("undefined"!=typeof window)window.hljs=e({}),"function"==typeof define&&define.amd&&define("hljs",[],function(){return window.hljs});else{if("undefined"==typeof self)throw new Error("No global object found to bind hljs variable to.");self.hljs=e({})}}(function(e){function t(e){return e.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function r(e){return e.nodeName.toLowerCase()}function a(e,t){var r=e&&e.exec(t);return r&&0==r.index}function n(e){return/^(no-?highlight|plain|text)$/i.test(e)}function i(e){var t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",r=/\blang(?:uage)?-([\w-]+)\b/i.exec(i))return y(r[1])?r[1]:"no-highlight";for(i=i.split(/\s+/),t=0,a=i.length;a>t;t++)if(y(i[t])||n(i[t]))return i[t]}function c(e,t){var r,a={};for(r in e)a[r]=e[r];if(t)for(r in t)a[r]=t[r];return a}function s(e){var t=[];return function a(e,n){for(var i=e.firstChild;i;i=i.nextSibling)3==i.nodeType?n+=i.nodeValue.length:1==i.nodeType&&(t.push({event:"start",offset:n,node:i}),n=a(i,n),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:i}));return n}(e,0),t}function o(e,a,n){function i(){return e.length&&a.length?e[0].offset!=a[0].offset?e[0].offset<a[0].offset?e:a:"start"==a[0].event?e:a:e.length?e:a}function c(e){function a(e){return" "+e.nodeName+'="'+t(e.value)+'"'}u+="<"+r(e)+Array.prototype.map.call(e.attributes,a).join("")+">"}function s(e){u+="</"+r(e)+">"}function o(e){("start"==e.event?c:s)(e.node)}for(var l=0,u="",b=[];e.length||a.length;){var d=i();if(u+=t(n.substr(l,d[0].offset-l)),l=d[0].offset,d==e){b.reverse().forEach(s);do o(d.splice(0,1)[0]),d=i();while(d==e&&d.length&&d[0].offset==l);b.reverse().forEach(c)}else"start"==d[0].event?b.push(d[0].node):b.pop(),o(d.splice(0,1)[0])}return u+t(n.substr(l))}function l(e){function t(e){return e&&e.source||e}function r(r,a){return new RegExp(t(r),"m"+(e.cI?"i":"")+(a?"g":""))}function a(n,i){if(!n.compiled){if(n.compiled=!0,n.k=n.k||n.bK,n.k){var s={},o=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");s[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof n.k?o("keyword",n.k):Object.keys(n.k).forEach(function(e){o(e,n.k[e])}),n.k=s}n.lR=r(n.l||/\b\w+\b/,!0),i&&(n.bK&&(n.b="\\b("+n.bK.split(" ").join("|")+")\\b"),n.b||(n.b=/\B|\b/),n.bR=r(n.b),n.e||n.eW||(n.e=/\B|\b/),n.e&&(n.eR=r(n.e)),n.tE=t(n.e)||"",n.eW&&i.tE&&(n.tE+=(n.e?"|":"")+i.tE)),n.i&&(n.iR=r(n.i)),void 0===n.r&&(n.r=1),n.c||(n.c=[]);var l=[];n.c.forEach(function(e){e.v?e.v.forEach(function(t){l.push(c(e,t))}):l.push("self"==e?n:e)}),n.c=l,n.c.forEach(function(e){a(e,n)}),n.starts&&a(n.starts,i);var u=n.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([n.tE,n.i]).map(t).filter(Boolean);n.t=u.length?r(u.join("|"),!0):{exec:function(){return null}}}}a(e)}function u(e,r,n,i){function c(e,t){for(var r=0;r<t.c.length;r++)if(a(t.c[r].bR,e))return t.c[r]}function s(e,t){if(a(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?s(e.parent,t):void 0}function o(e,t){return!n&&a(t.iR,e)}function d(e,t){var r=w.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function p(e,t,r,a){var n=a?"":N.classPrefix,i='<span class="'+n,c=r?"":"</span>";return i+=e+'">',i+t+c}function f(){if(!x.k)return t(A);var e="",r=0;x.lR.lastIndex=0;for(var a=x.lR.exec(A);a;){e+=t(A.substr(r,a.index-r));var n=d(x,a);n?(E+=n[1],e+=p(n[0],t(a[0]))):e+=t(a[0]),r=x.lR.lastIndex,a=x.lR.exec(A)}return e+t(A.substr(r))}function m(){var e="string"==typeof x.sL;if(e&&!v[x.sL])return t(A);var r=e?u(x.sL,A,!0,C[x.sL]):b(A,x.sL.length?x.sL:void 0);return x.r>0&&(E+=r.r),e&&(C[x.sL]=r.top),p(r.language,r.value,!1,!0)}function g(){return void 0!==x.sL?m():f()}function h(e,r){var a=e.cN?p(e.cN,"",!0):"";e.rB?(M+=a,A=""):e.eB?(M+=t(r)+a,A=""):(M+=a,A=r),x=Object.create(e,{parent:{value:x}})}function _(e,r){if(A+=e,void 0===r)return M+=g(),0;var a=c(r,x);if(a)return M+=g(),h(a,r),a.rB?0:r.length;var n=s(x,r);if(n){var i=x;i.rE||i.eE||(A+=r),M+=g();do x.cN&&(M+="</span>"),E+=x.r,x=x.parent;while(x!=n.parent);return i.eE&&(M+=t(r)),A="",n.starts&&h(n.starts,""),i.rE?0:r.length}if(o(r,x))throw new Error('Illegal lexeme "'+r+'" for mode "'+(x.cN||"<unnamed>")+'"');return A+=r,r.length||1}var w=y(e);if(!w)throw new Error('Unknown language: "'+e+'"');l(w);var k,x=i||w,C={},M="";for(k=x;k!=w;k=k.parent)k.cN&&(M=p(k.cN,"",!0)+M);var A="",E=0;try{for(var $,z,L=0;;){if(x.t.lastIndex=L,$=x.t.exec(r),!$)break;z=_(r.substr(L,$.index-L),$[0]),L=$.index+z}for(_(r.substr(L)),k=x;k.parent;k=k.parent)k.cN&&(M+="</span>");return{r:E,value:M,language:e,top:x}}catch(B){if(-1!=B.message.indexOf("Illegal"))return{r:0,value:t(r)};throw B}}function b(e,r){r=r||N.languages||Object.keys(v);var a={r:0,value:t(e)},n=a;return r.forEach(function(t){if(y(t)){var r=u(t,e,!1);r.language=t,r.r>n.r&&(n=r),r.r>a.r&&(n=a,a=r)}}),n.language&&(a.second_best=n),a}function d(e){return N.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,t){return t.replace(/\t/g,N.tabReplace)})),N.useBR&&(e=e.replace(/\n/g,"<br>")),e}function p(e,t,r){var a=t?k[t]:r,n=[e.trim()];return e.match(/\bhljs\b/)||n.push("hljs"),-1===e.indexOf(a)&&n.push(a),n.join(" ").trim()}function f(e){var t=i(e);if(!n(t)){var r;N.useBR?(r=document.createElementNS("http://www.w3.org/1999/xhtml","div"),r.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/<br[ \/]*>/g,"\n")):r=e;var a=r.textContent,c=t?u(t,a,!0):b(a),l=s(r);if(l.length){var f=document.createElementNS("http://www.w3.org/1999/xhtml","div");f.innerHTML=c.value,c.value=o(l,s(f),a)}c.value=d(c.value),e.innerHTML=c.value,e.className=p(e.className,t,c.language),e.result={language:c.language,re:c.r},c.second_best&&(e.second_best={language:c.second_best.language,re:c.second_best.r})}}function m(e){N=c(N,e)}function g(){if(!g.called){g.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,f)}}function h(){addEventListener("DOMContentLoaded",g,!1),addEventListener("load",g,!1)}function _(t,r){var a=v[t]=r(e);a.aliases&&a.aliases.forEach(function(e){k[e]=t})}function w(){return Object.keys(v)}function y(e){return e=(e||"").toLowerCase(),v[e]||v[k[e]]}var N={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},v={},k={};return e.highlight=u,e.highlightAuto=b,e.fixMarkup=d,e.highlightBlock=f,e.configure=m,e.initHighlighting=g,e.initHighlightingOnLoad=h,e.registerLanguage=_,e.listLanguages=w,e.getLanguage=y,e.inherit=c,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(t,r,a){var n=e.inherit({cN:"comment",b:t,e:r,c:[]},a||{});return n.c.push(e.PWM),n.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),n},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.registerLanguage("actionscript",function(e){var t="[a-zA-Z_$][a-zA-Z0-9_$]*",r="([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)",a={cN:"rest_arg",b:"[.]{3}",e:t,r:10};return{aliases:["as"],k:{keyword:"as break case catch class const continue default delete do dynamic each else extends final finally for function get if implements import in include instanceof interface internal is namespace native new override package private protected public return set static super switch this throw try typeof use var void while with",literal:"true false null undefined"},c:[e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{cN:"class",bK:"package",e:"{",c:[e.TM]},{cN:"class",bK:"class interface",e:"{",eE:!0,c:[{bK:"extends implements"},e.TM]},{cN:"meta",bK:"import include",e:";"},{cN:"function",bK:"function",e:"[{;]",eE:!0,i:"\\S",c:[e.TM,{cN:"params",b:"\\(",e:"\\)",c:[e.ASM,e.QSM,e.CLCM,e.CBCM,a]},{b:":\\s*"+r}]}],i:/#/}}),e.registerLanguage("apache",function(e){var t={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:"</?",e:">"},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",t]},t,e.QSM]}}],i:/\S/}}),e.registerLanguage("xml",function(e){var t="[A-Za-z0-9\\._:-]+",r={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php"},a={eW:!0,i:/</,r:0,c:[r,{cN:"attr",b:t,r:0},{b:"=",r:0,c:[{cN:"string",c:[r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/[^\s\/>]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"meta",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},e.C("<!--","-->",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{name:"style"},c:[a],starts:{e:"</style>",rE:!0,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{name:"script"},c:[a],starts:{e:"</script>",rE:!0,sL:["actionscript","javascript","handlebars"]}},r,{cN:"meta",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"name",b:/[^ \/><\n\t]+/,r:0},a]}]}}),e.registerLanguage("asciidoc",function(e){return{aliases:["adoc"],c:[e.C("^/{4,}\\n","\\n/{4,}$",{r:10}),e.C("^//","$",{r:0}),{cN:"title",b:"^\\.\\w.*$"},{b:"^[=\\*]{4,}\\n",e:"\\n^[=\\*]{4,}$",r:10},{cN:"section",r:10,v:[{b:"^(={1,5}) .+?( \\1)?$"},{b:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{cN:"meta",b:"^:.+?:",e:"\\s",eE:!0,r:10},{cN:"meta",b:"^\\[.+?\\]$",r:0},{cN:"quote",b:"^_{4,}\\n",e:"\\n_{4,}$",r:10},{cN:"code",b:"^[\\-\\.]{4,}\\n",e:"\\n[\\-\\.]{4,}$",r:10},{b:"^\\+{4,}\\n",e:"\\n\\+{4,}$",c:[{b:"<",e:">",sL:"xml",r:0}],r:10},{cN:"bullet",b:"^(\\*+|\\-+|\\.+|[^\\n]+?::)\\s+"},{cN:"symbol",b:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",r:10},{cN:"strong",b:"\\B\\*(?![\\*\\s])",e:"(\\n{2}|\\*)",c:[{b:"\\\\*\\w",r:0}]},{cN:"emphasis",b:"\\B'(?!['\\s])",e:"(\\n{2}|')",c:[{b:"\\\\'\\w",r:0}],r:0},{cN:"emphasis",b:"_(?![_\\s])",e:"(\\n{2}|_)",r:0},{cN:"string",v:[{b:"``.+?''"},{b:"`.+?'"}]},{cN:"code",b:"(`.+?`|\\+.+?\\+)",r:0},{cN:"code",b:"^[ \\t]",e:"$",r:0},{b:"^'{3,}[ \\t]*$",r:10},{b:"(link:)?(http|https|ftp|file|irc|image:?):\\S+\\[.*?\\]",rB:!0,c:[{b:"(link|image:?):",r:0},{cN:"link",b:"\\w",e:"[^\\[]+",r:0},{cN:"string",b:"\\[",e:"\\]",eB:!0,eE:!0,r:0}],r:10}]}}),e.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,r,a,t]}}),e.registerLanguage("clojure",function(e){var t={built_in:"def defonce cond apply if-not if-let if not not= = < > <= >= == + / * - rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit defmacro defn defn- macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy defstruct first rest cons defprotocol cast coll deftype defrecord last butlast sigs reify second ffirst fnext nfirst nnext defmulti defmethod meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"},r="a-zA-Z_\\-!.?+*=<>&#'",a="["+r+"]["+r+"0-9/;:]*",n="[-+]?\\d+(\\.\\d+)?",i={b:a,r:0},c={cN:"number",b:n,r:0},s=e.inherit(e.QSM,{i:null}),o=e.C(";","$",{r:0}),l={cN:"literal",b:/\b(true|false|nil)\b/},u={b:"[\\[\\{]",e:"[\\]\\}]"},b={cN:"comment",b:"\\^"+a},d=e.C("\\^\\{","\\}"),p={cN:"symbol",b:"[:]"+a},f={b:"\\(",e:"\\)"},m={eW:!0,r:0},g={k:t,l:a,cN:"name",b:a,starts:m},h=[f,s,b,d,o,p,u,c,l,i];return f.c=[e.C("comment",""),g,m],m.c=h,u.c=h,{aliases:["clj"],i:/\S/,c:[f,s,b,d,o,p,u,c,l]}}),e.registerLanguage("cmake",function(e){return{aliases:["cmake.in"],cI:!0,k:{keyword:"add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_subdirectory add_test aux_source_directory break build_command cmake_minimum_required cmake_policy configure_file create_test_sourcelist define_property else elseif enable_language enable_testing endforeach endfunction endif endmacro endwhile execute_process export find_file find_library find_package find_path find_program fltk_wrap_ui foreach function get_cmake_property get_directory_property get_filename_component get_property get_source_file_property get_target_property get_test_property if include include_directories include_external_msproject include_regular_expression install link_directories load_cache load_command macro mark_as_advanced message option output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return separate_arguments set set_directory_properties set_property set_source_files_properties set_target_properties set_tests_properties site_name source_group string target_link_libraries try_compile try_run unset variable_watch while build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or equal less greater strless strgreater strequal matches"},c:[{cN:"variable",b:"\\${",e:"}"},e.HCM,e.QSM,e.NM]}}),e.registerLanguage("cpp",function(e){var t={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[e.inherit(e.QSM,{b:'((u8?|U)|L)?"'}),{b:'(u8?|U)?R"',e:'"',c:[e.BE]},{b:"'\\\\?.",e:"'",i:"."}]},a={cN:"number",v:[{b:"\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)"},{b:e.CNR}],r:0},n={cN:"meta",b:"#",e:"$",k:"if else elif endif define undef warning error line pragma ifdef ifndef",c:[{b:/\\\n/,r:0},{bK:"include",e:"$",c:[r,{cN:"string",b:"<",e:">",i:"\\n"}]},r,a,e.CLCM,e.CBCM]},i=e.IR+"\\s*\\(",c={keyword:"int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf",literal:"true false nullptr NULL"};return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"</",c:[t,e.CLCM,e.CBCM,a,r,n,{b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:c,c:["self",t]},{b:e.IR+"::",k:c},{bK:"new throw return else",r:0},{cN:"function",b:"("+e.IR+"[\\*&\\s]+)+"+i,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:i,rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[e.CLCM,e.CBCM,r,a]},e.CLCM,e.CBCM,n]}]}}),e.registerLanguage("cs",function(e){var t="abstract as base bool break byte case catch char checked const continue decimal dynamic default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long null when object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",r=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:t,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:"<!--|-->"},{b:"</?",e:">"}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+r+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}}),e.registerLanguage("css",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",r={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"']+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:t,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,r]}]}}),e.registerLanguage("d",function(e){var t={keyword:"abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",built_in:"bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",literal:"false null true"},r="(0|[1-9][\\d_]*)",a="(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)",n="0[bB][01_]+",i="([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)",c="0[xX]"+i,s="([eE][+-]?"+a+")",o="("+a+"(\\.\\d*|"+s+")|\\d+\\."+a+a+"|\\."+r+s+"?)",l="(0[xX]("+i+"\\."+i+"|\\.?"+i+")[pP][+-]?"+a+")",u="("+r+"|"+n+"|"+c+")",b="("+l+"|"+o+")",d="\\\\(['\"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};",p={cN:"number",b:"\\b"+u+"(L|u|U|Lu|LU|uL|UL)?",r:0},f={cN:"number",b:"\\b("+b+"([fF]|L|i|[fF]i|Li)?|"+u+"(i|[fF]i|Li))",r:0},m={cN:"string",b:"'("+d+"|.)",e:"'",i:"."},g={b:d,r:0},h={cN:"string",b:'"',c:[g],e:'"[cwd]?'},_={cN:"string",b:'[rq]"',e:'"[cwd]?',r:5},w={cN:"string",b:"`",e:"`[cwd]?"},y={cN:"string",b:'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',r:10},N={cN:"string",b:'q"\\{',e:'\\}"'},v={cN:"meta",b:"^#!",e:"$",r:5},k={cN:"meta",b:"#(line)",e:"$",r:5},x={cN:"keyword",b:"@[a-zA-Z_][a-zA-Z_\\d]*"},C=e.C("\\/\\+","\\+\\/",{c:["self"],r:10});return{l:e.UIR,k:t,c:[e.CLCM,e.CBCM,C,y,h,_,w,N,f,p,m,v,k,x]}}),e.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}}),e.registerLanguage("django",function(e){var t={b:/\|[A-Za-z]+:?/,k:"truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone",c:[e.QSM,e.ASM]};return{aliases:["jinja"],cI:!0,sL:"xml",c:[e.C(/\{%\s*comment\s*%}/,/\{%\s*endcomment\s*%}/),e.C(/\{#/,/#}/),{cN:"template-tag",b:/\{%/,e:/%}/,c:[{cN:"name",b:/\w+/,k:"comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim",starts:{eW:!0,k:"in by as",c:[t],r:0}}]},{cN:"template-variable",b:/\{\{/,e:/}}/,c:[t]}]}}),e.registerLanguage("dockerfile",function(e){return{aliases:["docker"],cI:!0,k:"from maintainer cmd expose add copy entrypoint volume user workdir onbuild run env label",c:[e.HCM,{k:"run cmd entrypoint volume add copy workdir onbuild label",b:/^ *(onbuild +)?(run|cmd|entrypoint|volume|add|copy|workdir|label) +/,starts:{e:/[^\\]\n/,sL:"bash"}},{k:"from maintainer expose env user onbuild",b:/^ *(onbuild +)?(from|maintainer|expose|env|user|onbuild) +/,e:/[^\\]\n/,c:[e.ASM,e.QSM,e.NM,e.HCM]}]}}),e.registerLanguage("dos",function(e){var t=e.C(/@?rem\b/,/$/,{r:10}),r={cN:"symbol",b:"^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",r:0};return{aliases:["bat","cmd"],cI:!0,i:/\/\*/,k:{keyword:"if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq",built_in:"prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux shift cd dir echo setlocal endlocal set pause copy append assoc at attrib break cacls cd chcp chdir chkdsk chkntfs cls cmd color comp compact convert date dir diskcomp diskcopy doskey erase fs find findstr format ftype graftabl help keyb label md mkdir mode more move path pause print popd pushd promt rd recover rem rename replace restore rmdir shiftsort start subst time title tree type ver verify vol ping net ipconfig taskkill xcopy ren del"},c:[{cN:"variable",b:/%%[^ ]|%[^ ]+?%|![^ ]+?!/},{cN:"function",b:r.b,e:"goto:eof",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),t]},{cN:"number",b:"\\b\\d+",r:0},t]}}),e.registerLanguage("ruby",function(e){var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",a={cN:"doctag",b:"@[A-Za-z]+"},n={b:"#<",e:">"},i=[e.C("#","$",{c:[a]}),e.C("^\\=begin","^\\=end",{c:[a],r:10}),e.C("^__END__","\\n$")],c={cN:"subst",b:"#\\{",e:"}",k:r},s={cN:"string",c:[e.BE,c],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},o={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},l=[s,n,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(i)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:t}),o].concat(i)},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[s,{b:t}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[n,{cN:"regexp",c:[e.BE,c],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(i),r:0}].concat(i);c.c=l,o.c=l;var u="[>?]>",b="[\\w#]+\\(\\w+\\):\\d+:\\d+>",d="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",p=[{b:/^\s*=>/,starts:{e:"$",c:l}},{cN:"meta",b:"^("+u+"|"+b+"|"+d+")",starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:i.concat(p).concat(l)}}),e.registerLanguage("erb",function(e){return{sL:"xml",c:[e.C("<%#","%>"),{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0}]}}),e.registerLanguage("fsharp",function(e){var t={b:"<",e:">",c:[e.inherit(e.TM,{b:/'[a-zA-Z0-9_]+/})]};return{aliases:["fs"],k:"abstract and as assert base begin class default delegate do done downcast downto elif else end exception extern false finally for fun function global if in inherit inline interface internal lazy let match member module mutable namespace new null of open or override private public rec return sig static struct then to true try type upcast use val void when while with yield",i:/\/\*/,c:[{cN:"keyword",b:/\b(yield|return|let|do)!/},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},{cN:"string",b:'"""',e:'"""'},e.C("\\(\\*","\\*\\)"),{cN:"class",bK:"type",e:"\\(|=|$",eE:!0,c:[e.UTM,t]},{cN:"meta",b:"\\[<",e:">\\]",r:10},{cN:"symbol",b:"\\B('[A-Za-z])\\b",c:[e.BE]},e.CLCM,e.inherit(e.QSM,{i:null}),e.CNM]}}),e.registerLanguage("go",function(e){var t={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{aliases:["golang"],k:t,i:"</",c:[e.CLCM,e.CBCM,e.QSM,{cN:"string",b:"'",e:"[^\\\\]'"},{cN:"string",b:"`",e:"`"},{cN:"number",b:e.CNR+"[dflsi]?",r:0},e.CNM]}}),e.registerLanguage("haml",function(e){return{cI:!0,c:[{cN:"meta",b:"^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",r:10},e.C("^\\s*(!=#|=#|-#|/).*$",!1,{r:0}),{b:"^\\s*(-|=|!=)(?!#)",starts:{e:"\\n",sL:"ruby"}},{cN:"tag",b:"^\\s*%",c:[{cN:"selector-tag",b:"\\w+"},{cN:"selector-id",b:"#[\\w-]+"},{cN:"selector-class",b:"\\.[\\w-]+"},{b:"{\\s*",e:"\\s*}",c:[{b:":\\w+\\s*=>",e:",\\s+",rB:!0,eW:!0,c:[{cN:"attr",b:":\\w+"},e.ASM,e.QSM,{b:"\\w+",r:0}]}]},{b:"\\(\\s*",e:"\\s*\\)",eE:!0,c:[{b:"\\w+\\s*=",e:"\\s+",rB:!0,eW:!0,c:[{cN:"attr",b:"\\w+",r:0},e.ASM,e.QSM,{b:"\\w+",r:0}]}]}]},{b:"^\\s*[=~]\\s*"},{b:"#{",starts:{e:"}",sL:"ruby"}}]}}),e.registerLanguage("haskell",function(e){var t={v:[e.C("--","$"),e.C("{-","-}",{c:["self"]})]},r={cN:"meta",b:"{-#",e:"#-}"},a={cN:"meta",b:"^#",e:"$"},n={cN:"type",b:"\\b[A-Z][\\w']*",r:0},i={b:"\\(",e:"\\)",i:'"',c:[r,a,{cN:"type",b:"\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"},e.inherit(e.TM,{b:"[_a-z][\\w']*"}),t]},c={b:"{",e:"}",c:i.c};return{aliases:["hs"],k:"let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",c:[{bK:"module",e:"where",k:"module where",c:[i,t],i:"\\W\\.|;"},{b:"\\bimport\\b",e:"$",k:"import qualified as hiding",c:[i,t],i:"\\W\\.|;"},{cN:"class",b:"^(\\s*)?(class|instance)\\b",e:"where",k:"class family instance where",c:[n,i,t]},{cN:"class",b:"\\b(data|(new)?type)\\b",e:"$",k:"data family type newtype deriving",
+c:[r,n,i,c,t]},{bK:"default",e:"$",c:[n,i,t]},{bK:"infix infixl infixr",e:"$",c:[e.CNM,t]},{b:"\\bforeign\\b",e:"$",k:"foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",c:[n,e.QSM,t]},{cN:"meta",b:"#!\\/usr\\/bin\\/env runhaskell",e:"$"},r,a,e.QSM,e.CNM,n,e.inherit(e.TM,{b:"^[_a-z][\\w']*"}),t,{b:"->|<-"}]}}),e.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}}),e.registerLanguage("ini",function(e){var t={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},t,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}}),e.registerLanguage("java",function(e){var t=e.UIR+"(<"+e.UIR+">)?",r="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private",a="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",n={cN:"number",b:a,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},n,{cN:"meta",b:"@[A-Za-z]+"}]}}),e.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},e.ASM,e.QSM,{cN:"string",b:"`",e:"`",c:[e.BE,{cN:"subst",b:"\\$\\{",e:"\\}"}]},e.CLCM,e.CBCM,{cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/</,e:/>\s*[);\]]/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:[e.CLCM,e.CBCM]}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0},{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#/}}),e.registerLanguage("json",function(e){var t={literal:"true false null"},r=[e.QSM,e.CNM],a={e:",",eW:!0,eE:!0,c:r,k:t},n={b:"{",e:"}",c:[{cN:"attr",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:a}],i:"\\S"},i={b:"\\[",e:"\\]",c:[e.inherit(a)],i:"\\S"};return r.splice(r.length,0,n,i),{c:r,k:t,i:"\\S"}}),e.registerLanguage("lisp",function(e){var t="[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#!]*",r="\\|[^]*?\\|",a="(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|\\-)?\\d+)?",n={cN:"meta",b:"^#!",e:"$"},i={cN:"literal",b:"\\b(t{1}|nil)\\b"},c={cN:"number",v:[{b:a,r:0},{b:"#(b|B)[0-1]+(/[0-1]+)?"},{b:"#(o|O)[0-7]+(/[0-7]+)?"},{b:"#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?"},{b:"#(c|C)\\("+a+" +"+a,e:"\\)"}]},s=e.inherit(e.QSM,{i:null}),o=e.C(";","$",{r:0}),l={b:"\\*",e:"\\*"},u={cN:"symbol",b:"[:&]"+t},b={b:t,r:0},d={b:r},p={b:"\\(",e:"\\)",c:["self",i,s,c,b]},f={c:[c,s,l,u,p,b],v:[{b:"['`]\\(",e:"\\)"},{b:"\\(quote ",e:"\\)",k:{name:"quote"}},{b:"'"+r}]},m={v:[{b:"'"+t},{b:"#'"+t+"(::"+t+")*"}]},g={b:"\\(\\s*",e:"\\)"},h={eW:!0,r:0};return g.c=[{cN:"name",v:[{b:t},{b:r}]},h],h.c=[f,m,g,i,c,s,o,l,u,d,b],{i:/\S/,c:[c,n,i,s,o,f,m,g,b]}}),e.registerLanguage("lua",function(e){var t="\\[=*\\[",r="\\]=*\\]",a={b:t,e:r,c:["self"]},n=[e.C("--(?!"+t+")","$"),e.C("--"+t,r,{c:[a],r:10})];return{l:e.UIR,k:{keyword:"and break do else elseif end false for if in local nil not or repeat return then true until while",built_in:"_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"},c:n.concat([{cN:"function",bK:"function",e:"\\)",c:[e.inherit(e.TM,{b:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{cN:"params",b:"\\(",eW:!0,c:n}].concat(n)},e.CNM,e.ASM,e.QSM,{cN:"string",b:t,e:r,c:[a],r:5}])}}),e.registerLanguage("makefile",function(e){var t={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[t]}}},{cN:"section",b:/^[\w]+:\s*$/},{cN:"meta",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,t]}]}}),e.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"symbol",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link",e:"$"}}]}]}}),e.registerLanguage("matlab",function(e){var t=[e.CNM,{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]}],r={r:0,c:[{b:/'['\.]*/}]};return{k:{keyword:"break case catch classdef continue else elseif end enumerated events for function global if methods otherwise parfor persistent properties return spmd switch try while",built_in:"sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson"},i:'(//|"|#|/\\*|\\s+/\\w+)',c:[{cN:"function",bK:"function",e:"$",c:[e.UTM,{cN:"params",v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}]}]},{b:/[a-zA-Z_][a-zA-Z_0-9]*'['\.]*/,rB:!0,r:0,c:[{b:/[a-zA-Z_][a-zA-Z_0-9]*/,r:0},r.c[0]]},{b:"\\[",e:"\\]",c:t,r:0,starts:r},{b:"\\{",e:/}/,c:t,r:0,starts:r},{b:/\)/,r:0,starts:r},e.C("^\\s*\\%\\{\\s*$","^\\s*\\%\\}\\s*$"),e.C("\\%","$")].concat(t)}}),e.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},r={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[t]},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:r}],r:0}],i:"[^\\s\\}]"}}),e.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"(AV|CA|CF|CG|CI|MK|MP|NS|UI)\\w+"},r={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:r,l:a,i:"</",c:[t,e.CLCM,e.CBCM,e.CNM,e.QSM,{cN:"string",v:[{b:'@"',e:'"',i:"\\n",c:[e.BE]},{b:"'",e:"[^\\\\]'",i:"[^\\\\][^']"}]},{cN:"meta",b:"#",e:"$",c:[{cN:"string",v:[{b:'"',e:'"'},{b:"<",e:">"}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:a,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}}),e.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},a={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],c=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),a,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=c,a.c=c,{aliases:["pl"],k:t,c:c}}),e.registerLanguage("php",function(e){var t={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},r={cN:"meta",b:/<\?(php)?|\?>/},a={cN:"string",c:[e.BE,r],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},n={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"},r]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},r,t,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",t,e.CBCM,a,n]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},a,n]}}),e.registerLanguage("python",function(e){var t={cN:"meta",b:/^(>>>|\.\.\.) /},r={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[t],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[t],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},a={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},n={cN:"params",b:/\(/,e:/\)/,c:["self",t,a,r]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[t,a,r,e.HCM,{v:[{cN:"function",bK:"def",r:10},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,n]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}}),e.registerLanguage("r",function(e){var t="([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*";return{c:[e.HCM,{b:t,l:t,k:{keyword:"function if in break next repeat else for return switch while try tryCatch stop warning require library attach detach source setMethod setGeneric setGroupGeneric setClass ...",literal:"NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10"},r:0},{cN:"number",b:"0[xX][0-9a-fA-F]+[Li]?\\b",r:0},{cN:"number",b:"\\d+(?:[eE][+\\-]?\\d*)?L\\b",r:0},{cN:"number",b:"\\d+\\.(?!\\d)(?:i\\b)?",r:0},{cN:"number",b:"\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{cN:"number",b:"\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",r:0},{b:"`",e:"`",r:0},{cN:"string",c:[e.BE],v:[{b:'"',e:'"'},{b:"'",e:"'"}]}]}}),e.registerLanguage("rust",function(e){var t="([uif](8|16|32|64|size))?",r=e.inherit(e.CBCM);return r.c.push("self"),{aliases:["rs"],k:{keyword:"alignof as be box break const continue crate do else enum extern false fn for if impl in let loop match mod mut offsetof once priv proc pub pure ref return self Self sizeof static struct super trait true type typeof unsafe unsized use virtual while where yield int i8 i16 i32 i64 uint u8 u32 u64 float f32 f64 str char bool",built_in:"Copy Send Sized Sync Drop Fn FnMut FnOnce drop Box ToOwned Clone PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator Option Some None Result Ok Err SliceConcatExt String ToString Vec assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln!"},l:e.IR+"!?",i:"</",c:[e.CLCM,r,e.inherit(e.QSM,{i:null}),{cN:"string",v:[{b:/r(#*)".*?"\1(?!#)/},{b:/'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{cN:"symbol",b:/'[a-zA-Z_][a-zA-Z0-9_]*/},{cN:"number",v:[{b:"\\b0b([01_]+)"+t},{b:"\\b0o([0-7_]+)"+t},{b:"\\b0x([A-Fa-f0-9_]+)"+t},{b:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+t}],r:0},{cN:"function",bK:"fn",e:"(\\(|<)",eE:!0,c:[e.UTM]},{cN:"meta",b:"#\\!?\\[",e:"\\]"},{cN:"class",bK:"type",e:"(=|<)",c:[e.UTM],i:"\\S"},{cN:"class",bK:"trait enum",e:"{",c:[e.inherit(e.UTM,{endsParent:!0})],i:"[\\w\\d]"},{b:e.IR+"::"},{b:"->"}]}}),e.registerLanguage("scala",function(e){var t={cN:"meta",b:"@[A-Za-z]+"},r={cN:"subst",v:[{b:"\\$[A-Za-z0-9_]+"},{b:"\\${",e:"}"}]},a={cN:"string",v:[{b:'"',e:'"',i:"\\n",c:[e.BE]},{b:'"""',e:'"""',r:10},{b:'[a-z]+"',e:'"',i:"\\n",c:[e.BE,r]},{cN:"string",b:'[a-z]+"""',e:'"""',c:[r],r:10}]},n={cN:"symbol",b:"'\\w[\\w\\d_]*(?!')"},i={cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},c={cN:"title",b:/[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,r:0},s={cN:"class",bK:"class object trait type",e:/[:={\[\n;]/,eE:!0,c:[{bK:"extends with",r:10},{cN:"params",b:/\(/,e:/\)/,r:0},c]},o={cN:"function",bK:"def",e:/[:={\[(\n;]/,c:[c]};return{k:{literal:"true false null",keyword:"type yield lazy override def with val var sealed abstract private trait object if forSome for while throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit"},c:[e.CLCM,e.CBCM,a,n,i,o,s,e.CNM,t]}}),e.registerLanguage("scheme",function(e){var t="[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+",r="(\\-|\\+)?\\d+([./]\\d+)?",a=r+"[+\\-]"+r+"i",n={built_in:"case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"},i={cN:"meta",b:"^#!",e:"$"},c={cN:"literal",b:"(#t|#f|#\\\\"+t+"|#\\\\.)"},s={cN:"number",v:[{b:r,r:0},{b:a,r:0},{b:"#b[0-1]+(/[0-1]+)?"},{b:"#o[0-7]+(/[0-7]+)?"},{b:"#x[0-9a-f]+(/[0-9a-f]+)?"}]},o=e.QSM,l=[e.C(";","$",{r:0}),e.C("#\\|","\\|#")],u={b:t,r:0},b={cN:"symbol",b:"'"+t},d={eW:!0,r:0},p={v:[{b:"\\(",e:"\\)"},{b:"\\[",e:"\\]"}],c:[{cN:"name",b:t,l:t,k:n},d]};return d.c=[c,s,o,u,b,p].concat(l),{i:/\S/,c:[i,s,o,b,p].concat(l)}}),e.registerLanguage("smalltalk",function(e){var t="[a-z][a-zA-Z0-9_]*",r={cN:"string",b:"\\$.{1}"},a={cN:"symbol",b:"#"+e.UIR};return{aliases:["st"],k:"self super nil true false thisContext",c:[e.C('"','"'),e.ASM,{cN:"type",b:"\\b[A-Z][A-Za-z0-9_]*",r:0},{b:t+":",r:0},e.CNM,a,r,{b:"\\|[ ]*"+t+"([ ]+"+t+")*[ ]*\\|",rB:!0,e:/\|/,i:/\S/,c:[{b:"(\\|[ ]*)?"+t}]},{b:"\\#\\(",e:"\\)",c:[e.ASM,r,e.CNM,a]}]}}),e.registerLanguage("tcl",function(e){return{aliases:["tk"],k:"after append apply array auto_execok auto_import auto_load auto_mkindex auto_mkindex_old auto_qualify auto_reset bgerror binary break catch cd chan clock close concat continue dde dict encoding eof error eval exec exit expr fblocked fconfigure fcopy file fileevent filename flush for foreach format gets glob global history http if incr info interp join lappend|10 lassign|10 lindex|10 linsert|10 list llength|10 load lrange|10 lrepeat|10 lreplace|10 lreverse|10 lsearch|10 lset|10 lsort|10 mathfunc mathop memory msgcat namespace open package parray pid pkg::create pkg_mkIndex platform platform::shell proc puts pwd read refchan regexp registry regsub|10 rename return safe scan seek set socket source split string subst switch tcl_endOfWord tcl_findLibrary tcl_startOfNextWord tcl_startOfPreviousWord tcl_wordBreakAfter tcl_wordBreakBefore tcltest tclvars tell time tm trace unknown unload unset update uplevel upvar variable vwait while",c:[e.C(";[ \\t]*#","$"),e.C("^[ \\t]*#","$"),{bK:"proc",e:"[\\{]",eE:!0,c:[{cN:"title",b:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"[ \\t\\n\\r]",eW:!0,eE:!0}]},{eE:!0,v:[{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*\\(([a-zA-Z0-9_])*\\)",e:"[^a-zA-Z0-9_\\}\\$]"},{b:"\\$(\\{)?(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",e:"(\\))?[^a-zA-Z0-9_\\}\\$]"}]},{cN:"string",c:[e.BE],v:[e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},{cN:"number",v:[e.BNM,e.CNM]}]}}),e.registerLanguage("tex",function(e){var t={cN:"tag",b:/\\/,r:0,c:[{cN:"name",v:[{b:/[a-zA-Zа-яА-я]+[*]?/},{b:/[^a-zA-Zа-яА-я0-9]/}],starts:{eW:!0,r:0,c:[{cN:"string",v:[{b:/\[/,e:/\]/},{b:/\{/,e:/\}/}]},{b:/\s*=\s*/,eW:!0,r:0,c:[{cN:"number",b:/-?\d*\.?\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?/}]}]}}]};return{c:[t,{cN:"formula",c:[t],r:0,v:[{b:/\$\$/,e:/\$\$/},{b:/\$/,e:/\$/}]},e.C("%","$",{r:0})]}}),e.registerLanguage("vala",function(e){return{k:{keyword:"char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var",built_in:"DBus GLib CCode Gee Object",literal:"false true null"},c:[{cN:"class",bK:"class interface delegate namespace",e:"{",eE:!0,i:"[^,:\\n\\s\\.]",c:[e.UTM]},e.CLCM,e.CBCM,{cN:"string",b:'"""',e:'"""',r:5},e.ASM,e.QSM,e.CNM,{cN:"meta",b:"^#",e:"$",r:2}]}}),e.registerLanguage("xquery",function(e){var t="for let if while then else return where group by xquery encoding versionmodule namespace boundary-space preserve strip default collation base-uri orderingcopy-namespaces order declare import schema namespace function option in allowing emptyat tumbling window sliding window start when only end when previous next stable ascendingdescending empty greatest least some every satisfies switch case typeswitch try catch andor to union intersect instance of treat as castable cast map array delete insert intoreplace value rename copy modify update",r="false true xs:string xs:integer element item xs:date xs:datetime xs:float xs:double xs:decimal QName xs:anyURI xs:long xs:int xs:short xs:byte attribute",a={b:/\$[a-zA-Z0-9\-]+/,r:5},n={cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},i={cN:"string",v:[{b:/"/,e:/"/,c:[{b:/""/,r:0}]},{b:/'/,e:/'/,c:[{b:/''/,r:0}]}]},c={cN:"meta",b:"%\\w+"},s={cN:"comment",b:"\\(:",e:":\\)",r:10,c:[{cN:"doctag",b:"@\\w+"}]},o={b:"{",e:"}"},l=[a,i,n,s,c,o];return o.c=l,{aliases:["xpath","xq"],cI:!1,l:/[a-zA-Z\$][a-zA-Z0-9_:\-]*/,i:/(proc)|(abstract)|(extends)|(until)|(#)/,k:{keyword:t,literal:r},c:l}}),e.registerLanguage("yaml",function(e){var t={literal:"{ } true false yes no Yes No True False null"},r="^[ \\-]*",a="[a-zA-Z_][\\w\\-]*",n={cN:"attr",v:[{b:r+a+":"},{b:r+'"'+a+'":'},{b:r+"'"+a+"':"}]},i={cN:"template-variable",v:[{b:"{{",e:"}}"},{b:"%{",e:"}"}]},c={cN:"string",r:0,v:[{b:/'/,e:/'/},{b:/"/,e:/"/}],c:[e.BE,i]};return{cI:!0,aliases:["yml","YAML","yaml"],c:[n,{cN:"meta",b:"^---s*$",r:10},{cN:"string",b:"[\\|>] *$",rE:!0,c:c.c,e:n.v[0].b},{b:"<%[%=-]?",e:"[%-]?%>",sL:"ruby",eB:!0,eE:!0,r:0},{cN:"type",b:"!!"+e.UIR},{cN:"meta",b:"&"+e.UIR+"$"},{cN:"meta",b:"\\*"+e.UIR+"$"},{cN:"bullet",b:"^ *-",r:0},c,e.HCM,e.CNM],k:t}}),e}); \ No newline at end of file
diff --git a/js/jquery.syntax.brush.apache.js b/js/jquery.syntax.brush.apache.js
deleted file mode 100644
index 43bef262..00000000
--- a/js/jquery.syntax.brush.apache.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// brush: "apache" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('apache', function(brush) {
- brush.push({
- pattern: /(<(\w+).*?>)/gi,
- matches: Syntax.extractMatches(
- {
- klass: 'tag',
- allow: ['attribute', 'tag-name', 'string']
- },
- {
- klass: 'tag-name',
- process: Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive", true)
- })
- });
-
- brush.push({
- pattern: /(<\/(\w+).*?>)/gi,
- matches: Syntax.extractMatches({klass: 'tag', allow: ['tag-name']}, {klass: 'tag-name'})
- });
-
- brush.push({
- pattern: /^\s+([A-Z][\w]+)/gm,
- matches: Syntax.extractMatches({
- klass: 'function',
- allow: ['attribute'],
- process: Syntax.lib.webLinkProcess("site:http://httpd.apache.org/docs/trunk/ directive", true)
- })
- });
-
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
-
- brush.push(Syntax.lib.webLink);
-});
-
diff --git a/js/jquery.syntax.brush.applescript.js b/js/jquery.syntax.brush.applescript.js
deleted file mode 100644
index 198d0763..00000000
--- a/js/jquery.syntax.brush.applescript.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// brush: "applescript" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('applescript', function(brush) {
- var keywords = ["after", "before", "beginning", "continue", "copy", "each", "end", "every", "from", "get", "global", "in", "local", "named", "of", "return", "set", "some", "that", "the", "then", "times", "to", "where", "whose", "with", "without"]
-
- brush.push(keywords, {klass: 'keyword'});
-
- var ordinals = ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "tenth", "last", "front", "back", "middle"];
-
- brush.push(ordinals, {klass: 'keyword'});
-
- var specials = ["activate", "add", "alias", "AppleScript", "ask", "attachment", "boolean", "class", "constant", "delete", "duplicate", "empty", "exists", "false", "id", "integer", "list", "make", "message", "modal", "modified", "new", "no", "paragraph", "pi", "properties", "quit", "real", "record", "remove", "rest", "result", "reveal", "reverse", "run", "running", "save", "string", "true", "word", "yes"];
-
- brush.push(specials, {klass: 'keyword'});
-
- var comments = [
- /(\-\-|#).*$/gm,
- /\(\*(?:[\s\S]*?\(\*[\s\S]*?\*\))*[\s\S]*?\*\)/gm,
- Syntax.lib.perlStyleComment.pattern
- ];
-
- brush.push(Syntax.lib.webLink);
- brush.push(comments, {klass: 'comment', allow: ['href']});
-
- brush.push(Syntax.lib.doubleQuotedString);
-
- var constants = [
- /\b\d+(st|nd|rd|th)\b/g,
- /(-)?(\d)+(\.(\d)?)?(E\+(\d)+)?/g
- ];
-
- brush.push(constants, {klass: 'constant'});
-
- brush.push({
- pattern: /&|¬|=|≠|>|<|≥|>=|≤|<=|\*|\+|-|\/|÷|\^/g,
- klass: 'operator'
- });
-
- brush.push({
- pattern: /\b(?:and|as|div|mod|not|or|return(?!\s&)(ing)?|equals|(is(n't| not)? )?equal( to)?|does(n't| not) equal|(is(n't| not)? )?(greater|less) than( or equal( to)?)?|(comes|does(n't| not) come) (after|before)|is(n't| not)?( in)? (back|front) of|is(n't| not)? behind|is(n't| not)?( (in|contained by))?|does(n't| not) contain|contain(s)?|(start|begin|end)(s)? with|((but|end) )?(consider|ignor)ing|prop(erty)?|(a )?ref(erence)?( to)?|repeat (until|while|with)|((end|exit) )?repeat|((else|end) )?if|else|(end )?(script|tell|try)|(on )?error|(put )?into|(of )?(it|me)|its|my|with (timeout( of)?|transaction)|end (timeout|transaction))\b/g,
- klass: 'keyword'
- })
-
- brush.push({
- pattern: /\b(?:about|above|against|around|at|below|beneath|beside|between|by|(apart|aside) from|(instead|out) of|into|on(to)?|over|since|thr(ough|u)|under)\b/g,
- klass: 'keyword'
- })
-
- brush.push({
- pattern: /\b(?:adding folder items to|after receiving|choose( ((remote )?application|color|folder|from list|URL))?|clipboard info|set the clipboard to|(the )?clipboard|entire contents|display(ing| (alert|dialog|mode))?|document( (edited|file|nib name))?|file( (name|type))?|(info )?for|giving up after|(name )?extension|quoted form|return(ed)?|second(?! item)(s)?|list (disks|folder)|text item(s| delimiters)?|(Unicode )?text|(disk )?item(s)?|((current|list) )?view|((container|key) )?window|with (data|icon( (caution|note|stop))?|parameter(s)?|prompt|properties|seed|title)|case|diacriticals|hyphens|numeric strings|punctuation|white space|folder creation|application(s( folder)?| (processes|scripts position|support))?|((desktop )?(pictures )?|(documents|downloads|favorites|home|keychain|library|movies|music|public|scripts|sites|system|users|utilities|workflows) )folder|desktop|Folder Action scripts|font(s| panel)?|help|internet plugins|modem scripts|(system )?preferences|printer descriptions|scripting (additions|components)|shared (documents|libraries)|startup (disk|items)|temporary items|trash|on server|in AppleTalk zone|((as|long|short) )?user name|user (ID|locale)|(with )?password|in (bundle( with identifier)?|directory)|(close|open for) access|read|write( permission)?|(g|s)et eof|using( delimiters)?|starting at|default (answer|button|color|country code|entr(y|ies)|identifiers|items|name|location|script editor)|hidden( answer)?|open(ed| (location|untitled))?|error (handling|reporting)|(do( shell)?|load|run|store) script|administrator privileges|altering line endings|get volume settings|(alert|boot|input|mount|output|set) volume|output muted|(fax|random )?number|round(ing)?|up|down|toward zero|to nearest|as taught in school|system (attribute|info)|((AppleScript( Studio)?|system) )?version|(home )?directory|(IPv4|primary Ethernet) address|CPU (type|speed)|physical memory|time (stamp|to GMT)|replacing|ASCII (character|number)|localized string|from table|offset|summarize|beep|delay|say|(empty|multiple) selections allowed|(of|preferred) type|invisibles|showing( package contents)?|editable URL|(File|FTP|News|Media|Web) [Ss]ervers|Telnet hosts|Directory services|Remote applications|waiting until completion|saving( (in|to))?|path (for|to( (((current|frontmost) )?application|resource))?)|POSIX (file|path)|(background|RGB) color|(OK|cancel) button name|cancel button|button(s)?|cubic ((centi)?met(re|er)s|yards|feet|inches)|square ((kilo)?met(re|er)s|miles|yards|feet)|(centi|kilo)?met(re|er)s|miles|yards|feet|inches|lit(re|er)s|gallons|quarts|(kilo)?grams|ounces|pounds|degrees (Celsius|Fahrenheit|Kelvin)|print( (dialog|settings))?|clos(e(able)?|ing)|(de)?miniaturized|miniaturizable|zoom(ed|able)|attribute run|action (method|property|title)|phone|email|((start|end)ing|home) page|((birth|creation|current|custom|modification) )?date|((((phonetic )?(first|last|middle))|computer|host|maiden|related) |nick)?name|aim|icq|jabber|msn|yahoo|address(es)?|save addressbook|should enable action|city|country( code)?|formatte(r|d address)|(palette )?label|state|street|zip|AIM [Hh]andle(s)?|my card|select(ion| all)?|unsaved|(alpha )?value|entr(y|ies)|group|(ICQ|Jabber|MSN) handle|person|people|company|department|icon image|job title|note|organization|suffix|vcard|url|copies|collating|pages (across|down)|request print time|target( printer)?|((GUI Scripting|Script menu) )?enabled|show Computer scripts|(de)?activated|awake from nib|became (key|main)|call method|of (class|object)|center|clicked toolbar item|closed|for document|exposed|(can )?hide|idle|keyboard (down|up)|event( (number|type))?|launch(ed)?|load (image|movie|nib|sound)|owner|log|mouse (down|dragged|entered|exited|moved|up)|move|column|localization|resource|script|register|drag (info|types)|resigned (active|key|main)|resiz(e(d)?|able)|right mouse (down|dragged|up)|scroll wheel|(at )?index|should (close|open( untitled)?|quit( after last window closed)?|zoom)|((proposed|screen) )?bounds|show(n)?|behind|in front of|size (mode|to fit)|update(d| toolbar item)?|was (hidden|miniaturized)|will (become active|close|finish launching|hide|miniaturize|move|open|quit|(resign )?active|((maximum|minimum|proposed) )?size|show|zoom)|bundle|data source|movie|pasteboard|sound|tool(bar| tip)|(color|open|save) panel|coordinate system|frontmost|main( (bundle|menu|window))?|((services|(excluded from )?windows) )?menu|((executable|frameworks|resource|scripts|shared (frameworks|support)) )?path|(selected item )?identifier|data|content(s| view)?|character(s)?|click count|(command|control|option|shift) key down|context|delta (x|y|z)|key( code)?|location|pressure|unmodified characters|types|(first )?responder|playing|(allowed|selectable) identifiers|allows customization|(auto saves )?configuration|visible|image( name)?|menu form representation|tag|user(-| )defaults|associated file name|(auto|needs) display|current field editor|floating|has (resize indicator|shadow)|hides when deactivated|level|minimized (image|title)|opaque|position|release when closed|sheet|title(d)?)\b/g,
- klass: 'keyword'
- })
-});
diff --git a/js/jquery.syntax.brush.assembly.js b/js/jquery.syntax.brush.assembly.js
deleted file mode 100644
index 91b48556..00000000
--- a/js/jquery.syntax.brush.assembly.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// brush: "assembly" aliases: ["asm"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('assembly', function(brush) {
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
-
- brush.push({pattern: /\.[a-zA-Z_][a-zA-Z0-9_]*/gm, klass: 'directive'});
-
- brush.push({pattern: /^[a-zA-Z_][a-zA-Z0-9_]*:/gm, klass: 'label'});
-
- brush.push({
- pattern: /^\s*([a-zA-Z]+)/gm,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push({pattern: /(-[0-9]+)|(\b[0-9]+)|(\$[0-9]+)/g, klass: 'constant'});
- brush.push({pattern: /(\-|\b|\$)(0x[0-9a-f]+|[0-9]+|[a-z0-9_]+)/gi, klass: 'constant'});
-
- brush.push({pattern: /%\w+/g, klass: 'register'});
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Comments
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.webLink);
-});
diff --git a/js/jquery.syntax.brush.bash-script.js b/js/jquery.syntax.brush.bash-script.js
deleted file mode 100644
index 1296edf5..00000000
--- a/js/jquery.syntax.brush.bash-script.js
+++ /dev/null
@@ -1,67 +0,0 @@
-// brush: "bash-script" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('bash-script', function(brush) {
- var operators = ["&&", "|", ";", "{", "}"];
- brush.push(operators, {klass: 'operator'});
-
- brush.push({
- pattern: /(?:^|\||;|&&)\s*((?:"([^"]|\\")+"|'([^']|\\')+'|\\\n|.|[ \t])+?)(?=$|\||;|&&)/gmi,
- matches: Syntax.extractMatches({brush: 'bash-statement'})
- });
-});
-
-Syntax.register('bash-statement', function(brush) {
- var keywords = ["break", "case", "continue", "do", "done", "elif", "else", "eq", "fi", "for", "function", "ge", "gt", "if", "in", "le", "lt", "ne", "return", "then", "until", "while"];
- brush.push(keywords, {klass: 'keyword'});
-
- var operators = [">", "<", "=", "`", "--", "{", "}", "(", ")", "[", "]"];
- brush.push(operators, {klass: 'operator'});
-
- brush.push({
- pattern: /\(\((.*?)\)\)/gmi,
- klass: 'expression',
- allow: ['variable', 'string', 'operator', 'constant']
- });
-
- brush.push({
- pattern: /`([\s\S]+?)`/gmi,
- matches: Syntax.extractMatches({brush: 'bash-script', debug: true})
- });
-
- brush.push(Syntax.lib.perlStyleComment);
-
- // Probably need to write a real parser here rather than using regular expressions, it is too fragile
- // and misses lots of edge cases (e.g. nested brackets, delimiters).
- brush.push({
- pattern: /^\s*((?:\S+?=\$?(?:\[[^\]]+\]|\(\(.*?\)\)|"(?:[^"]|\\")+"|'(?:[^']|\\')+'|\S+)\s*)*)((?:\S+)?)/gmi,
- matches: Syntax.extractMatches(
- {klass: 'env', allow: ['variable', 'string', 'operator', 'constant', 'expression']},
- {klass: 'function', allow: ['variable', 'string']}
- )
- });
-
- brush.push({
- pattern: /(\S+?)=/gmi,
- matches: Syntax.extractMatches({klass: 'variable'}),
- only: ['env']
- });
-
- brush.push({
- pattern: /\$\w+/g,
- klass: 'variable'
- });
-
- brush.push({pattern: /\s\-+\w+/g, klass: 'option'})
-
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
-
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- brush.push(Syntax.lib.webLink);
-});
diff --git a/js/jquery.syntax.brush.bash.js b/js/jquery.syntax.brush.bash.js
deleted file mode 100644
index d08464e6..00000000
--- a/js/jquery.syntax.brush.bash.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// brush: "bash" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.brushes.dependency('bash', 'bash-script');
-
-Syntax.register('bash', function(brush) {
- brush.push({
- pattern: /^([\w@:~ ]*?[\$|\#])\s+(.*?)$/gm,
- matches: Syntax.extractMatches({klass: 'prompt'}, {brush: 'bash-script'})
- });
-
- brush.push({
- pattern: /^\-\- .*$/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.webLink);
-
- brush.push({
- klass: 'stderr',
- allow: ['string', 'comment', 'constant', 'href']
- });
-});
diff --git a/js/jquery.syntax.brush.basic.js b/js/jquery.syntax.brush.basic.js
deleted file mode 100644
index 1cc1d74b..00000000
--- a/js/jquery.syntax.brush.basic.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// brush: "basic" aliases: ['vb']
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.lib.vbStyleComment = {pattern: /' .*$/gm, klass: 'comment', allow: ['href']};
-
-Syntax.register('basic', function(brush) {
- var keywords = ["AddHandler", "AddressOf", "Alias", "And", "AndAlso", "Ansi", "As", "Assembly", "Auto", "ByRef", "ByVal", "Call", "Case", "Catch", "Declare", "Default", "Delegate", "Dim", "DirectCast", "Do", "Each", "Else", "ElseIf", "End", "Enum", "Erase", "Error", "Event", "Exit", "Finally", "For", "Function", "Get", "GetType", "GoSub", "GoTo", "Handles", "If", "Implements", "Imports", "In", "Inherits", "Interface", "Is", "Let", "Lib", "Like", "Loop", "Mod", "Module", "MustOverride", "Namespace", "New", "Next", "Not", "On", "Option", "Optional", "Or", "OrElse", "Overloads", "Overridable", "Overrides", "ParamArray", "Preserve", "Property", "RaiseEvent", "ReadOnly", "ReDim", "REM", "RemoveHandler", "Resume", "Return", "Select", "Set", "Static", "Step", "Stop", "Structure", "Sub", "SyncLock", "Then", "Throw", "To", "Try", "TypeOf", "Unicode", "Until", "When", "While", "With", "WithEvents", "WriteOnly", "Xor", "ExternalSource", "Region", "Print", "Class"];
-
- var operators = ["-", "&", "&=", "*", "*=", "/", "/=", "\\", "\=", "^", "^=", "+", "+=", "=", "-="];
-
- var types = ["CBool", "CByte", "CChar", "CDate", "CDec", "CDbl", "Char", "CInt", "CLng", "CObj", "Const", "CShort", "CSng", "CStr", "CType", "Date", "Decimal", "Variant", "String", "Short", "Long", "Single", "Double", "Object", "Integer", "Boolean", "Byte", "Char"];
-
- var operators = ["+", "-", "*", "/", "+=", "-=", "*=", "/=", "=", ":=", "==", "!=", "!", "%", "?", ">", "<", ">=", "<=", "&&", "||", "&", "|", "^", ".", "~", "..", ">>", "<<", ">>>", "<<<", ">>=", "<<=", ">>>=", "<<<=", "%=", "^=", "@"];
-
- var values = ["Me", "MyClass", "MyBase", "super", "True", "False", "Nothing", /[A-Z][A-Z0-9_]+/g];
-
- var access = ["Public", "Protected", "Private", "Shared", "Friend", "Shadows", "MustInherit", "NotInheritable", "NotOverridable"];
-
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword', options: 'gi'});
- brush.push(operators, {klass: 'operator'});
- brush.push(access, {klass: 'access'});
- brush.push(values, {klass: 'constant'});
-
- brush.push(Syntax.lib.decimalNumber);
-
- // ClassNames (CamelCase)
- brush.push(Syntax.lib.camelCaseType);
-
- brush.push(Syntax.lib.vbStyleComment);
-
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.postprocess = function (options, html, container) {
- var queryURI = "http://social.msdn.microsoft.com/Search/en-us?query=";
-
- jQuery('.function', html).each(function() {
- var text = jQuery(this).text();
- jQuery(this).replaceWith(jQuery('<a>').attr('href', queryURI + encodeURIComponent(text)).text(text));
- });
-
- return html;
- };
-});
diff --git a/js/jquery.syntax.brush.clang.js b/js/jquery.syntax.brush.clang.js
deleted file mode 100644
index ed30d05b..00000000
--- a/js/jquery.syntax.brush.clang.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// brush: "clang" aliases: ["cpp", "c++", "c", "objective-c"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('clang', function(brush) {
- var keywords = ["@interface", "@implementation", "@protocol", "@end", "@try", "@throw", "@catch", "@finally", "@class", "@selector", "@encode", "@synchronized", "@property", "@synthesize", "@dynamic", "struct", "break", "continue", "else", "for", "switch", "case", "default", "enum", "goto", "register", "sizeof", "typedef", "volatile", "do", "extern", "if", "return", "static", "union", "while", "asm", "dynamic_cast", "namespace", "reinterpret_cast", "try", "explicit", "static_cast", "typeid", "catch", "operator", "template", "class", "const_cast", "inline", "throw", "virtual", "IBOutlet"];
-
- var access = ["@private", "@protected", "@public", "@required", "@optional", "private", "protected", "public", "friend", "using"];
-
- var typeModifiers = ["mutable", "auto", "const", "register", "typename", "abstract"];
- var types = ["double", "float", "int", "short", "char", "long", "signed", "unsigned", "bool", "void", "id"];
-
- var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new", "delete", "in"];
-
- var values = ["this", "true", "false", "NULL", "YES", "NO", "nil"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(typeModifiers, {klass: 'keyword'})
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(access, {klass: 'access'});
-
- // Objective-C properties
- brush.push({
- pattern: /@property\((.*)\)[^;]+;/gmi,
- klass: 'objective-c-property',
- allow: '*'
- });
-
- var propertyAttributes = ["getter", "setter", "readwrite", "readonly", "assign", "retain", "copy", "nonatomic"];
-
- brush.push(propertyAttributes, {
- klass: 'keyword',
- only: ['objective-c-property']
- });
-
- // Objective-C strings
-
- brush.push({
- pattern: /@(?=")/g,
- klass: 'string'
- });
-
- // Objective-C classes, C++ classes, C types, etc.
- brush.push(Syntax.lib.camelCaseType);
- brush.push(Syntax.lib.cStyleType);
- brush.push({
- pattern: /(?:class|struct|enum|namespace)\s+([^{;\s]+)/gmi,
- matches: Syntax.extractMatches({klass: 'type'})
- });
-
- brush.push({
- pattern: /#.*$/gmi,
- klass: 'preprocessor',
- allow: ['string']
- });
-
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Objective-C style functions
- brush.push({pattern: /\w+:(?=.*(\]|;|\{))(?!:)/g, klass: 'function'});
-
- brush.push({
- pattern: /[^:\[]\s+(\w+)(?=\])/g,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push({
- pattern: /-\s*(\([^\)]+?\))?\s*(\w+)\s*\{/g,
- matches: Syntax.extractMatches({index: 2, klass: 'function'})
- });
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- brush.push(Syntax.lib.cStyleFunction);
-});
-
diff --git a/js/jquery.syntax.brush.csharp.js b/js/jquery.syntax.brush.csharp.js
deleted file mode 100644
index bb4d9aa8..00000000
--- a/js/jquery.syntax.brush.csharp.js
+++ /dev/null
@@ -1,47 +0,0 @@
-// brush: "csharp" aliases: ["c-sharp", "c#"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('csharp', function(brush) {
- var keywords = ["abstract", "add", "alias", "ascending", "base", "break", "case", "catch", "class", "const", "continue", "default", "delegate", "descending", "do", "dynamic", "else", "enum", "event", "explicit", "extern", "finally", "for", "foreach", "from", "get", "global", "goto", "group", "if", "implicit", "in", "interface", "into", "join", "let", "lock", "namespace", "new", "operator", "orderby", "out", "override", "params", "partial", "readonly", "ref", "remove", "return", "sealed", "select", "set", "stackalloc", "static", "struct", "switch", "throw", "try", "unsafe", "using", "value", "var", "virtual", "volatile", "where", "while", "yield"];
-
- var access = ["public", "private", "internal", "protected"];
-
- var types = ["object", "bool", "byte", "fixed", "float", "uint", "char", "ulong", "ushort", "decimal", "int", "sbyte", "short", "void", "long", "string", "double"];
-
- var operators = ["+", "-", "*", "/", "%", "&", "|", "^", "!", "~", "&&", "||", "++", "--", "<<", ">>", "==", "!=", "<", ">", "<=", ">=", "=", "?", "new", "as", "is", "sizeof", "typeof", "checked", "unchecked"];
-
- var values = ["this", "true", "false", "null"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(access, {klass: 'access'});
-
- // Functions
- brush.push(Syntax.lib.cStyleFunction);
- brush.push({
- pattern: /(?:\.)([a-z_][a-z0-9_]+)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- // Camel Case Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
-
diff --git a/js/jquery.syntax.brush.css.js b/js/jquery.syntax.brush.css.js
deleted file mode 100644
index 3a0fc5b5..00000000
--- a/js/jquery.syntax.brush.css.js
+++ /dev/null
@@ -1,80 +0,0 @@
-// brush: "css" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('css', function(brush) {
- var colorNames = ["AliceBlue", "AntiqueWhite", "Aqua", "Aquamarine", "Azure", "Beige", "Bisque", "Black", "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "BurlyWood", "CadetBlue", "Chartreuse", "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson", "Cyan", "DarkBlue", "DarkCyan", "DarkGoldenRod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta", "DarkOliveGreen", "Darkorange", "DarkOrchid", "DarkRed", "DarkSalmon", "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise", "DarkViolet", "DeepPink", "DeepSkyBlue", "DimGray", "DodgerBlue", "FireBrick", "FloralWhite", "ForestGreen", "Fuchsia", "Gainsboro", "GhostWhite", "Gold", "GoldenRod", "Gray", "Green", "GreenYellow", "HoneyDew", "HotPink", "IndianRed", "Indigo", "Ivory", "Khaki", "Lavender", "LavenderBlush", "LawnGreen", "LemonChiffon", "LightBlue", "LightCoral", "LightCyan", "LightGoldenRodYellow", "LightGrey", "LightGreen", "LightPink", "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray", "LightSteelBlue", "LightYellow", "Lime", "LimeGreen", "Linen", "Magenta", "Maroon", "MediumAquaMarine", "MediumBlue", "MediumOrchid", "MediumPurple", "MediumSeaGreen", "MediumSlateBlue", "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed", "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite", "Navy", "OldLace", "Olive", "OliveDrab", "Orange", "OrangeRed", "Orchid", "PaleGoldenRod", "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip", "PeachPuff", "Peru", "Pink", "Plum", "PowderBlue", "Purple", "Red", "RosyBrown", "RoyalBlue", "SaddleBrown", "Salmon", "SandyBrown", "SeaGreen", "SeaShell", "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow", "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Tomato", "Turquoise", "Violet", "Wheat", "White", "WhiteSmoke", "Yellow", "YellowGreen"];
-
- var colorPatterns = ["#[0-9a-f]{3,6}", "rgba?\\(.+?\\)", "hsla?\\(.+?\\)"];
-
- var colorMatcher = [].concat(
- jQuery.map(colorNames, function(pattern) {
- return "(" + Syntax.Brush.convertStringToTokenPattern(pattern, true) + ")";
- }),
- jQuery.map(colorPatterns, function(pattern) {
- return "(" + Syntax.Brush.convertStringToTokenPattern(pattern, false) + ")";
- })
- );
-
- brush.push({
- pattern: /\(.*?\)/g,
- allow: '*',
- disallow: ['property']
- });
-
- brush.push({
- pattern: /\s*([\:\.\[\]\"\'\=\s\w#\.\-,]+)\s+\{/gm,
- matches: Syntax.extractMatches({klass: 'selector', allow: ['string']})
- });
-
- brush.push({
- pattern: new RegExp(colorMatcher.join("|"), "gi"),
- klass: 'color',
- process: function (element, match) {
- var text = Syntax.innerText(element);
- var colourBox = document.createElement('span');
- colourBox.className = 'colour-box';
-
- var sampleColour = document.createElement('span');
- sampleColour.className = 'sample';
- sampleColour.style.backgroundColor = text;
- sampleColour.appendChild(document.createTextNode('&nbsp;&nbsp;'))
- colourBox.appendChild(sampleColour);
-
- element.appendChild(colourBox);
- return element;
- }
- });
-
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.webLink);
-
- brush.push({
- pattern: /\{(.|\n)*?\}/g,
- klass: 'properties',
- allow: '*'
- });
-
- brush.push({
- pattern: /\:(.*?(?=\})|(.|\n)*?(?=(\}|\;)))/g,
- matches: Syntax.extractMatches({klass: 'value', allow: ['color'], only: ['properties']})
- });
-
- brush.push({
- pattern: /([\-\w]+):/g,
- matches: Syntax.extractMatches({
- klass: 'property',
- process: Syntax.lib.webLinkProcess("http://cssdocs.org/")
- })
- });
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.push(Syntax.lib.cStyleFunction);
-});
-
diff --git a/js/jquery.syntax.brush.diff.js b/js/jquery.syntax.brush.diff.js
deleted file mode 100644
index e55b83e4..00000000
--- a/js/jquery.syntax.brush.diff.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// brush: "diff" aliases: ["patch"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('diff', function(brush) {
- brush.push({pattern: /^\+\+\+.*$/gm, klass: 'add'});
- brush.push({pattern: /^\-\-\-.*$/gm, klass: 'del'});
-
- brush.push({pattern: /^@@.*@@/gm, klass: 'offset'});
-
- brush.push({pattern: /^\+[^\+]{1}.*$/gm, klass: 'insert'});
- brush.push({pattern: /^\-[^\-]{1}.*$/gm, klass: 'remove'});
-
- brush.postprocess = function (options, html, container) {
- $('.insert', html).closest('.source').addClass('insert-line');
- $('.remove', html).closest('.source').addClass('remove-line');
- $('.offset', html).closest('.source').addClass('offset-line');
-
- return html;
- };
-});
-
diff --git a/js/jquery.syntax.brush.go.js b/js/jquery.syntax.brush.go.js
deleted file mode 100644
index a3764876..00000000
--- a/js/jquery.syntax.brush.go.js
+++ /dev/null
@@ -1,47 +0,0 @@
-// brush: "go" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('go', function(brush) {
- var keywords = ["break", "default", "func", "interface", "select", "case", "defer", "go", "map", "struct", "chan", "else", "goto", "package", "switch", "const", "fallthrough", "if", "range", "type", "continue", "for", "import", "return", "var"];
-
- var types = [
- /u?int\d*/g,
- /float\d+/g,
- /complex\d+/g,
- "byte",
- "uintptr",
- "string",
- ];
-
- var operators = ["+", "&", "+=", "&=", "&&", "==", "!=", "-", "|", "-=", "|=", "||", "<", "<=", "*", "^", "*=", "^=", "<-", ">", ">=", "/", "<<", "/=", "<<=", "++", "=", ":=", ",", ";", "%", ">>", "%=", ">>=", "--", "!", "...", ".", ":", "&^", "&^="];
-
- var values = ["true", "false", "iota", "nil"];
-
- var functions = ["append", "cap", "close", "complex", "copy", "imag", "len", "make", "new", "panic", "print", "println", "real", "recover"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(functions, {klass: 'function'});
-
- brush.push(Syntax.lib.cStyleFunction);
-
- brush.push(Syntax.lib.camelCaseType);
-
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
diff --git a/js/jquery.syntax.brush.haskell.js b/js/jquery.syntax.brush.haskell.js
deleted file mode 100644
index 77deeba6..00000000
--- a/js/jquery.syntax.brush.haskell.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// brush: "haskell" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('haskell', function(brush) {
- var keywords = ["as", "case", "of", "class", "data", "data family", "data instance", "default", "deriving", "deriving instance", "do", "forall", "foreign", "hiding", "if", "then", "else", "import", "infix", "infixl", "infixr", "instance", "let", "in", "mdo", "module", "newtype", "proc", "qualified", "rec", "type", "type family", "type instance", "where"];
-
- var operators = ["`", "|", "\\", "-", "-<", "-<<", "->", "*", "?", "??", "#", "<-", "@", "!", "::", "_", "~", ">", ";", "{", "}"];
-
- var values = ["True", "False"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- // Camelcase Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Comments
- brush.push({
- pattern: /\-\-.*$/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push({
- pattern: /\{\-[\s\S]*?\-\}/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push(Syntax.lib.webLink);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-});
-
diff --git a/js/jquery.syntax.brush.html.js b/js/jquery.syntax.brush.html.js
deleted file mode 100644
index 4beb7fce..00000000
--- a/js/jquery.syntax.brush.html.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// brush: "html" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.brushes.dependency('html', 'xml');
-Syntax.brushes.dependency('html', 'javascript');
-Syntax.brushes.dependency('html', 'css');
-Syntax.brushes.dependency('html', 'php-script');
-Syntax.brushes.dependency('html', 'ruby');
-
-Syntax.register('html', function(brush) {
- brush.push({
- pattern: /<script.*?type\=.?text\/javascript.*?>((.|\n)*?)<\/script>/gmi,
- matches: Syntax.extractMatches({brush: 'javascript'})
- });
-
- brush.push({
- pattern: /<style.*?type=.?text\/css.*?>((.|\n)*?)<\/style>/gmi,
- matches: Syntax.extractMatches({brush: 'css'})
- });
-
- brush.push({
- pattern: /((<\?php)([\s\S]*?)(\?>))/gm,
- matches: Syntax.extractMatches(
- {klass: 'php-tag', allow: ['keyword', 'php-script']},
- {klass: 'keyword'},
- {brush: 'php-script'},
- {klass: 'keyword'}
- )
- });
-
- brush.push({
- pattern: /((<\?rb?)([\s\S]*?)(\?>))/gm,
- matches: Syntax.extractMatches(
- {klass: 'ruby-tag', allow: ['keyword', 'ruby']},
- {klass: 'keyword'},
- {brush: 'ruby'},
- {klass: 'keyword'}
- )
- });
-
- brush.push({
- pattern: /<%=?(.*?)(%>)/g,
- klass: 'instruction',
- allow: ['string']
- });
-
- brush.push({
- pattern: /<\!(DOCTYPE(.*?))>/g,
- matches: Syntax.extractMatches({klass: 'doctype'})
- });
-
- // Is this rule still relevant?
- brush.push({
- pattern: /(%[0-9a-f]{2})/gi,
- klass: 'percent-escape',
- only: ['html']
- });
-
- // The position of this statement is important - it determines at what point the rules of the parent are processed.
- // In this case, the rules for xml are processed after the rules for html.
- brush.derives('xml');
-});
-
diff --git a/js/jquery.syntax.brush.io.js b/js/jquery.syntax.brush.io.js
deleted file mode 100644
index 312b7501..00000000
--- a/js/jquery.syntax.brush.io.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// brush: "io" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('io', function(brush) {
- brush.push(Syntax.lib.cStyleFunction);
-
- var keywords = ["return"];
-
- var operators = ["::=", ":=", "or", "and", "@", "+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new", "delete"];
-
- brush.push(keywords, {klass: 'keywords'});
- brush.push(operators, {klass: 'operator'});
-
- // Extract space delimited method invocations
- brush.push({
- pattern: /\b([ \t]+([a-z]+))/gi,
- matches: Syntax.extractMatches({index: 2, klass: 'function'})
- });
-
- brush.push({
- pattern: /\)([ \t]+([a-z]+))/gi,
- matches: Syntax.extractMatches({index: 2, klass: 'function'})
- });
-
- // Objective-C classes
- brush.push(Syntax.lib.camelCaseType);
-
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
-
diff --git a/js/jquery.syntax.brush.java.js b/js/jquery.syntax.brush.java.js
deleted file mode 100644
index ad0591e9..00000000
--- a/js/jquery.syntax.brush.java.js
+++ /dev/null
@@ -1,45 +0,0 @@
-// brush: "java" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('java', function(brush) {
- var keywords = ["abstract", "continue", "for", "switch", "assert", "default", "goto", "synchronized", "do", "if", "break", "implements", "throw", "else", "import", "throws", "case", "enum", "return", "transient", "catch", "extends", "try", "final", "interface", "static", "class", "finally", "strictfp", "volatile", "const", "native", "super", "while"];
-
- var access = ["private", "protected", "public", "package"];
-
- var types = ["void", "byte", "short", "int", "long", "float", "double", "boolean", "char"];
-
- var operators = ["++", "--", "++", "--", "+", "-", "~", "!", "*", "/", "%", "+", "-", "<<", ">>", ">>>", "<", ">", "<=", ">=", "==", "!=", "&", "^", "|", "&&", "||", "?", "=", "+=", "-=", "*=", "/=", "%=", "&=", "^=", "|=", "<<=", ">>=", ">>>=", "instanceof", "new", "delete"];
-
- var constants = ["this", "true", "false", "null"];
-
- brush.push(constants, {klass: 'constant'});
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(access, {klass: 'access'});
-
- // Camel Case Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.push(Syntax.lib.cStyleFunction);
-
- brush.processes['function'] = Syntax.lib.webLinkProcess('java "Developer Documentation"', true);
-});
-
diff --git a/js/jquery.syntax.brush.javascript.js b/js/jquery.syntax.brush.javascript.js
deleted file mode 100644
index d0ad5415..00000000
--- a/js/jquery.syntax.brush.javascript.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// brush: "javascript" aliases: ["js", "actionscript"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('javascript', function(brush) {
- var keywords = ["function", "break", "case", "catch", "continue", "default", "delete", "do", "else", "for", "if", "in", "instanceof", "new", "return", "super", "switch", "throw", "true", "try", "typeof", "var", "while", "with", "prototype"];
-
- var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"];
- var values = ["this", "true", "false", "null"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- // Regular expressions
- brush.push(Syntax.lib.perlStyleRegularExpression);
-
- // Camel Case Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Functions
- brush.push(Syntax.lib.cStyleFunction);
-});
-
diff --git a/js/jquery.syntax.brush.kai.js b/js/jquery.syntax.brush.kai.js
deleted file mode 100644
index e3c7b00c..00000000
--- a/js/jquery.syntax.brush.kai.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// brush: "kai" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('kai', function(brush) {
- brush.push(['(', ')', '[', ']', '{', '}'], {klass: 'operator'});
-
- brush.push(Syntax.lib.perlStyleComment);
-
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.webLink);
-
- brush.push({
- pattern: /\(([^\s\(\)]+)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push({
- pattern: /`[a-z]*/gi,
- klass: 'constant'
- })
-
- // Strings
- brush.push(Syntax.lib.multiLineDoubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-});
-
diff --git a/js/jquery.syntax.brush.lisp.js b/js/jquery.syntax.brush.lisp.js
deleted file mode 100644
index d2cdc5fc..00000000
--- a/js/jquery.syntax.brush.lisp.js
+++ /dev/null
@@ -1,34 +0,0 @@
-// brush: "lisp" aliases: ['scheme', 'clojure']
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.lib.lispStyleComment = {pattern: /(;+) .*$/gm, klass: 'comment', allow: ['href']};
-
-// This syntax is intentionally very sparse. This is because it is a general syntax for Lisp like languages.
-// It might be a good idea to make specific dialects (e.g. common lisp, scheme, clojure, etc)
-Syntax.register('lisp', function(brush) {
- brush.push(['(', ')'], {klass: 'operator'});
-
- brush.push(Syntax.lib.lispStyleComment);
-
- brush.push(Syntax.lib.hexNumber);
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.webLink);
-
- brush.push({
- pattern: /\(\s*([^\s\(\)]+)/gmi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push({
- pattern: /#[a-z]+/gi,
- klass: 'constant'
- })
-
- // Strings
- brush.push(Syntax.lib.multiLineDoubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-});
-
diff --git a/js/jquery.syntax.brush.lua.js b/js/jquery.syntax.brush.lua.js
deleted file mode 100644
index f7821c39..00000000
--- a/js/jquery.syntax.brush.lua.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// brush: "lua" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('lua', function(brush) {
- var keywords = ["and", "break", "do", "else", "elseif", "end", "false", "for", "function", "if", "in", "local", "nil", "not", "or", "repeat", "return", "then", "true", "until", "while"];
-
- var operators = ["+", "-", "*", "/", "%", "^", "#", "..", "=", "==", "~=", "<", ">", "<=", ">=", "?", ":"];
-
- var values = ["self", "true", "false", "nil"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- // Camelcase Types
- brush.push(Syntax.lib.camelCaseType);
- brush.push(Syntax.lib.cStyleFunction);
-
- brush.push({
- pattern: /\-\-.*$/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push({
- pattern: /\-\-\[\[(\n|.)*?\]\]\-\-/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.push(Syntax.lib.hexNumber);
- brush.push(Syntax.lib.decimalNumber);
-
- brush.push(Syntax.lib.webLink);
-});
-
diff --git a/js/jquery.syntax.brush.ocaml.js b/js/jquery.syntax.brush.ocaml.js
deleted file mode 100644
index c0b7e205..00000000
--- a/js/jquery.syntax.brush.ocaml.js
+++ /dev/null
@@ -1,73 +0,0 @@
-// brush: "ocaml" aliases: ["ml", "sml", "fsharp"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-// This brush is based loosely on the following documentation:
-// http://msdn.microsoft.com/en-us/library/dd233230.aspx
-
-Syntax.register('ocaml', function(brush) {
- var keywords = ["abstract", "and", "as", "assert", "begin", "class", "default", "delegate", "do", "done", "downcast", "downto", "elif", "else", "end", "exception", "extern", "finally", "for", "fun", "function", "if", "in", "inherit", "inline", "interface", "internal", "lazy", "let", "match", "member", "module", "mutable", "namespace", "new", "null", "of", "open", "or", "override", "rec", "return", "static", "struct", "then", "to", "try", "type", "upcast", "use", "val", "when", "while", "with", "yield", "asr", "land", "lor", "lsl", "lsr", "lxor", "mod", "sig", "atomic", "break", "checked", "component", "const", "constraint", "constructor", "continue", "eager", "event", "external", "fixed", "functor", "global", "include", "method", "mixin", "object", "parallel", "process", "protected", "pure", "sealed", "trait", "virtual", "volatile", "val"];
-
- var types = ["bool", "byte", "sbyte", /\bu?int\d*\b/g, "nativeint", "unativeint", "char", "string", "decimal", "unit", "void", "float32", "single", "float64", "double", "list", "array", "exn", "format", "fun", "option", "ref"];
-
- var operators = ["!", "<>", "%", "&", "*", "+", "-", "->", "/", "::", ":=", ":>", ":?", ":?>", "<", "=", ">", "?", "@", "^", "_", "`", "|", "~", "'", "[<", ">]", "<|", "|>", "[|", "|]", "(|", "|)", "(*", "*)", "in"];
-
- var values = ["true", "false"];
-
- var access = ["private", "public"];
-
- brush.push(access, {klass: 'access'});
- brush.push(values, {klass: 'constant'});
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- // http://caml.inria.fr/pub/docs/manual-ocaml/manual011.html#module-path
- // open [module-path], new [type]
- brush.push({
- pattern: /(?:open|new)\s+((?:\.?[a-z][a-z0-9]*)+)/gi,
- matches: Syntax.extractMatches({klass: 'type'})
- });
-
- // Functions
- brush.push({
- pattern: /(?:\.)([a-z_][a-z0-9_]+)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- // Avoid highlighting keyword arguments as camel-case types.
- brush.push({
- pattern: /(?:\(|,)\s*(\w+\s*=)/g,
- matches: Syntax.extractMatches({
- klass: 'keyword-argument'
- })
- });
-
- // We need to modify cStyleFunction because "(*" is a comment token.
- brush.push({
- pattern: /([a-z_][a-z0-9_]*)\s*\((?!\*)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- // Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Web Links
- brush.push(Syntax.lib.webLink);
-
- // Comments
- brush.push({
- pattern: /\(\*[\s\S]*?\*\)/g,
- klass: 'comment'
- });
-
- // Strings
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
diff --git a/js/jquery.syntax.brush.ooc.js b/js/jquery.syntax.brush.ooc.js
deleted file mode 100644
index 133040c0..00000000
--- a/js/jquery.syntax.brush.ooc.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// brush: "ooc" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('ooc', function(brush) {
- var keywords = ["class", "interface", "implement", "abstract", "extends", "from", "const", "final", "static", "import", "use", "extern", "inline", "proto", "break", "continue", "fallthrough", "operator", "if", "else", "for", "while", "do", "switch", "case", "as", "in", "version", "return", "include", "cover", "func"];
-
- var types = ["Int", "Int8", "Int16", "Int32", "Int64", "Int80", "Int128", "UInt", "UInt8", "UInt16", "UInt32", "UInt64", "UInt80", "UInt128", "Octet", "Short", "UShort", "Long", "ULong", "LLong", "ULLong", "Float", "Double", "LDouble", "Float32", "Float64", "Float128", "Char", "UChar", "WChar", "String", "Void", "Pointer", "Bool", "SizeT", "This"];
-
- var operators = ["+", "-", "*", "/", "+=", "-=", "*=", "/=", "=", ":=", "==", "!=", "!", "%", "?", ">", "<", ">=", "<=", "&&", "||", "&", "|", "^", ".", "~", "..", ">>", "<<", ">>>", "<<<", ">>=", "<<=", ">>>=", "<<<=", "%=", "^=", "@"];
-
- var values = ["this", "super", "true", "false", "null", /[A-Z][A-Z0-9_]+/g];
-
- brush.push(values, {klass: 'constant'});
- brush.push(types, {klass: 'type'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- // Hex, Octal and Binary numbers :)
- brush.push({
- pattern: /0[xcb][0-9a-fA-F]+/g,
- klass: 'constant'
- });
-
- brush.push(Syntax.lib.decimalNumber);
-
- // ClassNames (CamelCase)
- brush.push(Syntax.lib.camelCaseType);
- brush.push(Syntax.lib.cStyleType);
- brush.push(Syntax.lib.cStyleFunction);
-
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
-
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- brush.processes['function'] = Syntax.lib.webLinkProcess("http://docs.ooc-lang.org/search.html?q=");
-});
-
diff --git a/js/jquery.syntax.brush.pascal.js b/js/jquery.syntax.brush.pascal.js
deleted file mode 100644
index 606d1f15..00000000
--- a/js/jquery.syntax.brush.pascal.js
+++ /dev/null
@@ -1,51 +0,0 @@
-// brush: "pascal" aliases: ["delphi"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-//
-// Constructed using information from http://pascal.comsci.us/etymology/
-//
-
-Syntax.register('pascal', function(brush) {
- var keywords = ["absolute", "abstract", "all", "and_then", "as", "asm", "asmname", "attribute", "begin", "bindable", "c", "c_language", "case", "class", "const", "constructor", "destructor", "dispose", "do", "downto", "else", "end", "except", "exit", "export", "exports", "external", "far", "file", "finalization", "finally", "for", "forward", "function", "goto", "if", "implementation", "import", "inherited", "initialization", "inline", "interface", "interrupt", "is", "keywords", "label", "library", "module", "name", "near", "new", "object", "of", "on", "only", "operator", "or_else", "otherwise", "packed", "pascal", "pow", "private", "procedure", "program", "property", "protected", "public", "published", "qualified", "raise", "record", "repeat", "resident", "restricted", "segment", "set", "then", "threadvar", "to", "try", "type", "unit", "until", "uses", "value", "var", "view", "virtual", "while", "with"];
-
- var operators = ["+", "-", "*", "/", "div", "mod", "and", "or", "xor", "shl", "shr", "not", "=", ">=", ">", "<>", "<=", "<", "in", ":="];
-
- var values = ["true", "false", "nil"];
-
- // Keywords are case insensitive
- brush.push(values, {klass: 'constant', options: 'gi'});
- brush.push(keywords, {klass: 'keyword', options: 'gi'});
- brush.push(operators, {klass: 'operator', options: 'gi'});
-
- brush.push(Syntax.lib.camelCaseType);
-
- // Pascal style comments
- brush.push({
- pattern: /\{[\s\S]*?\}/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push({
- pattern: /\(\*[\s\S]*?\*\)/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Functions
- brush.push(Syntax.lib.cStyleFunction);
-});
-
diff --git a/js/jquery.syntax.brush.perl5.js b/js/jquery.syntax.brush.perl5.js
deleted file mode 100644
index 4ec9c4d9..00000000
--- a/js/jquery.syntax.brush.perl5.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// brush: "perl5" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('perl5', function(brush) {
- var builtins = ["abs", "accept", "alarm", "atan2", "bind", "binmode", "chdir", "chmod", "chomp", "chop", "chown", "chr", "chroot", "close", "closedir", "connect", "cos", "crypt", "defined", "delete", "each", "endgrent", "endhostent", "endnetent", "endprotoent", "endpwent", "endservent", "eof", "exec", "exists", "exp", "fcntl", "fileno", "flock", "fork", "format", "formline", "getc", "getgrent", "getgrgid", "getgrnam", "gethostbyaddr", "gethostbyname", "gethostent", "getlogin", "getnetbyaddr", "getnetbyname", "getnetent", "getpeername", "getpgrp", "getppid", "getpriority", "getprotobyname", "getprotobynumber", "getprotoent", "getpwent", "getpwnam", "getpwuid", "getservbyname", "getservbyport", "getservent", "getsockname", "getsockopt", "glob", "gmtime", "grep", "hex", "index", "int", "ioctl", "join", "keys", "kill", "lc", "lcfirst", "length", "link", "listen", "localtime", "lock", "log", "lstat", "map", "mkdir", "msgctl", "msgget", "msgrcv", "msgsnd", "oct", "open", "opendir", "ord", "pack", "pipe", "pop", "pos", "print", "printf", "prototype", "push", "quotemeta", "rand", "read", "readdir", "readline", "readlink", "readpipe", "recv", "rename", "reset", "reverse", "rewinddir", "rindex", "rmdir", "scalar", "seek", "seekdir", "select", "semctl", "semget", "semop", "send", "setgrent", "sethostent", "setnetent", "setpgrp", "setpriority", "setprotoent", "setpwent", "setservent", "setsockopt", "shift", "shmctl", "shmget", "shmread", "shmwrite", "shutdown", "sin", "sleep", "socket", "socketpair", "sort", "splice", "split", "sprintf", "sqrt", "srand", "stat", "study", "substr", "symlink", "syscall", "sysopen", "sysread", "sysseek", "system", "syswrite", "tell", "telldir", "time", "times", "tr", "truncate", "uc", "ucfirst", "umask", "undef", "unlink", "unpack", "unshift", "utime", "values", "vec", "wait", "waitpid", "warn", "write"];
-
- var keywords = ["bless", "caller", "continue", "die", "do", "dump", "else", "elsif", "eval", "exit", "for", "foreach", "goto", "if", "import", "last", "local", "my", "next", "no", "our", "package", "redo", "ref", "require", "return", "sub", "tie", "tied", "unless", "untie", "until", "use", "wantarray", "while"];
-
- var operators = ["->", "++", "--", "**", "!", "~", "\\", "+", "-", "=~", "!~", "*", "/", "%", "x", "+", "-", ".", "<<", ">>", "<", ">", "<=", ">=", "lt", "gt", "le", "ge", "==", "!=", "<=>", "eq", "ne", "cmp", "~~", "&", "|", "^", "&&", "||", "//", "..", "...", "?:", "=", ",", "=>", "not", "and", "or", "xor"];
-
- var values = ["this", "true", "false"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(builtins, {klass: 'function'});
-
- // Regular expressions
- brush.push(Syntax.lib.perlStyleRegularExpression);
-
- // Comments
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Variables
- brush.push({
- pattern: /(\$|@|%)\w+/gi,
- klass: 'variable'
- });
-
- // Enddoc
- brush.push({
- pattern: /__END__[\s\S]*/gm,
- klass: 'comment'
- });
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Functions
- brush.push(Syntax.lib.cStyleFunction);
-});
-
diff --git a/js/jquery.syntax.brush.php-script.js b/js/jquery.syntax.brush.php-script.js
deleted file mode 100644
index c053fa02..00000000
--- a/js/jquery.syntax.brush.php-script.js
+++ /dev/null
@@ -1,48 +0,0 @@
-// brush: "php-script" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('php-script', function(brush) {
- var keywords = ["abstract", "and", "as", "break", "case", "cfunction", "class", "const", "continue", "declare", "default", "die", "do", "echo", "else", "elseif", "enddeclare", "endfor", "endforeach", "endif", "endswitch", "endwhile", "extends", "extends", "for", "foreach", "function", "global", "if", "implements", "include", "include_once", "interface", "old_function", "or", "require", "require_once", "return", "static", "switch", "throw", "use", "var", "while", "xor"];
-
- var access = ["private", "protected", "public"];
-
- var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">", "[", "]", "new"];
-
- var values = ["this", "true", "false"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(access, {klass: 'access'});
-
- // Variables
- brush.push({
- pattern: /\$[a-z_][a-z0-9]*/gi,
- klass: 'variable'
- });
-
- // ClassNames (CamelCase)
- brush.push(Syntax.lib.camelCaseType);
- brush.push(Syntax.lib.cStyleFunction);
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- brush.processes['function'] = Syntax.lib.webLinkProcess("http://www.php.net/manual-lookup.php?pattern=");
-});
-
diff --git a/js/jquery.syntax.brush.php.js b/js/jquery.syntax.brush.php.js
deleted file mode 100644
index cc813a46..00000000
--- a/js/jquery.syntax.brush.php.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// brush: "php" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.brushes.dependency('php', 'php-script');
-
-Syntax.register('php', function(brush) {
- brush.push({
- pattern: /(<\?(php)?)((.|\n)*?)(\?>)/gm,
- matches: Syntax.extractMatches({klass: 'keyword'}, null, {brush: 'php-script'}, null, {klass: 'keyword'})
- })
-});
-
diff --git a/js/jquery.syntax.brush.plain.js b/js/jquery.syntax.brush.plain.js
deleted file mode 100644
index 30f4bb8e..00000000
--- a/js/jquery.syntax.brush.plain.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// brush: "plain" aliases: ["text"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('plain', function(brush) {
- brush.push(Syntax.lib.webLink);
-});
-
diff --git a/js/jquery.syntax.brush.protobuf.js b/js/jquery.syntax.brush.protobuf.js
deleted file mode 100644
index 1ebd8f34..00000000
--- a/js/jquery.syntax.brush.protobuf.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// brush: "protobuf" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('protobuf', function(brush) {
- var keywords = ["enum", "extend", "extensions", "group", "import", "max", "message", "option", "package", "returns", "rpc", "service", "syntax", "to", "default"];
- brush.push(keywords, {klass: 'keyword'})
-
- var values = ["true", "false"];
- brush.push(values, {klass: 'constant'});
-
- var types = ["bool", "bytes", "double", "fixed32", "fixed64", "float", "int32", "int64", "sfixed32", "sfixed64", "sint32", "sint64", "string", "uint32", "uint64"];
- brush.push(types, {klass: 'type'});
-
- var access = ["optional", "required", "repeated"]
- brush.push(access, {klass: 'access'});
-
- brush.push(Syntax.lib.camelCaseType);
-
- // Highlight names of fields
- brush.push({
- pattern: /\s+(\w+)\s*=\s*\d+/g,
- matches: Syntax.extractMatches({
- klass: 'variable'
- })
- });
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
-
diff --git a/js/jquery.syntax.brush.python.js b/js/jquery.syntax.brush.python.js
deleted file mode 100644
index 40f6a909..00000000
--- a/js/jquery.syntax.brush.python.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// brush: "python" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('python', function(brush) {
- var keywords = ["and", "as", "assert", "break", "class", "continue", "def", "del", "elif", "else", "except", "exec", "finally", "for", "from", "global", "if", "import", "in", "is", "lambda", "not", "or", "pass", "print", "raise", "return", "try", "while", "with", "yield"];
-
- var operators = ["!=", "%", "%=", "&", "&=", "(", ")", "*", "**", "**=", "*=", "+", "+=", ",", "-", "-=", ".", "/", "//", "//=", "/=", ":", ";", "<", "<<", "<<=", "<=", "<>", "=", "==", ">", ">=", ">>", ">>=", "@", "[", "]", "^", "^=", "`", "`", "{", "|", "|=", "}", "~"];
-
- // Extracted from http://docs.python.org/library/functions.html
- var builtinFunctions = ["abs", "all", "any", "basestring", "bin", "bool", "callable", "chr", "classmethod", "cmp", "compile", "complex", "delattr", "dict", "dir", "divmod", "enumerate", "eval", "execfile", "file", "filter", "float", "format", "frozenset", "getattr", "globals", "hasattr", "hash", "help", "hex", "id", "input", "int", "isinstance", "issubclass", "iter", "len", "list", "locals", "long", "map", "max", "min", "next", "object", "oct", "open", "ord", "pow", "print", "property", "range", "raw_input", "reduce", "reload", "repr", "reversed", "round", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", "tuple", "type", "type", "unichr", "unicode", "vars", "xrange", "zip", "__import__", "apply", "buffer", "coerce", "intern"];
-
- var values = ["self", "True", "False", "None"];
-
- brush.push({pattern: /^\s*@\w+/gm, klass: 'decorator'});
- brush.push(values, {klass: 'constant'});
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
- brush.push(builtinFunctions, {klass: 'builtin'});
-
- // ClassNames (CamelCase)
- brush.push(Syntax.lib.camelCaseType);
- brush.push(Syntax.lib.cStyleFunction);
-
- brush.push(Syntax.lib.perlStyleComment);
- brush.push({pattern: /(['\"]{3})([^\1])*?\1/gm, klass: 'comment'});
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- brush.processes['function'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");
- brush.processes['type'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");
- brush.processes['builtin'] = Syntax.lib.webLinkProcess("http://docs.python.org/search.html?q=");
-});
-
diff --git a/js/jquery.syntax.brush.ruby.js b/js/jquery.syntax.brush.ruby.js
deleted file mode 100644
index 5d37ed1c..00000000
--- a/js/jquery.syntax.brush.ruby.js
+++ /dev/null
@@ -1,77 +0,0 @@
-// brush: "ruby" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.lib.rubyStyleFunction = {pattern: /(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi, matches: Syntax.extractMatches({klass: 'function'})};
-
-// We need to emulate negative lookbehind
-Syntax.lib.rubyStyleSymbol = {pattern: /([:]?):\w+/g, klass: 'constant', matches: function (match, expr) {
- if (match[1] != '') return [];
-
- return [new Syntax.Match(match.index, match[0].length, expr, match[0])];
-}};
-
-Syntax.register('ruby', function(brush) {
- var keywords = ["alias", "and", "begin", "break", "case", "class", "def", "define_method", "defined?", "do", "else", "elsif", "end", "ensure", "false", "for", "if", "in", "module", "next", "not", "or", "raise", "redo", "rescue", "retry", "return", "then", "throw", "undef", "unless", "until", "when", "while", "yield", "block_given?"];
-
- var operators = ["+", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"];
- var values = ["self", "super", "true", "false", "nil"];
-
- var access = ["private", "protected", "public"];
-
- brush.push(access, {klass: 'access'});
- brush.push(values, {klass: 'constant'});
-
- // Percent operator statements
- brush.push({
- pattern: /(\%[\S])(\{[\s\S]*?\})/g,
- matches: Syntax.extractMatches({klass: 'function'}, {klass: 'constant'})
- });
-
- brush.push({
- pattern: /`[^`]+`/g,
- klass: 'string'
- });
-
- brush.push({
- pattern: /\#\{([^\}]*)\}/g,
- matches: Syntax.extractMatches({
- brush: 'ruby',
- only: ['string']
- }),
- });
-
- // Regular expressions
- brush.push(Syntax.lib.perlStyleRegularExpression);
-
- brush.push({pattern: /(@+|\$)[\w]+/g, klass: 'variable'});
-
- brush.push(Syntax.lib.camelCaseType);
- brush.push(keywords, {klass: 'keyword'});
- brush.push(operators, {klass: 'operator'});
-
- brush.push(Syntax.lib.rubyStyleSymbol);
-
- // Comments
- brush.push(Syntax.lib.perlStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Functions
- brush.push(Syntax.lib.rubyStyleFunction);
- brush.push(Syntax.lib.cStyleFunction);
-
- // brush.processes['function'] = Syntax.lib.webLinkProcess("ruby", true);
- // brush.processes['type'] = Syntax.lib.webLinkProcess("ruby", true);
-});
-
diff --git a/js/jquery.syntax.brush.scala.js b/js/jquery.syntax.brush.scala.js
deleted file mode 100644
index 544a26b1..00000000
--- a/js/jquery.syntax.brush.scala.js
+++ /dev/null
@@ -1,44 +0,0 @@
-// brush: "scala" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.brushes.dependency('scala', 'xml');
-
-Syntax.register('scala', function(brush) {
- var keywords = ["abstract", "do", "finally", "import", "object", "return", "trait", "var", "case", "catch", "class", "else", "extends", "for", "forSome", "if", "lazy", "match", "new", "override", "package", "private", "sealed", "super", "try", "type", "while", "with", "yield", "def", "final", "implicit", "protected", "throw", "val"];
- brush.push(keywords, {klass: 'keyword'});
-
- var operators = ["_", ":", "=", "=>", "<-", "<:", "<%", ">:", "#", "@"];
- brush.push(operators, {klass: 'operator'});
-
- var constants = ["this", "null", "true", "false"];
- brush.push(constants, {klass: 'constant'});
-
- // Strings
- brush.push({
- pattern: /"""[\s\S]*?"""/g,
- klass: 'string'
- });
-
- brush.push(Syntax.lib.doubleQuotedString);
-
- // Functions
- brush.push({
- pattern: /(?:def\s+|\.)([a-z_][a-z0-9_]+)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push(Syntax.lib.camelCaseType);
-
- // Types
- brush.push(Syntax.lib.cStyleFunction);
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
-
- brush.derives('xml');
-});
-
diff --git a/js/jquery.syntax.brush.smalltalk.js b/js/jquery.syntax.brush.smalltalk.js
deleted file mode 100644
index a91200a5..00000000
--- a/js/jquery.syntax.brush.smalltalk.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// brush: "smalltalk" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('smalltalk', function(brush) {
- var operators = ["[", "]", "|", ":=", "."];
-
- var values = ["self", "super", "true", "false", "nil"];
-
- brush.push(values, {klass: 'constant'});
- brush.push(operators, {klass: 'operator'});
-
- // Objective-C style functions
- brush.push({pattern: /\w+:/g, klass: 'function'});
-
- // Camelcase Types
- brush.push(Syntax.lib.camelCaseType);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-});
diff --git a/js/jquery.syntax.brush.sql.js b/js/jquery.syntax.brush.sql.js
deleted file mode 100644
index 8f00aa01..00000000
--- a/js/jquery.syntax.brush.sql.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// brush: "sql" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.lib.sqlStyleComment = {pattern: /-- .*$/gm, klass: 'comment', allow: ['href']};
-
-Syntax.register('sql', function(brush) {
- var keywords = ["A", "ABORT", "ABS", "ABSOLUTE", "ACCESS", "ACTION", "ADA", "ADD", "ADMIN", "AFTER", "AGGREGATE", "ALIAS", "ALL", "ALLOCATE", "ALSO", "ALTER", "ALWAYS", "ANALYSE", "ANALYZE", "AND", "ANY", "ARE", "ARRAY", "AS", "ASC", "ASENSITIVE", "ASSERTION", "ASSIGNMENT", "ASYMMETRIC", "AT", "ATOMIC", "ATTRIBUTE", "ATTRIBUTES", "AUDIT", "AUTHORIZATION", "AUTO_INCREMENT", "AVG", "AVG_ROW_LENGTH", "BACKUP", "BACKWARD", "BEFORE", "BEGIN", "BERNOULLI", "BETWEEN", "BIGINT", "BINARY", "BIT", "BIT_LENGTH", "BITVAR", "BLOB", "BOOL", "BOOLEAN", "BOTH", "BREADTH", "BREAK", "BROWSE", "BULK", "BY", "C", "CACHE", "CALL", "CALLED", "CARDINALITY", "CASCADE", "CASCADED", "CASE", "CAST", "CATALOG", "CATALOG_NAME", "CEIL", "CEILING", "CHAIN", "CHANGE", "CHAR", "CHAR_LENGTH", "CHARACTER", "CHARACTER_LENGTH", "CHARACTER_SET_CATALOG", "CHARACTER_SET_NAME", "CHARACTER_SET_SCHEMA", "CHARACTERISTICS", "CHARACTERS", "CHECK", "CHECKED", "CHECKPOINT", "CHECKSUM", "CLASS", "CLASS_ORIGIN", "CLOB", "CLOSE", "CLUSTER", "CLUSTERED", "COALESCE", "COBOL", "COLLATE", "COLLATION", "COLLATION_CATALOG", "COLLATION_NAME", "COLLATION_SCHEMA", "COLLECT", "COLUMN", "COLUMN_NAME", "COLUMNS", "COMMAND_FUNCTION", "COMMAND_FUNCTION_CODE", "COMMENT", "COMMIT", "COMMITTED", "COMPLETION", "COMPRESS", "COMPUTE", "CONDITION", "CONDITION_NUMBER", "CONNECT", "CONNECTION", "CONNECTION_NAME", "CONSTRAINT", "CONSTRAINT_CATALOG", "CONSTRAINT_NAME", "CONSTRAINT_SCHEMA", "CONSTRAINTS", "CONSTRUCTOR", "CONTAINS", "CONTAINSTABLE", "CONTINUE", "CONVERSION", "CONVERT", "COPY", "CORR", "CORRESPONDING", "COUNT", "COVAR_POP", "COVAR_SAMP", "CREATE", "CREATEDB", "CREATEROLE", "CREATEUSER", "CROSS", "CSV", "CUBE", "CUME_DIST", "CURRENT", "CURRENT_DATE", "CURRENT_DEFAULT_TRANSFORM_GROUP", "CURRENT_PATH", "CURRENT_ROLE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_TRANSFORM_GROUP_FOR_TYPE", "CURRENT_USER", "CURSOR", "CURSOR_NAME", "CYCLE", "DATA", "DATABASE", "DATABASES", "DATE", "DATETIME", "DATETIME_INTERVAL_CODE", "DATETIME_INTERVAL_PRECISION", "DAY", "DAY_HOUR", "DAY_MICROSECOND", "DAY_MINUTE", "DAY_SECOND", "DAYOFMONTH", "DAYOFWEEK", "DAYOFYEAR", "DBCC", "DEALLOCATE", "DEC", "DECIMAL", "DECLARE", "DEFAULT", "DEFAULTS", "DEFERRABLE", "DEFERRED", "DEFINED", "DEFINER", "DEGREE", "DELAY_KEY_WRITE", "DELAYED", "DELETE", "DELIMITER", "DELIMITERS", "DENSE_RANK", "DENY", "DEPTH", "DEREF", "DERIVED", "DESC", "DESCRIBE", "DESCRIPTOR", "DESTROY", "DESTRUCTOR", "DETERMINISTIC", "DIAGNOSTICS", "DICTIONARY", "DISABLE", "DISCONNECT", "DISK", "DISPATCH", "DISTINCT", "DISTINCTROW", "DISTRIBUTED", "DIV", "DO", "DOMAIN", "DOUBLE", "DROP", "DUAL", "DUMMY", "DUMP", "DYNAMIC", "DYNAMIC_FUNCTION", "DYNAMIC_FUNCTION_CODE", "EACH", "ELEMENT", "ELSE", "ELSEIF", "ENABLE", "ENCLOSED", "ENCODING", "ENCRYPTED", "END", "END-EXEC", "ENUM", "EQUALS", "ERRLVL", "ESCAPE", "ESCAPED", "EVERY", "EXCEPT", "EXCEPTION", "EXCLUDE", "EXCLUDING", "EXCLUSIVE", "EXEC", "EXECUTE", "EXISTING", "EXISTS", "EXIT", "EXP", "EXPLAIN", "EXTERNAL", "EXTRACT", "FALSE", "FETCH", "FIELDS", "FILE", "FILLFACTOR", "FILTER", "FINAL", "FIRST", "FLOAT", "FLOAT4", "FLOAT8", "FLOOR", "FLUSH", "FOLLOWING", "FOR", "FORCE", "FOREIGN", "FORTRAN", "FORWARD", "FOUND", "FREE", "FREETEXT", "FREETEXTTABLE", "FREEZE", "FROM", "FULL", "FULLTEXT", "FUNCTION", "FUSION", "G", "GENERAL", "GENERATED", "GET", "GLOBAL", "GO", "GOTO", "GRANT", "GRANTED", "GRANTS", "GREATEST", "GROUP", "GROUPING", "HANDLER", "HAVING", "HEADER", "HEAP", "HIERARCHY", "HIGH_PRIORITY", "HOLD", "HOLDLOCK", "HOST", "HOSTS", "HOUR", "HOUR_MICROSECOND", "HOUR_MINUTE", "HOUR_SECOND", "IDENTIFIED", "IDENTITY", "IDENTITY_INSERT", "IDENTITYCOL", "IF", "IGNORE", "ILIKE", "IMMEDIATE", "IMMUTABLE", "IMPLEMENTATION", "IMPLICIT", "IN", "INCLUDE", "INCLUDING", "INCREMENT", "INDEX", "INDICATOR", "INFILE", "INFIX", "INHERIT", "INHERITS", "INITIAL", "INITIALIZE", "INITIALLY", "INNER", "INOUT", "INPUT", "INSENSITIVE", "INSERT", "INSERT_ID", "INSTANCE", "INSTANTIABLE", "INSTEAD", "INT", "INT1", "INT2", "INT3", "INT4", "INT8", "INTEGER", "INTERSECT", "INTERSECTION", "INTERVAL", "INTO", "INVOKER", "IS", "ISAM", "ISNULL", "ISOLATION", "ITERATE", "JOIN", "K", "KEY", "KEY_MEMBER", "KEY_TYPE", "KEYS", "KILL", "LANCOMPILER", "LANGUAGE", "LARGE", "LAST", "LAST_INSERT_ID", "LATERAL", "LEADING", "LEAST", "LEAVE", "LEFT", "LENGTH", "LESS", "LEVEL", "LIKE", "LIMIT", "LINENO", "LINES", "LISTEN", "LN", "LOAD", "LOCAL", "LOCALTIME", "LOCALTIMESTAMP", "LOCATION", "LOCATOR", "LOCK", "LOGIN", "LOGS", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY", "LOWER", "M", "MAP", "MATCH", "MATCHED", "MAX", "MAX_ROWS", "MAXEXTENTS", "MAXVALUE", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MEMBER", "MERGE", "MESSAGE_LENGTH", "MESSAGE_OCTET_LENGTH", "MESSAGE_TEXT", "METHOD", "MIDDLEINT", "MIN", "MIN_ROWS", "MINUS", "MINUTE", "MINUTE_MICROSECOND", "MINUTE_SECOND", "MINVALUE", "MLSLABEL", "MOD", "MODE", "MODIFIES", "MODIFY", "MODULE", "MONTH", "MONTHNAME", "MORE", "MOVE", "MULTISET", "MUMPS", "MYISAM", "NAMES", "NATIONAL", "NATURAL", "NCHAR", "NCLOB", "NESTING", "NEW", "NEXT", "NO", "NO_WRITE_TO_BINLOG", "NOAUDIT", "NOCHECK", "NOCOMPRESS", "NOCREATEDB", "NOCREATEROLE", "NOCREATEUSER", "NOINHERIT", "NOLOGIN", "NONCLUSTERED", "NONE", "NORMALIZE", "NORMALIZED", "NOSUPERUSER", "NOT", "NOTHING", "NOTIFY", "NOTNULL", "NOWAIT", "NULL", "NULLABLE", "NULLIF", "NULLS", "NUMBER", "NUMERIC", "OBJECT", "OCTET_LENGTH", "OCTETS", "OF", "OFF", "OFFLINE", "OFFSET", "OFFSETS", "OIDS", "OLD", "ON", "ONLINE", "ONLY", "OPEN", "OPENDATASOURCE", "OPENQUERY", "OPENROWSET", "OPENXML", "OPERATION", "OPERATOR", "OPTIMIZE", "OPTION", "OPTIONALLY", "OPTIONS", "OR", "ORDER", "ORDERING", "ORDINALITY", "OTHERS", "OUT", "OUTER", "OUTFILE", "OUTPUT", "OVER", "OVERLAPS", "OVERLAY", "OVERRIDING", "OWNER", "PACK_KEYS", "PAD", "PARAMETER", "PARAMETER_MODE", "PARAMETER_NAME", "PARAMETER_ORDINAL_POSITION", "PARAMETER_SPECIFIC_CATALOG", "PARAMETER_SPECIFIC_NAME", "PARAMETER_SPECIFIC_SCHEMA", "PARAMETERS", "PARTIAL", "PARTITION", "PASCAL", "PASSWORD", "PATH", "PCTFREE", "PERCENT", "PERCENT_RANK", "PERCENTILE_CONT", "PERCENTILE_DISC", "PLACING", "PLAN", "PLI", "POSITION", "POSTFIX", "POWER", "PRECEDING", "PRECISION", "PREFIX", "PREORDER", "PREPARE", "PREPARED", "PRESERVE", "PRIMARY", "PRINT", "PRIOR", "PRIVILEGES", "PROC", "PROCEDURAL", "PROCEDURE", "PROCESS", "PROCESSLIST", "PUBLIC", "PURGE", "QUOTE", "RAID0", "RAISERROR", "RANGE", "RANK", "RAW", "READ", "READS", "READTEXT", "REAL", "RECHECK", "RECONFIGURE", "RECURSIVE", "REF", "REFERENCES", "REFERENCING", "REGEXP", "REGR_AVGX", "REGR_AVGY", "REGR_COUNT", "REGR_INTERCEPT", "REGR_R2", "REGR_SLOPE", "REGR_SXX", "REGR_SXY", "REGR_SYY", "REINDEX", "RELATIVE", "RELEASE", "RELOAD", "RENAME", "REPEAT", "REPEATABLE", "REPLACE", "REPLICATION", "REQUIRE", "RESET", "RESIGNAL", "RESOURCE", "RESTART", "RESTORE", "RESTRICT", "RESULT", "RETURN", "RETURNED_CARDINALITY", "RETURNED_LENGTH", "RETURNED_OCTET_LENGTH", "RETURNED_SQLSTATE", "RETURNS", "REVOKE", "RIGHT", "RLIKE", "ROLE", "ROLLBACK", "ROLLUP", "ROUTINE", "ROUTINE_CATALOG", "ROUTINE_NAME", "ROUTINE_SCHEMA", "ROW", "ROW_COUNT", "ROW_NUMBER", "ROWCOUNT", "ROWGUIDCOL", "ROWID", "ROWNUM", "ROWS", "RULE", "SAVE", "SAVEPOINT", "SCALE", "SCHEMA", "SCHEMA_NAME", "SCHEMAS", "SCOPE", "SCOPE_CATALOG", "SCOPE_NAME", "SCOPE_SCHEMA", "SCROLL", "SEARCH", "SECOND", "SECOND_MICROSECOND", "SECTION", "SECURITY", "SELECT", "SELF", "SENSITIVE", "SEPARATOR", "SEQUENCE", "SERIALIZABLE", "SERVER_NAME", "SESSION", "SESSION_USER", "SET", "SETOF", "SETS", "SETUSER", "SHARE", "SHOW", "SHUTDOWN", "SIGNAL", "SIMILAR", "SIMPLE", "SIZE", "SMALLINT", "SOME", "SONAME", "SOURCE", "SPACE", "SPATIAL", "SPECIFIC", "SPECIFIC_NAME", "SPECIFICTYPE", "SQL", "SQL_BIG_RESULT", "SQL_BIG_SELECTS", "SQL_BIG_TABLES", "SQL_CALC_FOUND_ROWS", "SQL_LOG_OFF", "SQL_LOG_UPDATE", "SQL_LOW_PRIORITY_UPDATES", "SQL_SELECT_LIMIT", "SQL_SMALL_RESULT", "SQL_WARNINGS", "SQLCA", "SQLCODE", "SQLERROR", "SQLEXCEPTION", "SQLSTATE", "SQLWARNING", "SQRT", "SSL", "STABLE", "START", "STARTING", "STATE", "STATEMENT", "STATIC", "STATISTICS", "STATUS", "STDDEV_POP", "STDDEV_SAMP", "STDIN", "STDOUT", "STORAGE", "STRAIGHT_JOIN", "STRICT", "STRING", "STRUCTURE", "STYLE", "SUBCLASS_ORIGIN", "SUBLIST", "SUBMULTISET", "SUBSTRING", "SUCCESSFUL", "SUM", "SUPERUSER", "SYMMETRIC", "SYNONYM", "SYSDATE", "SYSID", "SYSTEM", "SYSTEM_USER", "TABLE", "TABLE_NAME", "TABLES", "TABLESAMPLE", "TABLESPACE", "TEMP", "TEMPLATE", "TEMPORARY", "TERMINATE", "TERMINATED", "TEXT", "TEXTSIZE", "THAN", "THEN", "TIES", "TIME", "TIMESTAMP", "TIMEZONE_HOUR", "TIMEZONE_MINUTE", "TINYBLOB", "TINYINT", "TINYTEXT", "TO", "TOAST", "TOP", "TOP_LEVEL_COUNT", "TRAILING", "TRAN", "TRANSACTION", "TRANSACTION_ACTIVE", "TRANSACTIONS_COMMITTED", "TRANSACTIONS_ROLLED_BACK", "TRANSFORM", "TRANSFORMS", "TRANSLATE", "TRANSLATION", "TREAT", "TRIGGER", "TRIGGER_CATALOG", "TRIGGER_NAME", "TRIGGER_SCHEMA", "TRIM", "TRUE", "TRUNCATE", "TRUSTED", "TSEQUAL", "TYPE", "UESCAPE", "UID", "UNBOUNDED", "UNCOMMITTED", "UNDER", "UNDO", "UNENCRYPTED", "UNION", "UNIQUE", "UNKNOWN", "UNLISTEN", "UNLOCK", "UNNAMED", "UNNEST", "UNSIGNED", "UNTIL", "UPDATE", "UPDATETEXT", "UPPER", "USAGE", "USE", "USER", "USER_DEFINED_TYPE_CATALOG", "USER_DEFINED_TYPE_CODE", "USER_DEFINED_TYPE_NAME", "USER_DEFINED_TYPE_SCHEMA", "USING", "UTC_DATE", "UTC_TIME", "UTC_TIMESTAMP", "VACUUM", "VALID", "VALIDATE", "VALIDATOR", "VALUE", "VALUES", "VAR_POP", "VAR_SAMP", "VARBINARY", "VARCHAR", "VARCHAR2", "VARCHARACTER", "VARIABLE", "VARIABLES", "VARYING", "VERBOSE", "VIEW", "VOLATILE", "WAITFOR", "WHEN", "WHENEVER", "WHERE", "WHILE", "WIDTH_BUCKET", "WINDOW", "WITH", "WITHIN", "WITHOUT", "WORK", "WRITE", "WRITETEXT", "X509", "XOR", "YEAR", "YEAR_MONTH", "ZEROFILL", "ZONE"];
-
- var operators = ["=", "!=", "<", ">", "<=", ">=", "+", "-", "*", "/", "%"];
-
- brush.push(operators, {klass: 'operator'});
-
- brush.push(Syntax.lib.sqlStyleComment);
-
- brush.push(keywords, {klass: 'keyword', options: 'gi'});
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- brush.push(Syntax.lib.webLink);
-});
-
diff --git a/js/jquery.syntax.brush.super-collider.js b/js/jquery.syntax.brush.super-collider.js
deleted file mode 100644
index 4064ce18..00000000
--- a/js/jquery.syntax.brush.super-collider.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// brush: "super-collider" aliases: ["sc"]
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('super-collider', function(brush) {
- var keywords = ["const", "arg", "classvar", "var"];
- brush.push(keywords, {klass: 'keyword'});
-
- var operators = ["`", "+", "@", ":", "*", "/", "-", "&", "|", "~", "!", "%", "<", "=", ">"];
- brush.push(operators, {klass: 'operator'});
-
- var values = ["thisFunctionDef", "thisFunction", "thisMethod", "thisProcess", "thisThread", "this", "super", "true", "false", "nil", "inf"];
- brush.push(values, {klass: 'constant'});
-
- brush.push(Syntax.lib.camelCaseType);
-
- // Single Characters
- brush.push({
- pattern: /\$(\\)?./g,
- klass: "constant"
- });
-
- // Symbols
- brush.push({
- pattern: /\\[a-z_][a-z0-9_]*/gi,
- klass: "symbol"
- });
-
- brush.push({
- pattern: /'[^']+'/g,
- klass: "symbol"
- });
-
- // Comments
- brush.push(Syntax.lib.cStyleComment);
- brush.push(Syntax.lib.cppStyleComment);
- brush.push(Syntax.lib.webLink);
-
- // Strings
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
- brush.push(Syntax.lib.stringEscape);
-
- // Numbers
- brush.push(Syntax.lib.decimalNumber);
- brush.push(Syntax.lib.hexNumber);
-
- // Functions
- brush.push({
- pattern: /(?:\.)([a-z_][a-z0-9_]*)/gi,
- matches: Syntax.extractMatches({klass: 'function'})
- });
-
- brush.push(Syntax.lib.cStyleFunction);
-});
diff --git a/js/jquery.syntax.brush.xml.js b/js/jquery.syntax.brush.xml.js
deleted file mode 100644
index 03bbbf2e..00000000
--- a/js/jquery.syntax.brush.xml.js
+++ /dev/null
@@ -1,50 +0,0 @@
-// brush: "xml" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.lib.xmlEntity = {pattern: /&\w+;/g, klass: 'entity'};
-Syntax.lib.xmlPercentEscape = {pattern: /(%[0-9a-f]{2})/gi, klass: 'percent-escape', only: ['string']};
-
-Syntax.register('xml-tag', function(brush) {
- brush.push({
- pattern: /<\/?((?:[^:\s>]+:)?)([^\s>]+)(\s[^>]*)?\/?>/g,
- matches: Syntax.extractMatches({klass: 'namespace'}, {klass: 'tag-name'})
- });
-
- brush.push({
- pattern: /([^=\s]+)=(".*?"|'.*?'|[^\s>]+)/g,
- matches: Syntax.extractMatches({klass: 'attribute', only: ['tag']}, {klass: 'string', only: ['tag']})
- });
-
- brush.push(Syntax.lib.xmlEntity);
- brush.push(Syntax.lib.xmlPercentEscape);
-
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
-});
-
-Syntax.register('xml', function(brush) {
- brush.push({
- pattern: /(<!(\[CDATA\[)([\s\S]*?)(\]\])>)/gm,
- matches: Syntax.extractMatches(
- {klass: 'cdata', allow: ['cdata-content', 'cdata-tag']},
- {klass: 'cdata-tag'},
- {klass: 'cdata-content'},
- {klass: 'cdata-tag'}
- )
- });
-
- brush.push(Syntax.lib.xmlComment);
-
- brush.push({
- pattern: /<[^>\-\s]([^>'"!\/;\?@\[\]^`\{\}\|]|"[^"]*"|'[^']')*[\/?]?>/g,
- brush: 'xml-tag'
- });
-
- brush.push(Syntax.lib.xmlEntity);
- brush.push(Syntax.lib.xmlPercentEscape);
-
- brush.push(Syntax.lib.webLink);
-});
diff --git a/js/jquery.syntax.brush.yaml.js b/js/jquery.syntax.brush.yaml.js
deleted file mode 100644
index 9920770e..00000000
--- a/js/jquery.syntax.brush.yaml.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// brush: "yaml" aliases: []
-
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.register('yaml', function(brush) {
- brush.push({
- pattern: /^\s*#.*$/gm,
- klass: 'comment',
- allow: ['href']
- });
-
- brush.push(Syntax.lib.singleQuotedString);
- brush.push(Syntax.lib.doubleQuotedString);
-
- brush.push({
- pattern: /(&|\*)[a-z0-9]+/gi,
- klass: 'constant'
- });
-
- brush.push({
- pattern: /(.*?):/gi,
- matches: Syntax.extractMatches({klass: 'keyword'})
- });
-
- brush.push(Syntax.lib.webLink);
-});
-
diff --git a/js/jquery.syntax.core.js b/js/jquery.syntax.core.js
deleted file mode 100644
index ecc71f83..00000000
--- a/js/jquery.syntax.core.js
+++ /dev/null
@@ -1,1177 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-if (!RegExp.prototype.indexOf) {
- RegExp.indexOf = function (match, index) {
- return match[0].indexOf(match[index]) + match.index;
- };
-}
-
-if (!RegExp.prototype.escape) {
- RegExp.escape = function (pattern) {
- return pattern.replace(/[\-\[\]{}()*+?.\\\^$|,#\s]/g, "\\$&");
- };
-}
-
-if (!String.prototype.repeat) {
- String.prototype.repeat = function(l) {
- return new Array(l+1).join(this);
- };
-}
-
-// Return the inner text of an element - must preserve whitespace.
-// Avoid returning \r characters.
-Syntax.innerText = function(element) {
- var text;
-
- if (!element) {
- return "";
- }
-
- if (element.nodeName == 'BR') {
- return '\n';
- } else if (element.textContent) {
- // W3C: FF, Safari, Chrome, etc.
- text = element.textContent;
- } else if (document.body.innerText) {
- // IE, other older browsers.
- text = element.innerText;
- }
-
- return text.replace(/\r\n?/g, '\n');
-}
-
-// Convert to stack based implementation
-Syntax.extractElementMatches = function (elems, offset, tabWidth) {
- var matches = [], current = [elems];
- offset = offset || 0;
- tabWidth = tabWidth || 4;
-
- (function (elems) {
- for (var i = 0; elems[i]; i++) {
- var text = null, elem = elems[i];
-
- if (elem.nodeType === 3 || elem.nodeType === 4) {
- offset += elem.nodeValue.length;
-
- } else if (elem.nodeType === 1) {
- var text = Syntax.innerText(elem);
-
- matches.push(new Syntax.Match(offset, text.length, {
- klass: elem.className,
- force: true,
- element: elem,
- allow: '*'
- }, text));
- }
-
- // Traverse everything, except comment nodes
- if (elem.nodeType !== 8 && elem.children) {
- arguments.callee(elem.childNodes, offset);
- }
- }
- })(elems);
-
- // Remove the top level element, since this will be recreated based on the supplied configuration.
- // Maybe there is a better way to achieve this?
- matches.shift();
-
- return matches;
-}
-
-// Basic layout doesn't do anything e.g. identity layout.
-Syntax.layouts.preformatted = function (options, html, container) {
- return html;
-};
-
-Syntax.modeLineOptions = {
- 'tab-width': function(name, value, options) { options.tabWidth = parseInt(value, 10); }
-};
-
-// Should be obvious right?
-Syntax.convertTabsToSpaces = function (text, tabSize) {
- var space = [], pattern = /\r|\n|\t/g, tabOffset = 0, offsets = [], totalOffset = 0;
- tabSize = tabSize || 4
-
- for (var i = ""; i.length <= tabSize; i = i + " ") {
- space.push(i);
- }
-
- text = text.replace(pattern, function(match) {
- var offset = arguments[arguments.length - 2];
- if (match === "\r" || match === "\n") {
- tabOffset = -(offset + 1);
- return match;
- } else {
- var width = tabSize - ((tabOffset + offset) % tabSize);
- tabOffset += width - 1;
-
- // Any match after this offset has been shifted right by totalOffset
- totalOffset += width - 1
- offsets.push([offset, width, totalOffset]);
-
- return space[width];
- }
- });
-
- return {text: text, offsets: offsets};
-};
-
-// This function converts from a compressed set of offsets of the form:
-// [
-// [offset, width, totalOffset],
-// ...
-// ]
-// This means that at a $offset, a tab (single character) was expanded to $width
-// single space characters.
-// This function produces a lookup table of offsets, where a given character offset
-// is mapped to how far the character has been offset.
-Syntax.convertToLinearOffsets = function (offsets, length) {
- var current = 0, changes = [];
-
- // Anything with offset after offset[current][0] but smaller than offset[current+1][0]
- // has been shifted right by offset[current][2]
- for (var i = 0; i < length; i++) {
- if (offsets[current] && i > offsets[current][0]) {
- // Is there a next offset?
- if (offsets[current+1]) {
- // Is the index less than the start of the next offset?
- if (i <= offsets[current+1][0]) {
- changes.push(offsets[current][2]);
- } else {
- // If so, move to the next offset.
- current += 1;
- i -= 1;
- }
- } else {
- // If there is no next offset we assume this one to the end.
- changes.push(offsets[current][2]);
- }
- } else {
- changes.push(changes[changes.length-1] || 0);
- }
- }
-
- return changes;
-}
-
-// Used for tab expansion process, by shifting matches when tab charaters were converted to
-// spaces.
-Syntax.updateMatchesWithOffsets = function (matches, linearOffsets, text) {
- (function (matches) {
- for (var i = 0; i < matches.length; i++) {
- var match = matches[i];
-
- // Calculate the new start and end points
- var offset = match.offset + linearOffsets[match.offset];
- var end = match.offset + match.length;
- end += linearOffsets[end];
-
- // Start, Length, Text
- match.adjust(linearOffsets[match.offset], end - offset, text);
-
- if (match.children.length > 0)
- arguments.callee(match.children);
- }
- })(matches);
-
- return matches;
-};
-
-// A helper function which automatically matches expressions with capture groups from the regular expression match.
-// Each argument position corresponds to the same index regular expression group.
-// Or, override by providing rule.index
-Syntax.extractMatches = function() {
- var rules = arguments;
-
- return function(match, expr) {
- var matches = [];
-
- for (var i = 0; i < rules.length; i += 1) {
- var rule = rules[i], index = i+1;
-
- if (rule == null) {
- continue;
- }
-
- if (typeof(rule.index) != 'undefined') {
- index = rule.index;
- }
-
- if (rule.debug) {
- Syntax.log("extractMatches", rule, index, match[index], match);
- }
-
- if (match[index].length > 0) {
- if (rule.brush) {
- matches.push(Syntax.Brush.buildTree(rule, match[index], RegExp.indexOf(match, index)));
- } else {
- var expression = jQuery.extend({owner: expr.owner}, rule);
-
- matches.push(new Syntax.Match(RegExp.indexOf(match, index), match[index].length, expression, match[index]));
- }
- }
- }
-
- return matches;
- };
-};
-
-// Used to create processing functions that automatically link to remote documentation.
-Syntax.lib.webLinkProcess = function (queryURI, lucky) {
- if (lucky) {
- queryURI = "http://www.google.com/search?btnI=I&q=" + encodeURIComponent(queryURI + " ");
- }
-
- return function (element, match, options) {
- // Per-code block linkification control.
- if (options.linkify === false)
- return element;
-
- var a = document.createElement('a');
- a.href = queryURI + encodeURIComponent(Syntax.innerText(element));
- a.className = element.className;
-
- // Move children from <element> to <a>
- while (element.childNodes.length > 0)
- a.appendChild(element.childNodes[0]);
-
- return a;
- };
-};
-
-// Global brush registration function.
-Syntax.register = function (name, callback) {
- var brush = Syntax.brushes[name] = new Syntax.Brush();
- brush.klass = name;
-
- callback(brush);
-};
-
-// Library of helper patterns
-Syntax.lib.cStyleComment = {pattern: /\/\*[\s\S]*?\*\//gm, klass: 'comment', allow: ['href']};
-Syntax.lib.cppStyleComment = {pattern: /\/\/.*$/gm, klass: 'comment', allow: ['href']};
-Syntax.lib.perlStyleComment = {pattern: /#.*$/gm, klass: 'comment', allow: ['href']};
-
-Syntax.lib.perlStyleRegularExpression = {pattern: /\B\/([^\/]|\\\/)*?\/[a-z]*(?=\s*($|[^\w\s'"\(]))/gm, klass: 'constant', incremental: true};
-
-Syntax.lib.cStyleFunction = {pattern: /([a-z_][a-z0-9_]*)\s*\(/gi, matches: Syntax.extractMatches({klass: 'function'})};
-Syntax.lib.camelCaseType = {pattern: /\b_*[A-Z][\w]*\b/g, klass: 'type'};
-Syntax.lib.cStyleType = {pattern: /\b[_a-z][_\w]*_t\b/gi, klass: 'type'};
-
-Syntax.lib.xmlComment = {pattern: /(&lt;|<)!--[\s\S]*?--(&gt;|>)/gm, klass: 'comment'};
-Syntax.lib.webLink = {pattern: /\w+:\/\/[\w\-.\/?%&=@:;#]*/g, klass: 'href'};
-
-Syntax.lib.hexNumber = {pattern: /\b0x[0-9a-fA-F]+/g, klass: 'constant'};
-Syntax.lib.decimalNumber = {pattern: /\b[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/g, klass: 'constant'};
-
-Syntax.lib.doubleQuotedString = {pattern: /"([^\\"\n]|\\.)*"/g, klass: 'string'};
-Syntax.lib.singleQuotedString = {pattern: /'([^\\'\n]|\\.)*'/g, klass: 'string'};
-Syntax.lib.multiLineDoubleQuotedString = {pattern: /"([^\\"]|\\.)*"/g, klass: 'string'};
-Syntax.lib.multiLineSingleQuotedString = {pattern: /'([^\\']|\\.)*'/g, klass: 'string'};
-Syntax.lib.stringEscape = {pattern: /\\./g, klass: 'escape', only: ['string']};
-
-// Main match constructor. Make sure value is the correct size.
-Syntax.Match = function (offset, length, expression, value) {
- this.offset = offset;
- this.endOffset = offset + length;
- this.length = length;
- this.expression = expression;
- this.value = value;
- this.children = [];
- this.parent = null;
-
- // When a node is bisected, this points to the next part.
- this.next = null;
-};
-
-// Shifts an entire tree forward or backwards.
-Syntax.Match.prototype.shift = function (offset, text) {
- this.adjust(offset, null, text);
-
- for (var i = 0; i < this.children.length; i++) {
- this.children[i].shift(offset, text)
- }
-};
-
-// C the current match to have different offset and length.
-Syntax.Match.prototype.adjust = function (offset, length, text) {
- this.offset += offset;
- this.endOffset += offset;
-
- if (length) {
- this.length = length;
- this.endOffset = this.offset + length;
- }
-
- if (text) {
- this.value = text.substr(this.offset, this.length);
- }
-};
-
-// Sort helper for sorting matches in forward order (e.g. same as the text that they were extracted from)
-Syntax.Match.sort = function (a,b) {
- return (a.offset - b.offset) || (b.length - a.length);
-};
-
-// Is the given match contained in the range of the parent match?
-Syntax.Match.prototype.contains = function (match) {
- return (match.offset >= this.offset) && (match.endOffset <= this.endOffset);
-};
-
-// Reduce a givent tree node into an html node.
-Syntax.Match.defaultReduceCallback = function (node, container) {
- // We avoid using jQuery in this function since it is incredibly performance sensitive.
- // Using jQuery jQuery.fn.append() can reduce performance by as much as 1/3rd.
- if (typeof(node) === 'string') {
- node = document.createTextNode(node);
- }
-
- container.appendChild(node);
-};
-
-// Convert a tree of matches into some flat form (typically HTML nodes).
-Syntax.Match.prototype.reduce = function (append, process) {
- var start = this.offset;
- var container = document.createElement('span');
-
- append = append || Syntax.Match.defaultReduceCallback;
-
- if (this.expression && this.expression.klass) {
- if (container.className.length > 0)
- container.className += ' ';
-
- container.className += this.expression.klass;
- }
-
- for (var i = 0; i < this.children.length; i += 1) {
- var child = this.children[i], end = child.offset;
-
- if (child.offset < this.offset) {
- Syntax.log("Syntax Warning: Offset of child", child, "is before offset of parent", this);
- }
-
- var text = this.value.substr(start - this.offset, end - start);
-
- append(text, container);
- append(child.reduce(append, process), container);
-
- start = child.endOffset;
- }
-
- if (start === this.offset) {
- append(this.value, container);
- } else if (start < this.endOffset) {
- append(this.value.substr(start - this.offset, this.endOffset - start), container);
- } else if (start > this.endOffset) {
- Syntax.log("Syntax Warning: Start position " + start + " exceeds end of value " + this.endOffset);
- }
-
- if (process) {
- container = process(container, this);
- }
-
- return container;
-};
-
-// Main nesting check - can a match contain the given match?
-Syntax.Match.prototype.canContain = function (match) {
- // This is a special conditional for explicitly added ranges by the user.
- // Since user added it, we honour it no matter what.
- if (match.expression.force) {
- return true;
- }
-
- // Can't add anything into complete trees.
- if (this.complete) {
- return false;
- }
-
- // match.expression.only will be checked on insertion using this.canHaveChild(match)
- if (match.expression.only) {
- return true;
- }
-
- // If allow is undefined, default behaviour is no children.
- if (typeof(this.expression.allow) === 'undefined') {
- return false;
- }
-
- // false if {disallow: [..., klass, ...]}
- if (jQuery.isArray(this.expression.disallow) && jQuery.inArray(match.expression.klass, this.expression.disallow) !== -1) {
- return false;
- }
-
- // true if {allow: '*'}
- if (this.expression.allow === '*') {
- return true;
- }
-
- // true if {allow: [..., klass, ...]}
- if (jQuery.isArray(this.expression.allow) && jQuery.inArray(match.expression.klass, this.expression.allow) !== -1) {
- return true;
- }
-
- return false;
-};
-
-// Return true if the given match can be spliced in as a child.
-// Checked automatically when calling _splice.
-Syntax.Match.prototype.canHaveChild = function(match) {
- var only = match.expression.only;
-
- // This condition is fairly slow
- if (only) {
- var cur = this;
-
- while (cur !== null) {
- if (jQuery.inArray(cur.expression.klass, only) !== -1) {
- return true;
- }
-
- cur = cur.parent;
-
- // We don't traverse into other trees.
- if (cur && cur.complete) {
- break;
- }
- }
-
- return false;
- }
-
- return true;
-};
-
-// Add a child into the list of children for a given match, if it is acceptable to do so.
-// Updates the owner of the match.
-// Returns null if splice failed.
-Syntax.Match.prototype._splice = function(i, match) {
- if (this.canHaveChild(match)) {
- this.children.splice(i, 0, match);
- match.parent = this;
-
- // For matches added using tags.
- if (!match.expression.owner) {
- match.expression.owner = this.expression.owner;
- }
-
- return this;
- } else {
- return null;
- }
-};
-
-// This function implements a full insertion procedure, and will break up the match to fit.
-// This operation is potentially very expensive, but is used to insert custom ranges into
-// the tree, if they are specified by the user. A custom <span> may cover multiple leafs in
-// the tree, thus some parts of the tree may need to be split. This behavior is controlled
-// by whole - if true, the tree is split, if false, the match is split.
-// You should avoid using this function except in very specific cases.
-Syntax.Match.prototype.insert = function(match, whole) {
- if (!this.contains(match))
- return null;
-
- if (whole) {
- var top = this, i = 0;
- while (i < top.children.length) {
- if (top.children[i].contains(match)) {
- top = top.children[i];
- i = 0;
- } else {
- i += 1;
- }
- }
-
- return top._insertWhole(match);
- } else {
- return this._insert(match);
- }
-}
-
-Syntax.Match.prototype._insertWhole = function(match) {
- var parts = this.bisectAtOffsets([match.offset, match.endOffset])
- this.children = [];
-
- if (parts[0]) {
- this.children = this.children.concat(parts[0].children);
- }
-
- if (parts[1]) {
- match.children = [];
-
- // Update the match's expression based on the current position in the tree:
- if (this.expression && this.expression.owner) {
- match.expression = this.expression.owner.getRuleForKlass(match.expression.klass) || match.expression;
- }
-
- // This probably isn't ideal, it would be better to convert all children and children-of-children
- // into a linear array and reinsert - it would be slightly more accurate in many cases.
- for (var i = 0; i < parts[1].children.length; i += 1) {
- var child = parts[1].children[i];
-
- if (match.canContain(child)) {
- match.children.push(child);
- }
- }
-
- this.children.push(match);
- }
-
- if (parts[2]) {
- this.children = this.children.concat(parts[2].children);
- }
-
- return this;
-}
-
-// This is not a general tree insertion function. It is optimised to run in almost constant
-// time, but data must be inserted in sorted order, otherwise you will have problems.
-// This function also ensures that matches won't be broken up unless absolutely necessary.
-Syntax.Match.prototype.insertAtEnd = function(match) {
- if (!this.contains(match)) {
- Syntax.log("Syntax Error: Child is not contained in parent node!");
- return null;
- }
-
- if (!this.canContain(match)) {
- return null;
- }
-
- if (this.children.length > 0) {
- var i = this.children.length-1;
- var child = this.children[i];
-
- if (match.offset < child.offset) {
- // Displacement: Before or LHS Overlap
- // This means that the match has actually occurred before the last child.
- // This is a bit of an unusual situation because the matches SHOULD be in
- // sorted order.
- // However, we are sure that the match is contained in this node. This situation
- // sometimes occurs when sorting existing branches with matches that are supposed
- // to be within that branch. When we insert the match into the branch, there are
- // matches that technically should have been inserted afterwards.
- // Normal usage should avoid this case, and this is best for performance.
- if (match.force) {
- return this._insert(match);
- } else {
- return null;
- }
- } else if (match.offset < child.endOffset) {
- if (match.endOffset <= child.endOffset) {
- // Displacement: Contains
- //console.log("displacement => contains");
- var result = child.insertAtEnd(match);
- return result;
- } else {
- // Displacement: RHS Overlap
- if (match.force) {
- return this._insert(match);
- } else {
- return null;
- }
- }
- } else {
- // Displacement: After
- return this._splice(i+1, match);
- }
-
- // Could not find a suitable placement: this is probably an error.
- return null;
- } else {
- // Displacement: Contains [but currently no children]
- return this._splice(0, match);
- }
-};
-
-// This insertion function is relatively complex because it is required to split the match over
-// several children. This function is used infrequently and is mostly for completeness. However,
-// it might be possible to remove it to reduce code.
-Syntax.Match.prototype._insert = function(match) {
- if (this.children.length == 0)
- return this._splice(0, match);
-
- for (var i = 0; i < this.children.length; i += 1) {
- var child = this.children[i];
-
- // If the match ends before this child, it must be before it.
- if (match.endOffset <= child.offset)
- return this._splice(i, match);
-
- // If the match starts after this child, we continue.
- if (match.offset >= child.endOffset)
- continue;
-
- // There are four possibilities...
- // ... with the possibility of overlapping children on the RHS.
- // {------child------} {---possibly some other child---}
- // |----------complete overlap---------|
- // |--lhs overlap--|
- // |--contains--|
- // |--rhs overlap--|
-
- // First, the easiest case:
- if (child.contains(match)) {
- return child._insert(match);
- }
-
- // console.log("Bisect at offsets", match, child.offset, child.endOffset);
- var parts = match.bisectAtOffsets([child.offset, child.endOffset]);
- // console.log("parts =", parts);
- // We now have at most three parts
- // {------child------} {---possibly some other child---}
- // |--[0]--|-------[1]-------|--[2]--|
-
- // console.log("parts", parts);
-
- if (parts[0]) {
- this._splice(i, parts[0])
- }
-
- if (parts[1]) {
- child.insert(parts[1])
- }
-
- // Continue insertion at this level with remainder.
- if (parts[2]) {
- match = parts[2]
- } else {
- return this;
- }
- }
-
- // If we got this far, the match wasn't [completely] inserted into the list of existing children, so it must be on the end.
- this._splice(this.children.length, match);
-}
-
-// This algorithm recursively bisects the tree at a given offset, but it does this efficiently by folding multiple bisections
-// at a time.
-// Splits: / / /
-// Tree: |-------------------------Top-------------------------|
-// |------------A--------------------| |------C-------|
-// |-------B----------|
-// Step (1):
-// Split Top into 4 parts:
-// |------/----------------/-------------------/---------|
-// For each part, check if there are any children that cover this part.
-// If there is a child, recursively call bisect with all splits.
-// Step (1-1):
-// Split A into parts:
-// |------/-----A----------/---------|
-// For each part, check if there are any children that cover this part.
-// If there is a child, recursively call bisect with all splits.
-// Step (1-1-1):
-// Split B into parts:
-// |-------B---/------|
-// No children covered by split. Return array of two parts, B1, B2.
-// Step (1-2):
-// Enumerate the results of splitting the child and merge piece-wise into own parts
-// |------/-----A----------/---------|
-// |------B1---|--B2--|
-// Finished merging children, return array of three parts, A1, A2, A3
-// Step (2):
-// Enumerate the results of splitting the child and merge piece-wise into own parts.
-// |------/----------------/-------------------/---------|
-// |--A1--|-------A2-------|----A3---|
-// |------B1---|--B2--|
-// Continue by splitting next child, C.
-// Once all children have been split and merged, return all parts, T1, T2, T3, T4.
-// The new tree:
-// |--T1--|-------T2-------|--------T3---------|---T4---|
-// |--A1--|-------A2-------|----A3---| |--C1--|---C2--|
-// |------B1---|--B2--|
-//
-// The new structure is as follows:
-// T1 <- A1
-// T2 <- A2 <- B1
-// T3 <- A3 <- B2
-// \- C1
-// T4 <- C2
-//
-Syntax.Match.prototype.bisectAtOffsets = function(splits) {
- var parts = [], start = this.offset, prev = null, children = jQuery.merge([], this.children);
-
- // Copy the array so we can modify it.
- splits = splits.slice(0);
-
- // We need to split including the last part.
- splits.push(this.endOffset);
-
- splits.sort(function (a,b) {
- return a-b;
- });
-
- // We build a set of top level matches by looking at each split point and
- // creating a new match from the end of the previous match to the split point.
- for (var i = 0; i < splits.length; i += 1) {
- var offset = splits[i];
-
- // The split offset is past the end of the match, so there are no more possible
- // splits.
- if (offset > this.endOffset) {
- break;
- }
-
- // We keep track of null parts if the offset is less than the start
- // so that things align up as expected with the requested splits.
- if (
- offset < this.offset // If the split point is less than the start of the match.
- || (offset - start) == 0 // If the match would have effectively zero length.
- ) {
- parts.push(null); // Preserve alignment with splits.
- start = offset;
- continue;
- }
-
- // Even if the previous split was out to the left, we align up the start
- // to be at the start of the match we are bisecting.
- if (start < this.offset)
- start = this.offset;
-
- var match = new Syntax.Match(start, offset - start, this.expression);
- match.value = this.value.substr(start - this.offset, match.length);
-
- if (prev) {
- prev.next = match;
- }
-
- prev = match;
-
- start = match.endOffset;
- parts.push(match);
- }
-
- // We only need to split to produce the number of parts we have.
- splits.length = parts.length;
-
- for (var i = 0; i < parts.length; i += 1) {
- if (parts[i] == null)
- continue;
-
- var offset = splits[0];
-
- while (children.length > 0) {
- if (children[0].endOffset <= parts[i].endOffset) {
- parts[i].children.push(children.shift());
- } else {
- break;
- }
- }
-
- if (children.length) {
- // We may have an intersection
- if (children[0].offset < parts[i].endOffset) {
- var children_parts = children.shift().bisectAtOffsets(splits), j = 0;
-
- // children_parts are the bisected children which need to be merged with parts
- // in a linear fashion
- for (; j < children_parts.length; j += 1) {
- if (children_parts[j] == null) continue; // Preserve alignment with splits.
-
- parts[i+j].children.push(children_parts[j]);
- }
-
- // Skip any parts which have been populated already
- // (i is incremented at the start of the loop, splits shifted at the end)
- i += (children_parts.length-2);
- splits.splice(0, children_parts.length-2);
- }
- }
-
- splits.shift();
- }
-
- if (children.length) {
- Syntax.log("Syntax Error: Children nodes not consumed", children.length, " remaining!");
- }
-
- return parts;
-};
-
-// Split a match at points in the tree that match a specific regular expression pattern.
-// Uses the fast tree bisection algorithm, performance should be bounded O(S log N) where N is
-// the total number of matches and S is the number of splits (?).
-Syntax.Match.prototype.split = function(pattern) {
- var splits = [], match;
-
- while ((match = pattern.exec(this.value)) !== null) {
- splits.push(pattern.lastIndex);
- }
-
- var matches = this.bisectAtOffsets(splits);
-
- // Remove any null placeholders.
- return jQuery.grep(matches, function(n,i){
- return n;
- });
-};
-
-Syntax.Brush = function () {
- // The primary class of this brush. Must be unique.
- this.klass = null;
-
- // A sequential list of rules for extracting matches.
- this.rules = [];
-
- // A list of all parents that this brush derives from.
- this.parents = [];
-
- // A list of processes that may be run after extracting matches.
- this.processes = {};
-};
-
-// Add a parent to the brush. This brush should be loaded as a dependency.
-Syntax.Brush.prototype.derives = function (name) {
- this.parents.push(name);
- this.rules.push({
- apply: function(text, expr) {
- return Syntax.brushes[name].getMatches(text);
- }
- });
-}
-
-// Return an array of all classes that the brush consists of.
-// A derivied brush is its own klass + the klass of any and all parents.
-Syntax.Brush.prototype.allKlasses = function () {
- var klasses = [this.klass];
-
- for (var i = 0; i < this.parents.length; i += 1) {
- klasses = klasses.concat(Syntax.brushes[this.parents[i]].allKlasses());
- }
-
- return klasses;
-}
-
-Syntax.Brush.convertStringToTokenPattern = function (pattern, escape) {
- var prefix = "\\b", postfix = "\\b";
-
- if (!pattern.match(/^\w/)) {
- if (!pattern.match(/\w$/)) {
- prefix = postfix = "";
- } else {
- prefix = "\\B";
- }
- } else {
- if (!pattern.match(/\w$/)) {
- postfix = "\\B";
- }
- }
-
- if (escape)
- pattern = RegExp.escape(pattern)
-
- return prefix + pattern + postfix;
-}
-
-Syntax.Brush.MatchPattern = function (text, rule) {
- if (!rule.pattern)
- return [];
-
- // Duplicate the pattern so that the function is reentrant.
- var matches = [], pattern = new RegExp;
- pattern.compile(rule.pattern);
-
- while((match = pattern.exec(text)) !== null) {
- if (rule.matches) {
- matches = matches.concat(rule.matches(match, rule));
- } else if (rule.brush) {
- matches.push(Syntax.Brush.buildTree(rule, match[0], match.index));
- } else {
- matches.push(new Syntax.Match(match.index, match[0].length, rule, match[0]));
- }
-
- if (rule.incremental) {
- // Don't start scanning from the end of the match..
- pattern.lastIndex = match.index + 1;
- }
- }
-
- return matches;
-}
-
-Syntax.Brush.prototype.push = function () {
- if (jQuery.isArray(arguments[0])) {
- var patterns = arguments[0], rule = arguments[1];
-
- var all = "(";
-
- for (var i = 0; i < patterns.length; i += 1) {
- if (i > 0) all += "|";
-
- var p = patterns[i];
-
- if (p instanceof RegExp) {
- all += p.source;
- } else {
- all += Syntax.Brush.convertStringToTokenPattern(p, true);
- }
- }
-
- all += ")";
-
- this.push(jQuery.extend({
- pattern: new RegExp(all, rule.options || 'g')
- }, rule));
- } else {
- var rule = arguments[0];
-
- if (typeof(rule.pattern) === 'string') {
- rule.string = rule.pattern;
- rule.pattern = new RegExp(Syntax.Brush.convertStringToTokenPattern(rule.string, true), rule.options || 'g')
- }
-
- if (typeof(XRegExp) !== 'undefined') {
- rule.pattern = new XRegExp(rule.pattern);
- }
-
- // Default pattern extraction algorithm
- rule.apply = rule.apply || Syntax.Brush.MatchPattern;
-
- if (rule.pattern && rule.pattern.global || typeof(rule.pattern) == 'undefined') {
- this.rules.push(jQuery.extend({owner: this}, rule));
- } else {
- Syntax.log("Syntax Error: Malformed rule: ", rule);
- }
- }
-};
-
-Syntax.Brush.prototype.getMatchesForRule = function (text, rule) {
- var matches = [], match = null;
-
- // Short circuit (user defined) function:
- if (typeof(rule.apply) != 'undefined') {
- matches = rule.apply(text, rule);
- }
-
- if (rule.debug) {
- Syntax.log("Syntax matches:", rule, text, matches);
- }
-
- return matches;
-};
-
-Syntax.Brush.prototype.getRuleForKlass = function (klass) {
- for (var i = 0; i < this.rules.length; i += 1) {
- if (this.rules[i].klass == klass) {
- return this.rules[i];
- }
- }
-
- return null;
-}
-
-// Get all matches from a given block of text.
-Syntax.Brush.prototype.getMatches = function(text) {
- var matches = [];
-
- for (var i = 0; i < this.rules.length; i += 1) {
- matches = matches.concat(this.getMatchesForRule(text, this.rules[i]));
- }
-
- return matches;
-};
-
-// A helper function for building a tree from a specific rule.
-// Typically used where sub-trees are required, e.g. CSS brush in HTML brush.
-Syntax.Brush.buildTree = function(rule, text, offset, additionalMatches) {
- var match = Syntax.brushes[rule.brush].buildTree(text, offset, additionalMatches);
-
- jQuery.extend(match.expression, rule);
-
- return match;
-}
-
-// This function builds a tree from a given block of text.
-// This is done by applying all rules to the text to get a complete list of matches,
-// sorting them in order, and inserting them into a syntax tree data structure.
-// Additional matches are forcefully inserted into the tree.
-// Provide an offset if the text is offset in a larger block of text. Matches
-// will be shifted along appropriately.
-Syntax.Brush.prototype.buildTree = function(text, offset, additionalMatches) {
- offset = offset || 0;
-
- // Fixes code that uses \r\n for line endings. /$/ matches both \r\n, which is a problem..
- text = text.replace(/\r/g, '');
-
- var matches = this.getMatches(text);
-
- // Shift matches if offset is provided.
- if (offset && offset > 0) {
- for (var i = 0; i < matches.length; i += 1) {
- matches[i].shift(offset);
- }
- }
-
- var top = new Syntax.Match(offset, text.length, {klass: this.allKlasses().join(" "), allow: '*', owner: this}, text);
-
- // This sort is absolutely key to the functioning of the tree insertion algorithm.
- matches.sort(Syntax.Match.sort);
-
- for (var i = 0; i < matches.length; i += 1) {
- top.insertAtEnd(matches[i]);
- }
-
- if (additionalMatches) {
- for (var i = 0; i < additionalMatches.length; i += 1) {
- top.insert(additionalMatches[i], true);
- }
- }
-
- top.complete = true;
-
- return top;
-};
-
-// This function builds a syntax tree from the given text and matches (optional).
-// The syntax tree is then flattened into html using a variety of functions.
-//
-// By default, you can't control reduction process through this function, but
-// it is possible to control the element conversion process by replace
-// .reduce(null, ...) with .reduce(reduceCallback, ...)
-// See Syntax.Match.defaultReduceCallback for more details about interface.
-//
-// Matches is optional, and provides a set of pre-existing matches to add
-// to the tree.
-// Options are passed to element level processing functions.
-Syntax.Brush.prototype.process = function(text, matches, options) {
- var top = this.buildTree(text, 0, matches);
-
- var lines = top.split(/\n/g);
-
- var html = document.createElement('pre');
- html.className = 'syntax';
-
- for (var i = 0; i < lines.length; i += 1) {
- var line = lines[i].reduce(null, function (container, match) {
- if (match.expression) {
- if (match.expression.process) {
- container = match.expression.process(container, match, options);
- }
-
- if (match.expression.owner) {
- var process = match.expression.owner.processes[match.expression.klass];
- if (process) {
- container = process(container, match, options);
- }
- }
- }
- return container;
- });
-
- html.appendChild(line);
- }
-
- return html;
-};
-
-// Highlights a given block of text with a given set of options.
-// options.brush should specify the brush to use, either by direct reference
-// or name.
-// Callback will be called with (highlighted_html, brush_used, original_text, options)
-Syntax.highlightText = function(text, options, callback) {
- var brushName = (options.brush || 'plain').toLowerCase();
-
- brushName = Syntax.aliases[brushName] || brushName;
-
- Syntax.brushes.get(brushName, function(brush) {
- if (options.tabWidth) {
- // Calculate the tab expansion and offsets
- replacement = Syntax.convertTabsToSpaces(text, options.tabWidth);
-
- // Update any existing matches
- if (options.matches && options.matches.length) {
- var linearOffsets = Syntax.convertToLinearOffsets(replacement.offsets, text.length);
- options.matches = Syntax.updateMatchesWithOffsets(options.matches, linearOffsets, replacement.text);
- }
-
- text = replacement.text;
- }
-
- var html = brush.process(text, options.matches, options);
-
- if (options.linkify !== false) {
- jQuery('span.href', html).each(function(){
- jQuery(this).replaceWith(jQuery('<a>').attr('href', this.innerHTML).text(this.innerHTML));
- });
- }
-
- callback(html, brush, text, options);
- });
-}
-
-// Highlight a given set of elements with a set of options.
-// Callback will be called once per element with (options, highlighted_html, original_container)
-Syntax.highlight = function (elements, options, callback) {
- if (typeof(options) === 'function') {
- callback = options;
- options = {};
- }
-
- options.layout = options.layout || 'preformatted';
- options.matches = [];
-
- if (typeof(options.tabWidth) === 'undefined') {
- options.tabWidth = 4;
- }
-
- elements.each(function () {
- var container = jQuery(this);
-
- // We can augment the plain text to extract existing annotations (e.g. <span class="foo">...</span>).
- options.matches = options.matches.concat(Syntax.extractElementMatches(container));
-
- var text = Syntax.innerText(this);
-
- var match = text.match(/-\*- mode: (.+?);(.*?)-\*-/i);
- var endOfSecondLine = text.indexOf("\n", text.indexOf("\n") + 1);
-
- if (match && match.index < endOfSecondLine) {
- options.brush = options.brush || match[1];
- var modeline = match[2];
-
- var mode = /([a-z\-]+)\:(.*?)\;/gi;
-
- while((match = mode.exec(modeline)) !== null) {
- var setter = Syntax.modeLineOptions[match[1]];
-
- if (setter) {
- setter(match[1], match[2], options);
- }
- }
- }
-
- Syntax.highlightText(text, options, function(html, brush/*, text, options*/) {
- Syntax.layouts.get(options.layout, function(layout) {
- html = layout(options, $(html), $(container));
-
- // If there is a theme specified, ensure it is added to the top level class.
- if (options.theme) {
- // Load dependencies
- var themes = Syntax.themes[options.theme];
- for (var i = 0; i < themes.length; i += 1) {
- html.addClass("syntax-theme-" + themes[i]);
- }
-
- // Add the base theme
- html.addClass("syntax-theme-" + options.theme);
- }
-
- if (brush.postprocess) {
- html = brush.postprocess(options, html, container);
- }
-
- if (callback) {
- html = callback(options, html, container);
- }
-
- if (html && options.replace === true) {
- container.replaceWith(html);
- }
- });
- });
- });
-};
-
-// Register the file as being loaded
-Syntax.loader.core = true;
diff --git a/js/jquery.syntax.js b/js/jquery.syntax.js
deleted file mode 100644
index 1325ea00..00000000
--- a/js/jquery.syntax.js
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
- For more information, please see http://www.oriontransfer.co.nz/software/jquery-syntax
-
- Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-/*global Function: true, ResourceLoader: true, Syntax: true, alert: false, jQuery: true */
-
-// ECMAScript 5! Why wasn't this done before!?
-if (!Function.prototype.bind) {
- Function.prototype.bind = function (target) {
- var args = Array.prototype.slice.call(arguments, 1), fn = this;
-
- return function () {
- return fn.apply(target, args);
- };
- };
-}
-
-function ResourceLoader (loader) {
- this.dependencies = {};
- this.loading = {};
- this.loader = loader;
-}
-
-ResourceLoader.prototype._finish = function (name) {
- var deps = this.dependencies[name];
-
- if (deps) {
- // I'm not sure if this makes me want to cry... or laugh... or kill!?
- var chain = this._loaded.bind(this, name);
-
- for (var i = 0; i < deps.length; i += 1) {
- chain = this.get.bind(this, deps[i], chain);
- }
-
- chain();
- } else {
- this._loaded(name);
- }
-};
-
-ResourceLoader.prototype._loaded = function (name) {
- // When the script has been succesfully loaded, we expect the script
- // to register with this loader (i.e. this[name]).
- var resource = this[name], loading = this.loading[name];
-
- // Clear the loading list
- this.loading[name] = null;
-
- if (!resource) {
- alert("ResourceLoader: Could not load resource named " + name);
- } else {
- for (var i = 0; i < loading.length; i += 1) {
- loading[i](resource);
- }
- }
-};
-
-// This function must ensure that current cannot be completely loaded until next
-// is completely loaded.
-ResourceLoader.prototype.dependency = function (current, next) {
- // If the resource has completely loaded, then we don't need to queue it
- // as a dependency
- if (this[next] && !this.loading[name]) {
- return;
- }
-
- if (this.dependencies[current]) {
- this.dependencies[current].push(next);
- } else {
- this.dependencies[current] = [next];
- }
-};
-
-// This function must be reentrant for the same name and different callbacks.
-ResourceLoader.prototype.get = function (name, callback) {
- if (this.loading[name]) {
- this.loading[name].push(callback)
- } else if (this[name]) {
- callback(this[name]);
- } else {
- this.loading[name] = [callback];
- this.loader(name, this._finish.bind(this, name));
- }
-};
-
-var Syntax = {
- root: null,
- aliases: {},
- styles: {},
- themes: {},
- lib: {},
- defaultOptions: {
- cacheScripts: true,
- cacheStyleSheets: true,
- theme: "base"
- },
-
- brushes: new ResourceLoader(function (name, callback) {
- name = Syntax.aliases[name] || name;
-
- Syntax.getResource('jquery.syntax.brush', name, callback);
- }),
-
- layouts: new ResourceLoader(function (name, callback) {
- Syntax.getResource('jquery.syntax.layout', name, callback);
- }),
-
- loader: new ResourceLoader(function (name, callback) {
- Syntax.getResource('jquery.syntax', name, callback);
- }),
-
- getStyles: function (path) {
- var link = jQuery('<link>');
- jQuery("head").append(link);
-
- if (!Syntax.defaultOptions.cacheStyleSheets) {
- path = path + "?" + Math.random()
- }
-
- link.attr({
- rel: "stylesheet",
- type: "text/css",
- href: path
- });
- },
-
- getScript: function (path, callback) {
- var script = document.createElement('script');
-
- // Internet Exploder
- script.onreadystatechange = function() {
- if (this.onload && (this.readyState == 'loaded' || this.readyState == 'complete')) {
- this.onload();
-
- // Ensure the function is only called once.
- this.onload = null;
- }
- };
-
- // Every other modern browser
- script.onload = callback;
- script.type = "text/javascript";
-
- if (!Syntax.defaultOptions.cacheScripts)
- path = path + '?' + Math.random()
-
- script.src = path;
-
- document.getElementsByTagName('head')[0].appendChild(script);
- },
-
- getResource: function (prefix, name, callback) {
- var basename = prefix + "." + name;
- var styles = this.styles[basename];
-
- if (styles) {
- for (var i = 0; i < styles.length; i += 1) {
- this.getStyles(this.root + styles[i]);
- }
- }
-
- Syntax.getScript(this.root + basename + '.js', callback);
- },
-
- alias: function (name, aliases) {
- Syntax.aliases[name] = name;
-
- for (var i = 0; i < aliases.length; i += 1) {
- Syntax.aliases[aliases[i]] = name;
- }
- },
-
- brushAliases: function (brush) {
- var aliases = [];
-
- for (var name in Syntax.aliases) {
- if (Syntax.aliases[name] === brush) {
- aliases.push(name);
- }
- }
-
- return aliases;
- },
-
- brushNames: function () {
- var names = [];
-
- for (var name in Syntax.aliases) {
- if (name === Syntax.aliases[name]) {
- names.push(name);
- }
- }
-
- return names;
- },
-
- extractBrushName: function (className) {
- // brush names are by default lower case - normalize so we can detect it.
- className = className.toLowerCase();
-
- var match = className.match(/brush-([\S]+)/);
-
- if (match) {
- return match[1];
- } else {
- var classes = className.split(/ /);
-
- if (jQuery.inArray("syntax", classes) !== -1) {
- for (var i = 0; i < classes.length; i += 1) {
- var name = Syntax.aliases[classes[i]];
-
- if (name) {
- return name;
- }
- }
- }
- }
-
- return null;
- },
-
- detectRoot: function () {
- if (Syntax.root == null) {
- // Initialize root based on current script path.
- var scripts = jQuery('script').filter(function(){
- return this.src.match(/jquery\.syntax/);
- });
-
- var first = scripts.get(0);
-
- if (first) {
- // Calculate the basename for the given script src.
- var root = first.src.match(/.*\//);
-
- if (root) {
- Syntax.root = root[0];
- }
- }
- }
- },
-
- log: function() {
- if (typeof(console) != "undefined" && console.log) {
- console.log.apply(console, arguments);
- } else if (window.console && window.console.log) {
- window.console.log.apply(window.console, arguments);
- }
- }
-};
-
-jQuery.fn.syntax = function (options, callback) {
- Syntax.detectRoot();
-
- var elements = this;
-
- Syntax.loader.get('core', function () {
- Syntax.highlight(elements, options, callback);
- });
-};
-
-jQuery.syntax = function (options, callback) {
- options = options || {};
- var context = options.context;
-
- if (options.root) {
- Syntax.root = options.root;
- } else {
- Syntax.detectRoot();
- }
-
- options = jQuery.extend(Syntax.defaultOptions, options)
-
- options.blockSelector = options.blockSelector || 'pre.syntax:not(.highlighted)';
- options.inlineSelector = options.inlineSelector || 'code.syntax:not(.highlighted)';
-
- options.blockLayout = options.blockLayout || 'list';
- options.inlineLayout = options.inlineLayout || 'inline';
-
- // Allow the user to specify callbacks without replacement.
- if (typeof options.replace == "undefined")
- options.replace = true;
-
- jQuery(options.blockSelector, context).each(function () {
- jQuery(this).syntax(jQuery.extend({}, options, {
- brush: Syntax.extractBrushName(this.className),
- layout: options.blockLayout
- }), callback);
- });
-
- jQuery(options.inlineSelector, context).each(function () {
- jQuery(this).syntax(jQuery.extend({}, options, {
- brush: Syntax.extractBrushName(this.className),
- layout: options.inlineLayout
- }), callback);
- });
-};
diff --git a/js/jquery.syntax.layout.editor.js b/js/jquery.syntax.layout.editor.js
deleted file mode 100644
index 0a8c009a..00000000
--- a/js/jquery.syntax.layout.editor.js
+++ /dev/null
@@ -1,291 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.Editor = function(container, text) {
- this.container = container;
- this.current = this.getLines();
-}
-
-// This function generates an array of accumulated line offsets e.g.
-// If line 8 is actually in child element 6, indices[8] = -2
-Syntax.Editor.prototype.getLines = function() {
- var children = this.container.childNodes, lines = [], offsets = [];
-
- // Sometimes, e.g. when deleting text, children elements are not complete lines.
- // We need to accumulate incomplete lines (1), and then append them to the
- // start of the next complete line (2)
- var text = "", startChild = 0;
- for (var i = 0; i < children.length; i += 1) {
- var childLines = Syntax.innerText([children[i]]).split('\n');
-
- if (childLines.length > 1) {
- childLines[0] = text + childLines[0]; // (2)
- text = childLines.pop();
- } else {
- text += childLines[0]; // (1)
- continue;
- }
-
- for (var j = 0; j < childLines.length; j += 1) {
- offsets.push(startChild - lines.length);
- lines.push(childLines[j]);
- }
-
- startChild = i + 1;
- }
-
- // Final line, any remaining text
- if (text != "") {
- offsets.push(startChild - lines.length);
- lines.push(text);
- } else {
- startChild -= 1;
- }
-
- offsets.push(startChild);
-
- Syntax.log("getLines", offsets, lines, children);
-
- return {lines: lines, offsets: offsets};
-}
-
-// This function updates the editor's internal state with regards to lines changed.
-// This can be lines added, removed or modified partially. This function returns
-// a list of lines which are different between the previous set of lines and the
-// updated set of lines.
-// This algorithm is not a general diff algorithm because we expect three cases only:
-// 1: A single line was modified (most common case)
-// 2: Some lines were removed (selection -> delete)
-// 3: Some lines were added (paste)
-Syntax.Editor.prototype.updateChangedLines = function() {
- var result = {};
-
- var updated = this.getLines();
-
- // Find the sequence of lines at the start preceeding the change:
- var i = 0, j = 0;
- while (i < this.current.lines.length && j < updated.lines.length) {
- if (this.current.lines[i] == updated.lines[j]) {
- i += 1;
- j += 1;
- } else {
- break;
- }
- }
-
- // The length of the initial segment which hasn't changed:
- result.start = j;
-
- // Find the sequence of lines at the end proceeding the change:
- i = this.current.lines.length, j = updated.lines.length;
- while (i > result.start && j > result.start) {
- if (this.current.lines[i-1] == updated.lines[j-1]) {
- i -= 1;
- j -= 1;
- } else {
- break;
- }
- }
-
- // The index of the remaining portion which hasn't changed:
- result.end = j;
- // The index to the original set of lines which were the same:
- result.originalEnd = i;
-
- // Did we add or remove some lines?
- result.difference = updated.lines.length - this.current.lines.length;
-
- // This should be augmented to improve the above.
- while (result.start > 0) {
- if (updated.offsets[result.start] == updated.offsets[result.start-1])
- break;
-
- result.start -= 1;
- }
-
- if (result.difference > 0) {
- while (result.end < (updated.lines.length-1)) {
- if (updated.offsets[result.end-1] == updated.offsets[result.end])
- break;
-
- result.end += 1;
- result.originalEnd += 1;
- }
- }
-
- // Update the internal state for the next update.
- this.current = updated;
- this.changed = result;
-
- return result;
-}
-
-Syntax.Editor.prototype.textForLines = function(start, end) {
- return this.current.lines.slice(start, end).join('\n') + '\n';
-}
-
-Syntax.Editor.prototype.updateLines = function(changed, newLines) {
- // We have two cases to handle, either we are replacing lines
- // (1a) Replacing old lines with one more more new lines (update)
- // (1b) Replacing old lines with zero new lines (removal)
- // Or we are inserting lines
- // (2a) We are inserting lines at the start of the element
- // (2b) We are inserting lines after an existing element.
-
- if (changed.start != changed.end) {
- // When text is deleted, at most two elements can remain:
- // (1) Whatever was partially remaining on the first line.
- // (2) Whatever was partially remaining on the last line.
- // All other lines have already been removed by the container.
- // changed.difference tells us how many elements have already been removed.
-
- // Cases (1a) and (1b)
- var start = changed.start, end = changed.end;
-
- start += this.current.offsets[start];
- end += this.current.offsets[end];
-
- var oldLines = Array.prototype.slice.call(this.container.childNodes, start, end);
-
- $(oldLines).replaceWith(newLines);
- } else {
- if (changed.start == 0)
- $(this.container).prepend(newLines);
- else {
- var start = changed.start;
-
- start += this.current.offsets[start];
-
- $(this.container.childNodes[start]).after(newLines);
- }
- }
-}
-
-// http://jsfiddle.net/TjXEG/1/
-Syntax.Editor.getCharacterOffset = function(element) {
- var caretOffset = 0;
- if (typeof window.getSelection != "undefined") {
- var range = window.getSelection().getRangeAt(0);
- var preCaretRange = range.cloneRange();
- preCaretRange.selectNodeContents(element);
- preCaretRange.setEnd(range.endContainer, range.endOffset);
- caretOffset = preCaretRange.toString().length;
- } else if (typeof document.selection != "undefined" && document.selection.type != "Control") {
- var textRange = document.selection.createRange();
- var preCaretTextRange = document.body.createTextRange();
- preCaretTextRange.moveToElementText(element);
- preCaretTextRange.setEndPoint("EndToEnd", textRange);
- caretOffset = preCaretTextRange.text.length;
- }
- return caretOffset;
-};
-
-Syntax.Editor.getNodesForCharacterOffsets = function(offsets, node) {
- var treeWalker = document.createTreeWalker(
- node,
- NodeFilter.SHOW_TEXT,
- function(node) {
- return NodeFilter.FILTER_ACCEPT;
- },
- false
- );
-
- var nodes = [], charCount = 0, i = 0;
- while (i < offsets.length && treeWalker.nextNode()) {
- var end = charCount + treeWalker.currentNode.length;
-
- while (i < offsets.length && offsets[i] < end) {
- nodes.push([treeWalker.currentNode, charCount, end]);
-
- i += 1;
- }
-
- charCount = end;
- }
-
- return nodes;
-};
-
-Syntax.Editor.prototype.getClientState = function() {
- var state = {};
-
- var selection = window.getSelection();
-
- if (selection.rangeCount > 0)
- state.range = selection.getRangeAt(0);
-
- if (state.range) {
- state.startOffset = Syntax.Editor.getCharacterOffset(this.container);
- }
-
- return state;
-};
-
-Syntax.Editor.prototype.setClientState = function(state) {
- if (state.startOffset) {
- var nodes = Syntax.Editor.getNodesForCharacterOffsets([state.startOffset], this.container);
-
- var range = document.createRange();
- range.setStart(nodes[0][0], state.startOffset - nodes[0][1]);
- range.setEnd(nodes[0][0], state.startOffset - nodes[0][1]);
-
- var selection = window.getSelection();
- selection.removeAllRanges();
- selection.addRange(range);
- }
-};
-
-Syntax.layouts.editor = function(options, code/*, container*/) {
- var container = jQuery('<div class="editor syntax highlighted" contentEditable="true">');
-
- container.append(code.children());
-
- var editor = new Syntax.Editor(container.get(0));
-
- var updateContainer = function(lineHint) {
- // Need to save cursor position/selection
- var clientState = editor.getClientState();
- var changed = editor.updateChangedLines();
-
- // Sometimes there are problems where multiple spans exist on the same line.
- if (changed.difference < 0 && changed.start > 0)
- changed.start -= 1;
-
- var text = editor.textForLines(changed.start, changed.end);
-
- if (changed.start == changed.end) {
- editor.updateLines(changed, []);
- } else {
- // Lines have been added, update the highlighting.
- Syntax.highlightText(text, options, function(html) {
- editor.updateLines(changed, html.children().get());
-
- // Restore cusor position/selection if possible
- editor.setClientState(clientState);
- });
- }
- };
-
- // 'blur keyup paste mouseup'
- container.bind('keyup', function(){
- updateContainer();
- });
-
- container.bind('paste', function(event){
- updateContainer();
- });
-
- container.bind('keydown', function(event){
- if (event.keyCode == 9) {
- event.preventDefault();
- document.execCommand('insertHTML', false, " ");
- }
- else if (event.keyCode == 13) {
- event.preventDefault();
- document.execCommand('insertHTML', false, "\n");
- }
- });
-
- return jQuery('<div class="syntax-container">').append(container);
-};
diff --git a/js/jquery.syntax.layout.fixed.js b/js/jquery.syntax.layout.fixed.js
deleted file mode 100644
index f51c0bc1..00000000
--- a/js/jquery.syntax.layout.fixed.js
+++ /dev/null
@@ -1,70 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-// This layout doesn't work correctly in IE6, but is fine in all other tested browsers.
-Syntax.layouts.fixed = function(options, code, container) {
- var fixed = jQuery('<div class="fixed syntax highlighted">'), line = 1, space = /^\s*$/;
- var toolbar = jQuery('<div class="toolbar">');
-
- var rawCode = container.clone();
- rawCode.addClass("raw syntax highlighted");
-
- var codeTable = document.createElement('table');
-
- var codeTableBody = document.createElement('tbody');
- codeTable.appendChild(codeTableBody);
-
- var numbersColumn = jQuery('<div class="numbers-column">');
- var codeColumn = jQuery('<div class="code-column">');
-
- // Source code
- code.children().each(function() {
- var lineNumber = document.createElement('div');
- lineNumber.className = "line ln" + line
- lineNumber.innerHTML = line;
- numbersColumn.append(lineNumber);
-
- var lineCode = document.createElement('td');
- lineCode.className = "source " + this.className;
-
- if (line % 2) {
- lineCode.className += " alt";
- }
-
- if (lineCode == 1) {
- lineNumber.className += " first"
- }
-
- // Thanks to Michael for suggesting the obvious :)
- lineCode.appendChild(this);
-
- var tr = document.createElement('tr');
- tr.appendChild(lineCode);
- codeTableBody.appendChild(tr);
-
- line = line + 1;
- });
-
- codeColumn.append(codeTable);
-
- fixed.append(numbersColumn);
- fixed.append(codeColumn);
-
- a = jQuery('<a href="#">View Raw Code</a>');
- a.click(function (event) {
- event.preventDefault();
-
- if (jQuery(fixed).is(':visible')) {
- rawCode.height(jQuery(fixed).height());
- jQuery(fixed).replaceWith(rawCode);
- } else {
- jQuery(rawCode).replaceWith(fixed);
- }
- });
-
- toolbar.append(a);
- toolbar.append('<a href="http://www.oriontransfer.co.nz/software/jquery-syntax" target="oriontransfer">?</a>');
-
- return jQuery('<div class="syntax-container">').append(toolbar).append(fixed);
-};
diff --git a/js/jquery.syntax.layout.inline.js b/js/jquery.syntax.layout.inline.js
deleted file mode 100644
index 4a943501..00000000
--- a/js/jquery.syntax.layout.inline.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.layouts.inline = function(options, code, container) {
- var inline = jQuery('<code class="syntax highlighted"></code>');
- inline.append(code.children());
-
- var container = jQuery('<span class="syntax-container">');
- container.append(inline);
-
- return container;
-};
diff --git a/js/jquery.syntax.layout.list.js b/js/jquery.syntax.layout.list.js
deleted file mode 100644
index 0dcf6d86..00000000
--- a/js/jquery.syntax.layout.list.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.layouts.list = function(options, code, container) {
- var listTag = options.listTag || 'ol';
-
- var list = jQuery('<' + listTag + ' class="syntax highlighted">'), line = 1, space = /^\s*$/;
- var toolbar = jQuery('<div class="toolbar">');
-
- var rawCode = container.clone();
- rawCode.addClass("raw syntax highlighted");
-
- // Source code
- code.children().each(function() {
- var li = document.createElement('li');
- li.className = "line ln" + line
-
- if (line % 2) {
- li.className += " alt";
- }
-
- if (line == 1) {
- li.className += " first"
- }
-
- var div = document.createElement('div');
- div.className = "source " + this.className;
-
- div.appendChild(this);
-
- li.appendChild(div);
- list[0].appendChild(li);
-
- line = line + 1;
- });
-
- a = jQuery('<a href="#">View Raw Code</a>');
- a.click(function (event) {
- event.preventDefault();
-
- if (jQuery(list).is(':visible')) {
- rawCode.height(jQuery(list).height());
- jQuery(list).replaceWith(rawCode);
- } else {
- jQuery(rawCode).replaceWith(list);
- }
- });
-
- toolbar.append(a);
- toolbar.append('<a href="http://www.oriontransfer.co.nz/software/jquery-syntax" target="oriontransfer">?</a>');
-
- return jQuery('<div class="syntax-container">').append(toolbar).append(list);
-};
diff --git a/js/jquery.syntax.layout.plain.js b/js/jquery.syntax.layout.plain.js
deleted file mode 100644
index 877590d6..00000000
--- a/js/jquery.syntax.layout.plain.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-// This layout doesn't work correctly in IE6, but is fine in all other tested browsers.
-Syntax.layouts.plain = function(options, code, container) {
- var toolbar = jQuery('<div class="toolbar">');
-
- var scrollContainer = jQuery('<div class="syntax plain highlighted">');
- code.removeClass('syntax');
-
- scrollContainer.append(code);
-
- return jQuery('<div class="syntax-container">').append(toolbar).append(scrollContainer);
-};
diff --git a/js/jquery.syntax.layout.table.js b/js/jquery.syntax.layout.table.js
deleted file mode 100644
index fbd656f1..00000000
--- a/js/jquery.syntax.layout.table.js
+++ /dev/null
@@ -1,58 +0,0 @@
-// This file is part of the "jQuery.Syntax" project, and is distributed under the MIT License.
-// Copyright (c) 2011 Samuel G. D. Williams. <http://www.oriontransfer.co.nz>
-// See <jquery.syntax.js> for licensing details.
-
-Syntax.layouts.table = function(options, code, container) {
- var table = jQuery('<table class="syntax highlighted"></table>'), tr = null, td = null, a = null, line = 1;
- var tbody = document.createElement('tbody');
- var toolbar = jQuery('<div class="toolbar"></div>');
-
- var rawCode = container.clone();
- rawCode.addClass("raw syntax highlighted");
-
- // Source code
- code.children().each(function() {
- tr = document.createElement('tr');
- tr.className = "line ln" + line;
-
- if (line % 2) {
- tr.className += " alt";
- }
-
- td = document.createElement('td');
- td.className = "number";
-
- number = document.createElement('span');
- number.innerHTML = line;
- td.appendChild(number);
- tr.appendChild(td);
-
- td = document.createElement('td');
- td.className = "source";
-
- td.appendChild(this);
- tr.appendChild(td);
-
- tbody.appendChild(tr);
- line = line + 1;
- });
-
- table.append(tbody);
-
- a = jQuery('<a href="#">View Raw Code</a>');
- a.click(function (event) {
- event.preventDefault();
-
- if (jQuery(table).is(':visible')) {
- rawCode.height(jQuery(table).height());
- jQuery(table).replaceWith(rawCode);
- } else {
- jQuery(rawCode).replaceWith(table);
- }
- });
-
- toolbar.append(a);
- toolbar.append('<a href="http://www.oriontransfer.co.nz/software/jquery-syntax" target="oriontransfer">?</a>');
-
- return jQuery('<div class="syntax-container">').append(toolbar).append(table);
-};
diff --git a/js/jquery.syntax.layout.yelp.js b/js/jquery.syntax.layout.yelp.js
deleted file mode 100644
index 1e28d67c..00000000
--- a/js/jquery.syntax.layout.yelp.js
+++ /dev/null
@@ -1,4 +0,0 @@
-Syntax.layouts.yelp = function(options, code, container) {
- code.addClass('contents');
- return code;
-};
diff --git a/js/syntax.html b/js/syntax.html
deleted file mode 100644
index 32b3a743..00000000
--- a/js/syntax.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<html>
-<head>
-<style type="text/css">
-table { border-collapse: collapse; }
-td {
- vertical-align: top;
- border: solid 1px #888a85;
- padding: 2px 4px 2px 4px;
-}
-p { max-width: 48em; }
-</style>
-<head>
-<body>
-
-<p>Yelp uses <a href="http://www.oriontransfer.co.nz/software/jquery-syntax/index.en">jQuery.Syntax</a>
-(currently version 3.0) for syntax highlighting. jquery.Syntax has its own naming
-conventions for syntaxes. Mallard uses MIME types. DocBook has a free-form language
-attribute. This page shows the mapping. We try to use MIME types found in the XDG
-mime types package. For DocBook, we try to be compatible with language names used
-by docbook-style-xsl.</p>
-
-<table>
-
-<tr>
-<th>Syntax</th>
-<th>Mallard</th>
-<th>DocBook</th>
-</tr>
-
-<tr>
-<td>apache</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>applescript</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>asm</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>bash</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>bash-script</td>
-<td>application/x-shellscript</td>
-<td>bash</td>
-</tr>
-
-<tr>
-<td>basic</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>clang</td>
-<td>text/x-csrc<br>text/x-chdr<br>text/x-c++hdr<br>text/x-c++src<br>text/x-objcsrc</td>
-<td>c<br>cpp<br>objc</td>
-</tr>
-
-<tr>
-<td>csharp</td>
-<td>text/x-csharp</td>
-<td>csharp</td>
-</tr>
-
-<tr>
-<td>css</td>
-<td>text/css</td>
-<td>css</td>
-</tr>
-
-<tr>
-<td>diff</td>
-<td>text/x-patch</td>
-<td>diff</td>
-</tr>
-
-<tr>
-<td>haskell</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>html</td>
-<td>text/html<br>application/xml<br>*/*+xml</td>
-<td>html<br>xml</td>
-</tr>
-
-<tr>
-<td>java</td>
-<td>text/x-java</td>
-<td>java</td>
-</tr>
-
-<tr>
-<td>javascript</td>
-<td>application/javascript</td>
-<td>javascript</td>
-</tr>
-
-<tr>
-<td>lisp</td>
-<td>text/x-scheme<br>text/x-emacs-lisp</td>
-<td>lisp</td>
-</tr>
-
-<tr>
-<td>lua</td>
-<td>text/x-lua</td>
-<td>lua</td>
-</tr>
-
-<tr>
-<td>ooc</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>pascal</td>
-<td>text/x-pascal</td>
-<td>pascal</td>
-</tr>
-
-<tr>
-<td>perl5</td>
-<td>application/x-perl</td>
-<td>perl</td>
-</tr>
-
-<tr>
-<td>php</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>php-script</td>
-<td>application/x-php</td>
-<td>php</td>
-</tr>
-
-<tr>
-<td>plain</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>python</td>
-<td>text/x-python</td>
-<td>python</td>
-</tr>
-
-<tr>
-<td>ruby</td>
-<td>application/x-ruby</td>
-<td>ruby</td>
-</tr>
-
-<tr>
-<td>smalltalk</td>
-<td></td>
-<td></td>
-</tr>
-
-<tr>
-<td>sql</td>
-<td>text/x-sql</td>
-<td>sql</td>
-</tr>
-
-<tr>
-<td>yaml</td>
-<td>application/x-yaml</td>
-<td>yaml</td>
-</tr>
-
-</table>
-</body>
-</html>
diff --git a/test/syntax/Makefile b/test/syntax/Makefile
new file mode 100644
index 00000000..975a897d
--- /dev/null
+++ b/test/syntax/Makefile
@@ -0,0 +1,11 @@
+highlight.pack.js:
+ cp ../../js/highlight.pack.js .
+
+mallard: highlight.pack.js
+ xsltproc --xinclude ../../xslt/mallard/html/mal2html.xsl mallard.page
+
+docbook: highlight.pack.js
+ xsltproc --xinclude --param db.chunk.max_depth 0 ../../xslt/docbook/html/db2html.xsl docbook.docbook
+
+dita: highlight.pack.js
+ xsltproc --xinclude ../../xslt/dita/html/dita2html.xsl dita.dita
diff --git a/test/syntax/code/actionscript b/test/syntax/code/actionscript
new file mode 100644
index 00000000..9c35adf9
--- /dev/null
+++ b/test/syntax/code/actionscript
@@ -0,0 +1,24 @@
+package org.example.dummy {
+ import org.dummy.*;
+
+ /*define package inline interface*/
+ public interface IFooBarzable {
+ public function foo(... pairs):Array;
+ }
+
+ public class FooBar implements IFooBarzable {
+ static private var cnt:uint = 0;
+ private var bar:String;
+
+ //constructor
+ public function TestBar(bar:String):void {
+ bar = bar;
+ ++cnt;
+ }
+
+ public function foo(... pairs):Array {
+ pairs.push(bar);
+ return pairs;
+ }
+ }
+}
diff --git a/test/syntax/code/apache b/test/syntax/code/apache
new file mode 100644
index 00000000..3bf2af4f
--- /dev/null
+++ b/test/syntax/code/apache
@@ -0,0 +1,19 @@
+# rewrite`s rules for wordpress pretty url
+LoadModule rewrite_module modules/mod_rewrite.so
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule . index.php [NC,L]
+
+ExpiresActive On
+ExpiresByType application/x-javascript "access plus 1 days"
+
+Order Deny,Allow
+Allow from All
+
+<Location /maps/>
+ RewriteMap map txt:map.txt
+ RewriteMap lower int:tolower
+ RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
+ RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
+ RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
+</Location>
diff --git a/test/syntax/code/asciidoc b/test/syntax/code/asciidoc
new file mode 100644
index 00000000..bfeb895e
--- /dev/null
+++ b/test/syntax/code/asciidoc
@@ -0,0 +1,65 @@
+Hello, World!
+============
+Author Name, <author@domain.foo>
+
+you can write text http://example.com[with links], optionally
+using an explicit link:http://example.com[link prefix].
+
+* single quotes around a phrase place 'emphasis'
+** alternatively, you can put underlines around a phrase to add _emphasis_
+* astericks around a phrase make the text *bold*
+* pluses around a phrase make it +monospaced+
+* `smart' quotes using a leading backtick and trailing single quote
+** use two of each for double ``smart'' quotes
+
+- escape characters are supported
+- you can escape a quote inside emphasized text like 'here\'s johnny!'
+
+term:: definition
+ another term:: another definition
+
+// this is just a comment
+
+Let's make a break.
+
+'''
+
+////
+we'll be right with you
+
+after this brief interruption.
+////
+
+== We're back!
+
+Want to see a image::images/tiger.png[Tiger]?
+
+.Nested highlighting
+++++
+<this_is inline="xml"></this_is>
+++++
+
+____
+asciidoc is so powerful.
+____
+
+another quote:
+
+[quote, Sir Arthur Conan Doyle, The Adventures of Sherlock Holmes]
+____
+When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
+____
+
+Getting Literal
+---------------
+
+ want to get literal? prefix a line with a space.
+
+....
+I'll join that party, too.
+....
+
+. one thing (yeah!)
+. two thing `i can write code`, and `more` wipee!
+
+NOTE: AsciiDoc is quite cool, you should try it.
diff --git a/test/syntax/code/bash b/test/syntax/code/bash
new file mode 100644
index 00000000..b2654812
--- /dev/null
+++ b/test/syntax/code/bash
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+###### BEGIN CONFIG
+ACCEPTED_HOSTS="/root/.hag_accepted.conf"
+BE_VERBOSE=false
+###### END CONFIG
+
+if [ "$UID" -ne 0 ]
+then
+ echo "Superuser rights is required"
+ echo 'Printing the # sign'
+ exit 2
+fi
+
+if test $# -eq 0
+then
+elif test [ $1 == 'start' ]
+else
+fi
+
+genApacheConf(){
+ if [[ "$2" = "www" ]]
+ then
+ full_domain=$1
+ else
+ full_domain=$2.$1
+ fi
+ host_root="${APACHE_HOME_DIR}$1/$2/$(title)"
+ echo -e "# Host $1/$2 :"
+}
diff --git a/test/syntax/code/clojure b/test/syntax/code/clojure
new file mode 100644
index 00000000..ebce2352
--- /dev/null
+++ b/test/syntax/code/clojure
@@ -0,0 +1,18 @@
+; Comment
+
+(def
+ ^{:macro true
+ :added "1.0"}
+ let (fn* let [&form &env & decl] (cons 'let* decl)))
+
+(def ^:dynamic chunk-size 17)
+
+(defn next-chunk [rdr]
+ (let [buf (char-array chunk-size)
+ s (.read rdr buf)]
+ (when (pos? s)
+ (java.nio.CharBuffer/wrap buf 0 s))))
+
+(defn chunk-seq [rdr]
+ (when-let [chunk (next-chunk rdr)]
+ (cons chunk (lazy-seq (chunk-seq rdr)))))
diff --git a/test/syntax/code/cmake b/test/syntax/code/cmake
new file mode 100644
index 00000000..2bbea38c
--- /dev/null
+++ b/test/syntax/code/cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 2.8.8)
+project(cmake_example)
+
+# Show message on Linux platform
+if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
+ message("Good choice, bro!")
+endif()
+
+# Tell CMake to run moc when necessary:
+set(CMAKE_AUTOMOC ON)
+# As moc files are generated in the binary dir,
+# tell CMake to always look for includes there:
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Widgets finds its own dependencies.
+find_package(Qt5Widgets REQUIRED)
+
+add_executable(myproject main.cpp mainwindow.cpp)
+qt5_use_modules(myproject Widgets)
diff --git a/test/syntax/code/cpp b/test/syntax/code/cpp
new file mode 100644
index 00000000..37497ac5
--- /dev/null
+++ b/test/syntax/code/cpp
@@ -0,0 +1,15 @@
+#include <iostream>
+#define IABS(x) ((x) < 0 ? -(x) : (x))
+
+int main(int argc, char *argv[]) {
+
+ /* An annoying "Hello World" example */
+ for (auto i = 0; i < 0xFFFF; i++)
+ cout << "Hello, World!" << endl;
+
+ char c = '\n';
+ unordered_map <string, vector<string> > m;
+ m["key"] = "\\\\"; // this is an error
+
+ return -2e3 + 12l;
+}
diff --git a/test/syntax/code/cs b/test/syntax/code/cs
new file mode 100644
index 00000000..f58190a1
--- /dev/null
+++ b/test/syntax/code/cs
@@ -0,0 +1,38 @@
+using System;
+
+#pragma warning disable 414, 3021
+
+public class Program
+{
+ /// <summary>The entry point to the program.</summary>
+ public static int Main(string[] args)
+ {
+ Console.WriteLine("Hello, World!");
+ string s = @"This
+""string""
+spans
+multiple
+lines!";
+
+ dynamic x = new ExpandoObject();
+ x.MyProperty = 2;
+
+ return 0;
+ }
+}
+
+async Task<int> AccessTheWebAsync()
+{
+ // ...
+ string urlContents = await getStringTask;
+ return urlContents.Length;
+}
+
+internal static void ExceptionFilters()
+{
+ try
+ {
+ throw new Exception();
+ }
+ catch (Exception e) when (e.Message == "My error") { }
+}
diff --git a/test/syntax/code/css b/test/syntax/code/css
new file mode 100644
index 00000000..e7a102b0
--- /dev/null
+++ b/test/syntax/code/css
@@ -0,0 +1,25 @@
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ body:first-of-type pre::after {
+ content: 'highlight: ' attr(class);
+ }
+ body {
+ background: linear-gradient(45deg, blue, red);
+ }
+}
+
+@import url('print.css');
+@page:right {
+ margin: 1cm 2cm 1.3cm 4cm;
+}
+
+@font-face {
+ font-family: Chunkfive; src: url('Chunkfive.otf');
+}
+
+div.text,
+#content,
+li[lang=ru] {
+ font: Tahoma, Chunkfive, sans-serif;
+ background: url('hatch.png') /* wtf? */; color: #F0F0F0 !important;
+ width: 100%;
+}
diff --git a/test/syntax/code/d b/test/syntax/code/d
new file mode 100644
index 00000000..92cc8d84
--- /dev/null
+++ b/test/syntax/code/d
@@ -0,0 +1,44 @@
+#!/usr/bin/rdmd
+// Computes average line length for standard input.
+import std.stdio;
+
+/+
+ this is a /+ nesting +/ comment
++/
+
+enum COMPILED_ON = __TIMESTAMP__; // special token
+
+enum character = '©';
+enum copy_valid = '&copy;';
+enum backslash_escaped = '\\';
+
+// string literals
+enum str = `hello "world"!`;
+enum multiline = r"lorem
+ipsum
+dolor"; // wysiwyg string, no escapes here allowed
+enum multiline2 = "sit
+amet
+\"adipiscing\"
+elit.";
+enum hex = x"66 6f 6f"; // same as "foo"
+
+#line 5
+
+// float literals
+enum f = [3.14f, .1, 1., 1e100, 0xc0de.01p+100];
+
+static if (something == true) {
+ import std.algorithm;
+}
+
+void main() pure nothrow @safe {
+ ulong lines = 0;
+ double sumLength = 0;
+ foreach (line; stdin.byLine()) {
+ ++lines;
+ sumLength += line.length;
+ }
+ writeln("Average line length: ",
+ lines ? sumLength / lines : 0);
+}
diff --git a/test/syntax/code/diff b/test/syntax/code/diff
new file mode 100644
index 00000000..4f4c04fe
--- /dev/null
+++ b/test/syntax/code/diff
@@ -0,0 +1,30 @@
+Index: languages/ini.js
+===================================================================
+--- languages/ini.js (revision 199)
++++ languages/ini.js (revision 200)
+@@ -1,8 +1,7 @@
+ hljs.LANGUAGES.ini =
+ {
+ case_insensitive: true,
+- defaultMode:
+- {
++ defaultMode: {
+ contains: ['comment', 'title', 'setting'],
+ illegal: '[^\\s]'
+ },
+
+*** /path/to/original timestamp
+--- /path/to/new timestamp
+***************
+*** 1,3 ****
+--- 1,9 ----
++ This is an important
++ notice! It should
++ therefore be located at
++ the beginning of this
++ document!
+
+! compress the size of the
+! changes.
+
+ It is important to spell
diff --git a/test/syntax/code/django b/test/syntax/code/django
new file mode 100644
index 00000000..150037f5
--- /dev/null
+++ b/test/syntax/code/django
@@ -0,0 +1,16 @@
+{% if articles|length %}
+{% for article in articles %}
+
+{# Striped table #}
+<tr class="{% cycle odd,even %}">
+ <td>{{ article|default:"Hi... "|escape }}</td>
+ <td {% if article.today %}class="today"{% endif %}>{{ article.date|date:'d.m.Y' }}</td>
+</tr>
+
+{% endfor %}
+{% endif %}
+
+{% comment %}
+Comments may be long and multiline.
+Markup is <em>not</em> highlighted within comments.
+{% endcomment %}
diff --git a/test/syntax/code/dockerfile b/test/syntax/code/dockerfile
new file mode 100644
index 00000000..e796dc7e
--- /dev/null
+++ b/test/syntax/code/dockerfile
@@ -0,0 +1,48 @@
+# Example instructions from https://docs.docker.com/reference/builder/
+FROM ubuntu:14.04
+
+MAINTAINER example@example.com
+
+ENV foo /bar
+WORKDIR ${foo} # WORKDIR /bar
+ADD . $foo # ADD . /bar
+COPY \$foo /quux # COPY $foo /quux
+
+RUN apt-get update && apt-get install -y software-properties-common\
+ zsh curl wget git htop\
+ unzip vim telnet
+RUN ["/bin/bash", "-c", "echo hello ${USER}"]
+
+CMD ["executable","param1","param2"]
+CMD command param1 param2
+
+EXPOSE 1337
+
+ENV myName="John Doe" myDog=Rex\ The\ Dog \
+ myCat=fluffy
+
+ENV myName John Doe
+ENV myDog Rex The Dog
+ENV myCat fluffy
+
+ADD hom* /mydir/ # adds all files starting with "hom"
+ADD hom?.txt /mydir/ # ? is replaced with any single character
+
+COPY hom* /mydir/ # adds all files starting with "hom"
+COPY hom?.txt /mydir/ # ? is replaced with any single character
+
+ENTRYPOINT ["executable", "param1", "param2"]
+ENTRYPOINT command param1 param2
+
+VOLUME ["/data"]
+
+USER daemon
+
+LABEL com.example.label-with-value="foo"
+LABEL version="1.0"
+LABEL description="This text illustrates \
+that label-values can span multiple lines."
+
+WORKDIR /path/to/workdir
+
+ONBUILD ADD . /app/src
diff --git a/test/syntax/code/dos b/test/syntax/code/dos
new file mode 100644
index 00000000..246ca3d9
--- /dev/null
+++ b/test/syntax/code/dos
@@ -0,0 +1,24 @@
+cd \
+copy a b
+ping 192.168.0.1
+@rem ping 192.168.0.1
+net stop sharedaccess
+del %tmp% /f /s /q
+del %temp% /f /s /q
+ipconfig /flushdns
+taskkill /F /IM JAVA.EXE /T
+
+cd Photoshop/Adobe Photoshop CS3/AMT/
+if exist application.sif (
+ ren application.sif _application.sif
+) else (
+ ren _application.sif application.sif
+)
+
+taskkill /F /IM proquota.exe /T
+
+sfc /SCANNOW
+
+set path = test
+
+xcopy %1\*.* %2
diff --git a/test/syntax/code/erb b/test/syntax/code/erb
new file mode 100644
index 00000000..f7ea6203
--- /dev/null
+++ b/test/syntax/code/erb
@@ -0,0 +1,10 @@
+<%# this is a comment %>
+
+<% @posts.each do |post| %>
+ <p><%= link_to post.title, post %></p>
+<% end %>
+
+<%- available_things = things.select(&:available?) -%>
+<%%- x = 1 + 2 -%%>
+<%% value = 'real string #{@value}' %%>
+<%%= available_things.inspect %%>
diff --git a/test/syntax/code/fsharp b/test/syntax/code/fsharp
new file mode 100644
index 00000000..b7a00317
--- /dev/null
+++ b/test/syntax/code/fsharp
@@ -0,0 +1,48 @@
+open System
+
+// Single line comment...
+(*
+ This is a
+ multiline comment.
+*)
+let checkList alist =
+ match alist with
+ | [] -> 0
+ | [a] -> 1
+ | [a; b] -> 2
+ | [a; b; c] -> 3
+ | _ -> failwith "List is too big!"
+
+
+let text = "Some text..."
+let text2 = @"A ""verbatim"" string..."
+let catalog = """
+Some "long" string...
+"""
+
+let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
+
+let fibs =
+ Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
+ |> Async.RunSynchronously
+
+type Sprocket(gears) =
+ member this.Gears : int = gears
+
+[<AbstractClass>]
+type Animal =
+ abstract Speak : unit -> unit
+
+type Widget =
+ | RedWidget
+ | GreenWidget
+
+type Point = {X: float; Y: float;}
+
+[<Measure>]
+type s
+let minutte = 60<s>
+
+type DefaultMailbox<'a>() =
+ let mutable inbox = ConcurrentQueue<'a>()
+ let awaitMsg = new AutoResetEvent(false)
diff --git a/test/syntax/code/go b/test/syntax/code/go
new file mode 100644
index 00000000..aa8663a9
--- /dev/null
+++ b/test/syntax/code/go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "fmt"
+ "os"
+)
+
+const (
+ Sunday = iota
+ numberOfDays // this constant is not exported
+)
+
+type Foo interface {
+ FooFunc(int, float32) (complex128, []int)
+}
+
+type Bar struct {
+ os.File /* multi-line
+ comment */
+ PublicData chan int
+}
+
+func main() {
+ ch := make(chan int)
+ ch <- 1
+ x, ok := <- ch
+ ok = true
+ float_var := 1.0e10
+ defer fmt.Println('\'')
+ defer fmt.Println(`exitting now\`)
+ var fv1 float64 = 0.75
+ go println(len("hello world!"))
+ return
+}
diff --git a/test/syntax/code/haml b/test/syntax/code/haml
new file mode 100644
index 00000000..fb4bab32
--- /dev/null
+++ b/test/syntax/code/haml
@@ -0,0 +1,14 @@
+!!! XML
+%html
+ %body
+ %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
+ /html comment
+ -# ignore this line
+ %ul(style='margin: 0')
+ -items.each do |i|
+ %i= i
+ = variable
+ =variable2
+ ~ variable3
+ ~variable4
+ The current year is #{DataTime.now.year}.
diff --git a/test/syntax/code/haskell b/test/syntax/code/haskell
new file mode 100644
index 00000000..acb83786
--- /dev/null
+++ b/test/syntax/code/haskell
@@ -0,0 +1,38 @@
+{-# LANGUAGE TypeSynonymInstances #-}
+module Network.UDP
+( DataPacket(..)
+, openBoundUDPPort
+, openListeningUDPPort
+, pingUDPPort
+, sendUDPPacketTo
+, recvUDPPacket
+, recvUDPPacketFrom
+) where
+
+import qualified Data.ByteString as Strict (ByteString, concat, singleton)
+import qualified Data.ByteString.Lazy as Lazy (ByteString, toChunks, fromChunks)
+import Data.ByteString.Char8 (pack, unpack)
+import Network.Socket hiding (sendTo, recv, recvFrom)
+import Network.Socket.ByteString (sendTo, recv, recvFrom)
+
+-- Type class for converting StringLike types to and from strict ByteStrings
+class DataPacket a where
+ toStrictBS :: a -> Strict.ByteString
+ fromStrictBS :: Strict.ByteString -> a
+
+instance DataPacket Strict.ByteString where
+ toStrictBS = id
+ {-# INLINE toStrictBS #-}
+ fromStrictBS = id
+ {-# INLINE fromStrictBS #-}
+
+openBoundUDPPort :: String -> Int -> IO Socket
+openBoundUDPPort uri port = do
+ s <- getUDPSocket
+ bindAddr <- inet_addr uri
+ let a = SockAddrInet (toEnum port) bindAddr
+ bindSocket s a
+ return s
+
+pingUDPPort :: Socket -> SockAddr -> IO ()
+pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
diff --git a/test/syntax/code/http b/test/syntax/code/http
new file mode 100644
index 00000000..34631a1d
--- /dev/null
+++ b/test/syntax/code/http
@@ -0,0 +1,6 @@
+POST /task?id=1 HTTP/1.1
+Host: example.org
+Content-Type: application/json; charset=utf-8
+Content-Length: 19
+
+{"status": "ok", "extended": true}
diff --git a/test/syntax/code/ini b/test/syntax/code/ini
new file mode 100644
index 00000000..03a5c297
--- /dev/null
+++ b/test/syntax/code/ini
@@ -0,0 +1,12 @@
+; boilerplate
+[package]
+name = "some_name"
+authors = ["Author"]
+description = "This is \
+a description"
+
+[[lib]]
+name = ${NAME}
+default = True
+auto = no
+counter = 1_000
diff --git a/test/syntax/code/java b/test/syntax/code/java
new file mode 100644
index 00000000..7683240c
--- /dev/null
+++ b/test/syntax/code/java
@@ -0,0 +1,35 @@
+/**
+ * @author John Smith <john.smith@example.com>
+ * @version 1.0
+*/
+package l2f.gameserver.model;
+
+import java.util.ArrayList;
+
+public abstract class L2Character extends L2Object {
+ public static final Short ABNORMAL_EFFECT_BLEEDING = 0x0_0_0_1; // not sure
+
+ public void moveTo(int x, int y, int z) {
+ _ai = null;
+ _log.warning("Should not be called");
+ if (1 > 5) {
+ return;
+ }
+ }
+
+ /** Task of AI notification */
+ @SuppressWarnings( { "nls", "unqualified-field-access", "boxing" })
+ public class NotifyAITask implements Runnable {
+ private final CtrlEvent _evt;
+
+ List<String> mList = new ArrayList<String>()
+
+ public void run() {
+ try {
+ getAI().notifyEvent(_evt, _evt.class, null);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
+ }
+ }
+}
diff --git a/test/syntax/code/javascript b/test/syntax/code/javascript
new file mode 100644
index 00000000..5a6bc04e
--- /dev/null
+++ b/test/syntax/code/javascript
@@ -0,0 +1,37 @@
+import {x, y} as p from 'point';
+const ANSWER = 42;
+
+class Car extends Vehicle {
+ constructor(speed, cost) {
+ super(speed);
+
+ var c = Symbol('cost');
+ this[c] = cost;
+
+ this.intro = `This is a car runs at
+ ${speed}.`;
+ }
+}
+
+for (let num of [1, 2, 3]) {
+ console.log(num + 0b111110111);
+}
+
+function $initHighlight(block, flags) {
+ try {
+ if (block.className.search(/\bno\-highlight\b/) != -1)
+ return processBlock(block.function, true, 0x0F) + ' class=""';
+ } catch (e) {
+ /* handle exception */
+ var e4x =
+ <div>Example
+ <p>1234</p></div>;
+ }
+ for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
+ if (checkCondition(classes[i]) === undefined)
+ return /\d+[\s/]/g;
+ }
+ console.log(Array.every(classes, Boolean));
+}
+
+export $initHighlight;
diff --git a/test/syntax/code/json b/test/syntax/code/json
new file mode 100644
index 00000000..9710b228
--- /dev/null
+++ b/test/syntax/code/json
@@ -0,0 +1,12 @@
+[
+ {
+ "title": "apples",
+ "count": [12000, 20000],
+ "description": {"text": "...", "sensitive": false}
+ },
+ {
+ "title": "oranges",
+ "count": [17500, null],
+ "description": {"text": "...", "sensitive": false}
+ }
+]
diff --git a/test/syntax/code/lisp b/test/syntax/code/lisp
new file mode 100644
index 00000000..2b622087
--- /dev/null
+++ b/test/syntax/code/lisp
@@ -0,0 +1,22 @@
+#!/usr/bin/env csi
+
+(defun prompt-for-cd ()
+ "Prompts
+ for CD"
+ (prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
+ (prompt-read "Artist" &rest)
+ (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
+ (if x (format t "yes") (format t "no" nil) ;and here comment
+ )
+ ;; second line comment
+ '(+ 1 2)
+ (defvar *lines*) ; list of all lines
+ (position-if-not #'sys::whitespacep line :start beg))
+ (quote (privet 1 2 3))
+ '(hello world)
+ (* 5 7)
+ (1 2 34 5)
+ (:use "aaaa")
+ (let ((x 10) (y 20))
+ (print (+ x y))
+ )
diff --git a/test/syntax/code/lua b/test/syntax/code/lua
new file mode 100644
index 00000000..58174ee6
--- /dev/null
+++ b/test/syntax/code/lua
@@ -0,0 +1,32 @@
+--[[
+Simple signal/slot implementation
+]]
+local signal_mt = {
+ __index = {
+ register = table.insert
+ }
+}
+function signal_mt.__index:emit(... --[[ Comment in params ]])
+ for _, slot in ipairs(self) do
+ slot(self, ...)
+ end
+end
+local function create_signal()
+ return setmetatable({}, signal_mt)
+end
+
+-- Signal test
+local signal = create_signal()
+signal:register(function(signal, ...)
+ print(...)
+end)
+signal:emit('Answer to Life, the Universe, and Everything:', 42)
+
+--[==[ [=[ [[
+Nested ]]
+multi-line ]=]
+comment ]==]
+[==[ Nested
+[=[ multi-line
+[[ string
+]] ]=] ]==]
diff --git a/test/syntax/code/makefile b/test/syntax/code/makefile
new file mode 100644
index 00000000..cd1ec79d
--- /dev/null
+++ b/test/syntax/code/makefile
@@ -0,0 +1,13 @@
+# Makefile
+
+BUILDDIR = _build
+EXTRAS ?= $(BUILDDIR)/extras
+
+.PHONY: main clean
+
+main:
+ @echo "Building main facility..."
+ build_main $(BUILDDIR)
+
+clean:
+ rm -rf $(BUILDDIR)/*
diff --git a/test/syntax/code/markdown b/test/syntax/code/markdown
new file mode 100644
index 00000000..e7f66da9
--- /dev/null
+++ b/test/syntax/code/markdown
@@ -0,0 +1,22 @@
+# hello world
+
+you can write text [with links](http://example.com) inline or [link references][1].
+
+* one _thing_ has *em*phasis
+* two __things__ are **bold**
+
+[1]: http://example.com
+
+---
+
+hello world
+===========
+
+<this_is inline="xml"></this_is>
+
+> markdown is so cool
+
+ so are code segments
+
+1. one thing (yeah!)
+2. two thing `i can write code`, and `more` wipee!
diff --git a/test/syntax/code/matlab b/test/syntax/code/matlab
new file mode 100644
index 00000000..81fa7175
--- /dev/null
+++ b/test/syntax/code/matlab
@@ -0,0 +1,45 @@
+n = 20; % number of points
+points = [random('unid', 100, n, 1), random('unid', 100, n, 1)];
+len = zeros(1, n - 1);
+points = sortrows(points);
+%% Initial set of points
+plot(points(:,1),points(:,2));
+for i = 1: n-1
+ len(i) = points(i + 1, 1) - points(i, 1);
+end
+while(max(len) > 2 * min(len))
+ [d, i] = max(len);
+ k = on_margin(points, i, d, -1);
+ m = on_margin(points, i + 1, d, 1);
+ xm = 0; ym = 0;
+%% New point
+ if(i == 1 || i + 1 == n)
+ xm = mean(points([i,i+1],1))
+ ym = mean(points([i,i+1],2))
+ else
+ [xm, ym] = dlg1(points([k, i, i + 1, m], 1), ...
+ points([k, i, i + 1, m], 2))
+ end
+
+ points = [ points(1:i, :); [xm, ym]; points(i + 1:end, :)];
+end
+
+%{
+ This is a block comment. Please ignore me.
+%}
+
+function [net] = get_fit_network(inputs, targets)
+ % Create Network
+ numHiddenNeurons = 20; % Adjust as desired
+ net = newfit(inputs,targets,numHiddenNeurons);
+ net.trainParam.goal = 0.01;
+ net.trainParam.epochs = 1000;
+ % Train and Apply Network
+ [net,tr] = train(net,inputs,targets);
+end
+
+foo_matrix = [1, 2, 3; 4, 5, 6]''';
+foo_cell = {1, 2, 3; 4, 5, 6}''.'.';
+
+cell2flatten = {1,2,3,4,5};
+flattenedcell = cat(1, cell2flatten{:});
diff --git a/test/syntax/code/nginx b/test/syntax/code/nginx
new file mode 100644
index 00000000..adf4b7e9
--- /dev/null
+++ b/test/syntax/code/nginx
@@ -0,0 +1,47 @@
+user www www;
+worker_processes 2;
+pid /var/run/nginx.pid;
+error_log /var/log/nginx.error_log debug | info | notice | warn | error | crit;
+
+events {
+ connections 2000;
+ use kqueue | rtsig | epoll | /dev/poll | select | poll;
+}
+
+http {
+ log_format main '$remote_addr - $remote_user [$time_local] '
+ '"$request" $status $bytes_sent '
+ '"$http_referer" "$http_user_agent" '
+ '"$gzip_ratio"';
+
+ send_timeout 3m;
+ client_header_buffer_size 1k;
+
+ gzip on;
+ gzip_min_length 1100;
+
+ #lingering_time 30;
+
+ server {
+ server_name one.example.com www.one.example.com;
+ access_log /var/log/nginx.access_log main;
+
+ rewrite (.*) /index.php?page=$1 break;
+
+ location / {
+ proxy_pass http://127.0.0.1/;
+ proxy_redirect off;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ charset koi8-r;
+ }
+
+ location /api/ {
+ fastcgi_pass 127.0.0.1:9000;
+ }
+
+ location ~* \.(jpg|jpeg|gif)$ {
+ root /spool/www;
+ }
+ }
+}
diff --git a/test/syntax/code/objectivec b/test/syntax/code/objectivec
new file mode 100644
index 00000000..177f2ff3
--- /dev/null
+++ b/test/syntax/code/objectivec
@@ -0,0 +1,43 @@
+#import <UIKit/UIKit.h>
+#import "Dependency.h"
+
+@protocol WorldDataSource
+@optional
+- (NSString*)worldName;
+@required
+- (BOOL)allowsToLive;
+@end
+
+@interface Test : NSObject <HelloDelegate, WorldDataSource> {
+ NSString *_greeting;
+}
+
+@property (nonatomic, readonly) NSString *greeting;
+- (IBAction) show;
+@end
+
+@implementation Test
+
+@synthesize test=_test;
+
++ (id) test {
+ return [self testWithGreeting:@"Hello, world!\nFoo bar!"];
+}
+
++ (id) testWithGreeting:(NSString*)greeting {
+ return [[[self alloc] initWithGreeting:greeting] autorelease];
+}
+
+- (id) initWithGreeting:(NSString*)greeting {
+ if ( (self = [super init]) ) {
+ _greeting = [greeting retain];
+ }
+ return self;
+}
+
+- (void) dealloc {
+ [_greeting release];
+ [super dealloc];
+}
+
+@end
diff --git a/test/syntax/code/perl b/test/syntax/code/perl
new file mode 100644
index 00000000..3b08442d
--- /dev/null
+++ b/test/syntax/code/perl
@@ -0,0 +1,41 @@
+# loads object
+sub load
+{
+ my $flds = $c->db_load($id,@_) || do {
+ Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
+ };
+ my $o = $c->_perl_new();
+ $id12 = $id / 24 / 3600;
+ $o->{'ID'} = $id12 + 123;
+ #$o->{'SHCUT'} = $flds->{'SHCUT'};
+ my $p = $o->props;
+ my $vt;
+ $string =~ m/^sought_text$/;
+ $items = split //, 'abc';
+ $string //= "bar";
+ for my $key (keys %$p)
+ {
+ if(${$vt.'::property'}) {
+ $o->{$key . '_real'} = $flds->{$key};
+ tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
+ }
+ }
+ $o->save if delete $o->{'_save_after_load'};
+
+ # GH-117
+ my $g = glob("/usr/bin/*");
+
+ return $o;
+}
+
+__DATA__
+@@ layouts/default.html.ep
+<!DOCTYPE html>
+<html>
+ <head><title><%= title %></title></head>
+ <body><%= content %></body>
+</html>
+__END__
+
+=head1 NAME
+POD till the end of file
diff --git a/test/syntax/code/php b/test/syntax/code/php
new file mode 100644
index 00000000..ec43315f
--- /dev/null
+++ b/test/syntax/code/php
@@ -0,0 +1,52 @@
+require_once 'Zend/Uri/Http.php';
+
+namespace Location\Web;
+
+interface Factory
+{
+ static function _factory();
+}
+
+abstract class URI extends BaseURI implements Factory
+{
+ abstract function test();
+
+ public static $st1 = 1;
+ const ME = "Yo";
+ var $list = NULL;
+ private $var;
+
+ /**
+ * Returns a URI
+ *
+ * @return URI
+ */
+ static public function _factory($stats = array(), $uri = 'http')
+ {
+ echo __METHOD__;
+ $uri = explode(':', $uri, 0b10);
+ $schemeSpecific = isset($uri[1]) ? $uri[1] : '';
+ $desc = 'Multi
+line description';
+
+ // Security check
+ if (!ctype_alnum($scheme)) {
+ throw new Zend_Uri_Exception('Illegal scheme');
+ }
+
+ $this->var = 0 - self::$st;
+ $this->list = list(Array("1"=> 2, 2=>self::ME, 3 => \Location\Web\URI::class));
+
+ return [
+ 'uri' => $uri,
+ 'value' => null,
+ ];
+ }
+}
+
+echo URI::ME . URI::$st1;
+
+__halt_compiler () ; datahere
+datahere
+datahere */
+datahere
diff --git a/test/syntax/code/python b/test/syntax/code/python
new file mode 100644
index 00000000..1216323c
--- /dev/null
+++ b/test/syntax/code/python
@@ -0,0 +1,12 @@
+@requires_authorization
+def somefunc(param1='', param2=0):
+ r'''A docstring'''
+ if param1 > param2: # interesting
+ print 'Gre\'ater'
+ return (param2 - param1 + 1 + 0b10l) or None
+
+class SomeClass:
+ pass
+
+>>> message = '''interpreter
+... prompt'''
diff --git a/test/syntax/code/r b/test/syntax/code/r
new file mode 100644
index 00000000..2f277478
--- /dev/null
+++ b/test/syntax/code/r
@@ -0,0 +1,68 @@
+library(ggplot2)
+
+centre <- function(x, type, ...) {
+ switch(type,
+ mean = mean(x),
+ median = median(x),
+ trimmed = mean(x, trim = .1))
+}
+
+myVar1
+myVar.2
+data$x
+foo "bar" baz
+# test "test"
+"test # test"
+
+(123) (1) (10) (0.1) (.2) (1e-7)
+(1.2e+7) (2e) (3e+10) (0x0) (0xa)
+(0xabcdef1234567890) (123L) (1L)
+(0x10L) (10000000L) (1e6L) (1.1L)
+(1e-3L) (4123.381E-10i)
+(3.) (3.E10) # BUG: .E10 should be part of number
+
+# Numbers in some different contexts
+1L
+0x40
+.234
+3.
+1L + 30
+plot(cars, xlim=20)
+plot(cars, xlim=0x20)
+foo<-30
+my.data.3 <- read() # not a number
+c(1,2,3)
+1%%2
+
+"this is a quote that spans
+multiple lines
+\"
+
+is this still a quote? it should be.
+# even still!
+
+" # now we're done.
+
+'same for
+single quotes #'
+
+# keywords
+NULL, NA, TRUE, FALSE, Inf, NaN, NA_integer_,
+NA_real_, NA_character_, NA_complex_, function,
+while, repeat, for, if, in, else, next, break,
+..., ..1, ..2
+
+# not keywords
+the quick brown fox jumped over the lazy dogs
+null na true false inf nan na_integer_ na_real_
+na_character_ na_complex_ Function While Repeat
+For If In Else Next Break .. .... "NULL" `NULL` 'NULL'
+
+# operators
++, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
+->, <-, <<-, $, :, ::
+
+# infix operator
+foo %union% bar
+%"test"%
+`"test"`
diff --git a/test/syntax/code/ruby b/test/syntax/code/ruby
new file mode 100644
index 00000000..1fb23784
--- /dev/null
+++ b/test/syntax/code/ruby
@@ -0,0 +1,28 @@
+class A < B; def self.create(object = User) object end end
+class Zebra; def inspect; "X#{2 + self.object_id}" end end
+
+module ABC::DEF
+ include Comparable
+
+ # @param test
+ # @return [String] nothing
+ def foo(test)
+ Thread.new do |blockvar|
+ ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + ?\012)
+ answer = valid?4 && valid?CONST && ?A && ?A.ord
+ end.join
+ end
+
+ def [](index) self[index] end
+ def ==(other) other == self end
+end
+
+class Car < ActiveRecord::Base
+ has_many :wheels, class_name: 'Wheel', foreign_key: 'car_id'
+ scope :available, -> { where(available: true) }
+end
+
+hash = {1 => 'one', 2 => 'two'}
+
+2.0.0p0 :001 > ['some']
+ => ["some"]
diff --git a/test/syntax/code/rust b/test/syntax/code/rust
new file mode 100644
index 00000000..6d0fd4d4
--- /dev/null
+++ b/test/syntax/code/rust
@@ -0,0 +1,55 @@
+use std;
+
+#![warn(unstable)]
+
+/* Factorial */
+fn fac(n: int) -> int {
+ let s: str = "This is
+a multi-line string.
+
+It ends with an unescaped '\"'.";
+ let c: char = 'Ф';
+ let r: str = r##" raw string "##;
+
+ let result = 1, i = 1;
+ while i <= n { // No parens around the condition
+ result *= i;
+ i += 1;
+ }
+ ret result;
+}
+
+pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
+
+type t = map::hashtbl<int,str>;
+let x = id::<int>(10);
+
+// Define some modules.
+#[path = "foo.rs"]
+mod foo;
+
+impl <T> Seq<T> for [T] {
+ fn len() -> uint { vec::len(self) }
+ fn iter(b: fn(T)) {
+ for elt in self { b(elt); }
+ }
+}
+
+enum list<T> {
+ Nil;
+ Cons(T, @list<T>);
+}
+
+let a: list<int> = Cons(7, @cons(13, @nil));
+
+struct Baz<'a> {
+ baz: &'a str,
+}
+
+'h: for i in range(0,10) {
+ 'g: loop {
+ if i % 2 == 0 { continue 'h; }
+ if i == 9 { break 'h; }
+ break 'g;
+ }
+}
diff --git a/test/syntax/code/scala b/test/syntax/code/scala
new file mode 100644
index 00000000..d0de6175
--- /dev/null
+++ b/test/syntax/code/scala
@@ -0,0 +1,44 @@
+case class Person(name: String, age: Int)
+
+def absoluteValue(n: Int): Int =
+ if (n < 0) -n else n
+
+val hux = "hux"
+def mux = "mux"
+def qux: String = "qux"
+
+type ξ[A] = (A, A)
+
+trait Hist { lhs =>
+ def ⊕(rhs: Hist): Hist
+}
+
+def gsum[A: Ring](as: Seq[A]): A =
+ as.foldLeft(Ring[A].zero)(_ + _)
+
+sealed trait Compass
+case object North extends Compass
+case object South extends Compass
+case object East extends Compass
+case object West extends Compass
+
+trait Cake {
+ type T;
+ val things: Seq[T]
+
+ abstract class Spindler
+
+ def spindle(s: Spindler, ts: Seq[T], reversed: Boolean = false): Seq[T]
+}
+
+val colors = Map(
+ "red" -> 0xFF0000,
+ "turquoise" -> 0x00FFFF,
+ "black" -> 0x000000,
+ "orange" -> 0xFF8040,
+ "brown" -> 0x804000)
+
+lazy val ns = for {
+ x <- 0 until 100
+ y <- 0 until 100
+} yield (x + y) * 33.33
diff --git a/test/syntax/code/scheme b/test/syntax/code/scheme
new file mode 100644
index 00000000..b62a98cb
--- /dev/null
+++ b/test/syntax/code/scheme
@@ -0,0 +1,28 @@
+;; Calculation of Hofstadter's male and female sequences as a list of pairs
+
+(define (hofstadter-male-female n)
+(letrec ((female (lambda (n)
+ (if (= n 0)
+ 1
+ (- n (male (female (- n 1)))))))
+ (male (lambda (n)
+ (if (= n 0)
+ 0
+ (- n (female (male (- n 1))))))))
+ (let loop ((i 0))
+ (if (> i n)
+ '()
+ (cons (cons (female i)
+ (male i))
+ (loop (+ i 1)))))))
+
+(hofstadter-male-female 8)
+
+(define (find-first func lst)
+(call-with-current-continuation
+ (lambda (return-immediately)
+ (for-each (lambda (x)
+ (if (func x)
+ (return-immediately x)))
+ lst)
+ #f)))
diff --git a/test/syntax/code/smalltalk b/test/syntax/code/smalltalk
new file mode 100644
index 00000000..7c960a72
--- /dev/null
+++ b/test/syntax/code/smalltalk
@@ -0,0 +1,39 @@
+Object>>method: num
+ "comment 123"
+ | var1 var2 |
+ (1 to: num) do: [:i | |var| ^i].
+ Klass with: var1.
+ Klass new.
+ arr := #('123' 123.345 #hello Transcript var $@).
+ arr := #().
+ var2 = arr at: 3.
+ ^ self abc
+
+heapExample
+ "HeapTest new heapExample"
+ "Multiline
+ decription"
+ | n rnd array time sorted |
+ n := 5000.
+ "# of elements to sort"
+ rnd := Random new.
+ array := (1 to: n)
+ collect: [:i | rnd next].
+ "First, the heap version"
+ time := Time
+ millisecondsToRun: [sorted := Heap withAll: array.
+ 1
+ to: n
+ do: [:i |
+ sorted removeFirst.
+ sorted add: rnd next]].
+ Transcript cr; show: 'Time for Heap: ' , time printString , ' msecs'.
+ "The quicksort version"
+ time := Time
+ millisecondsToRun: [sorted := SortedCollection withAll: array.
+ 1
+ to: n
+ do: [:i |
+ sorted removeFirst.
+ sorted add: rnd next]].
+ Transcript cr; show: 'Time for SortedCollection: ' , time printString , ' msecs'
diff --git a/test/syntax/code/tcl b/test/syntax/code/tcl
new file mode 100644
index 00000000..c05db107
--- /dev/null
+++ b/test/syntax/code/tcl
@@ -0,0 +1,26 @@
+package json
+
+source helper.tcl
+# randomness verified by a die throw
+set ::rand 4
+
+proc give::recursive::count {base p} { ; # 2 mandatory params
+ while {$p > 0} {
+ set result [expr $result * $base]; incr p -1
+ }
+ return $result
+}
+
+set a 'a'; set b "bcdef"; set lst [list "item"]
+puts [llength $a$b]
+
+set ::my::tid($id) $::my::tid(def)
+lappend lst $arr($idx) $::my::arr($idx) $ar(key)
+lreplace ::my::tid($id) 4 4
+puts $::rand ${::rand} ${::AWESOME::component::variable}
+
+puts "$x + $y is\t [expr $x + $y]"
+
+proc isprime x {
+ expr {$x>1 && ![regexp {^(oo+?)\1+$} [string repeat o $x]]}
+}
diff --git a/test/syntax/code/tex b/test/syntax/code/tex
new file mode 100644
index 00000000..10b25557
--- /dev/null
+++ b/test/syntax/code/tex
@@ -0,0 +1,17 @@
+\documentclass{article}
+\usepackage[koi8-r]{inputenc}
+\hoffset=0pt
+\voffset=.3em
+\tolerance=400
+\newcommand{\eTiX}{\TeX}
+\begin{document}
+\section*{Highlight.js}
+\begin{table}[c|c]
+$\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $
+\end{table}
+Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b
+G\"otterd\"ammerung~45\%=34.
+$$
+ \int\limits_{0}^{\pi}\frac{4}{x-7}=3
+$$
+\end{document}
diff --git a/test/syntax/code/vala b/test/syntax/code/vala
new file mode 100644
index 00000000..aed04682
--- /dev/null
+++ b/test/syntax/code/vala
@@ -0,0 +1,46 @@
+using DBus;
+
+namespace Test {
+ class Foo : Object {
+ public signal void some_event (); // definition of the signal
+ public void method () {
+ some_event (); // emitting the signal (callbacks get invoked)
+ }
+ }
+}
+
+/* defining a class */
+class Track : GLib.Object, Test.Foo { /* subclassing 'GLib.Object' */
+ public double mass; /* a public field */
+ public double name { get; set; } /* a public property */
+ private bool terminated = false; /* a private field */
+ public void terminate() { /* a public method */
+ terminated = true;
+ }
+}
+
+const ALL_UPPER_CASE = "you should follow this convention";
+
+var t = new Track(); // same as: Track t = new Track();
+var s = "hello"; // same as: string s = "hello";
+var l = new List<int>(); // same as: List<int> l = new List<int>();
+var i = 10; // same as: int i = 10;
+
+
+#if (ololo)
+Regex regex = /foo/;
+#endif
+
+/*
+ * Entry point can be outside class
+ */
+void main () {
+ var long_string = """
+ Example of "verbatim string".
+ Same as in @"string" in C#
+ """
+ var foo = new Foo ();
+ foo.some_event.connect (callback_a); // connecting the callback functions
+ foo.some_event.connect (callback_b);
+ foo.method ();
+}
diff --git a/test/syntax/code/xml b/test/syntax/code/xml
new file mode 100644
index 00000000..7f002c4b
--- /dev/null
+++ b/test/syntax/code/xml
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<response value="ok" xml:lang="en">
+ <text>Ok</text>
+ <comment html_allowed="true"/>
+ <ns1:description><![CDATA[
+ CDATA is <not> magical.
+ ]]></ns1:description>
+ <a></a> <a/>
+</response>
+
+
+<!DOCTYPE html>
+<title>Title</title>
+
+<style>body {width: 500px;}</style>
+
+<script type="application/javascript">
+ function $init() {return true;}
+</script>
+
+<body>
+ <p checked class="title" id='title'>Title</p>
+ <!-- here goes the rest of the page -->
+</body>
diff --git a/test/syntax/code/xquery b/test/syntax/code/xquery
new file mode 100644
index 00000000..9ac5efdf
--- /dev/null
+++ b/test/syntax/code/xquery
@@ -0,0 +1,20 @@
+declare option output:method 'json';
+
+(
+let $map := map { 'R': 'red', 'G': 'green', 'B': 'blue' }
+return (
+ $map?* (: 1. returns all values; same as: map:keys($map) ! $map(.) :),
+ $map?R (: 2. returns the value associated with the key 'R'; same as: $map('R') :),
+ $map?('G','B') (: 3. returns the values associated with the key 'G' and 'B' :)
+),
+
+('A', 'B', 'C') => count(),
+
+for $country in db:open('factbook')//country
+where $country/@population > 100000000
+let $name := $country/name[1]
+for $city in $country//city[population > 1000000]
+group by $name
+return <country name='{ $name }'>{ $city/name }</country>
+
+)
diff --git a/test/syntax/code/yaml b/test/syntax/code/yaml
new file mode 100644
index 00000000..49c4939e
--- /dev/null
+++ b/test/syntax/code/yaml
@@ -0,0 +1,39 @@
+---
+# comment
+string_1: "Bar"
+string_2: 'bar'
+string_3: bar
+inline_keys_ignored: sompath/name/file.jpg
+keywords_in_yaml:
+ - true
+ - false
+ - TRUE
+ - FALSE
+ - 21
+ - 21.0
+ - !!str 123
+"quoted_key": &foobar
+ bar: foo
+ foo:
+ "foo": bar
+
+reference: *foobar
+
+multiline_1: |
+ Multiline
+ String
+multiline_2: >
+ Multiline
+ String
+multiline_3: "
+ Multiline string
+ "
+
+ansible_variables: "foo {{variable}}"
+
+array_nested:
+- a
+- b: 1
+ c: 2
+- b
+- comment
diff --git a/test/syntax/dita.dita b/test/syntax/dita.dita
new file mode 100644
index 00000000..72662ed2
--- /dev/null
+++ b/test/syntax/dita.dita
@@ -0,0 +1,614 @@
+<topic xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="dita">
+
+<title>Syntax Highlighting</title>
+
+<topic id="embedded">
+<title>Embedded Markup</title>
+<body>
+<codeblock outputclass="c">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <xref href="#">link</xref>
+ /* This is <varname>replaceable text</varname> */
+ int i = 12;
+ printf("hello %s\n", world);
+}
+</codeblock>
+</body>
+</topic>
+
+<topic id="actionscript">
+ <title>ActionScript</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="actionscript"</codeph></title>
+ <codeblock outputclass="actionscript"><xi:include parse="text" href="code/actionscript"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="apache">
+ <title>Apache Config</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="apache"</codeph></title>
+ <codeblock outputclass="apache"><xi:include parse="text" href="code/apache"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="asciidoc">
+ <title>AsciiDoc</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="asciidoc"</codeph></title>
+ <codeblock outputclass="asciidoc"><xi:include parse="text" href="code/asciidoc"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="adoc"</codeph></title>
+ <codeblock outputclass="adoc"><xi:include parse="text" href="code/asciidoc"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="bash">
+ <title>Bash</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="sh"</codeph></title>
+ <codeblock outputclass="sh"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="bash"</codeph></title>
+ <codeblock outputclass="bash"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="csh"</codeph></title>
+ <codeblock outputclass="csh"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="bourne"</codeph></title>
+ <codeblock outputclass="bourne"><xi:include parse="text" href="code/bash"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="c">
+ <title>C</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="c"</codeph></title>
+ <codeblock outputclass="c"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cs">
+ <title>C#</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cs"</codeph></title>
+ <codeblock outputclass="cs"><xi:include parse="text" href="code/cs"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="csharp"</codeph></title>
+ <codeblock outputclass="csharp"><xi:include parse="text" href="code/cs"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cpp">
+ <title>C++</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cpp"</codeph></title>
+ <codeblock outputclass="cpp"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="c++"</codeph></title>
+ <codeblock outputclass="c++"><xi:include parse="text" href="code/cpp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="clojure">
+ <title>Clojure</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="clojure"</codeph></title>
+ <codeblock outputclass="clojure"><xi:include parse="text" href="code/clojure"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="clj"</codeph></title>
+ <codeblock outputclass="clj"><xi:include parse="text" href="code/clojure"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="cmake">
+ <title>CMake</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="cmake"</codeph></title>
+ <codeblock outputclass="cmake"><xi:include parse="text" href="code/cmake"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="css">
+ <title>CSS</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="css"</codeph></title>
+ <codeblock outputclass="css"><xi:include parse="text" href="code/css"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="css21"</codeph></title>
+ <codeblock outputclass="css21"><xi:include parse="text" href="code/css"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="d">
+ <title>D</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="d"</codeph></title>
+ <codeblock outputclass="d"><xi:include parse="text" href="code/d"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="diff">
+ <title>Diff</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="diff"</codeph></title>
+ <codeblock outputclass="diff"><xi:include parse="text" href="code/diff"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="patch"</codeph></title>
+ <codeblock outputclass="patch"><xi:include parse="text" href="code/diff"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="django">
+ <title>Django</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="django"</codeph></title>
+ <codeblock outputclass="django"><xi:include parse="text" href="code/django"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="dockerfile">
+ <title>Dockerfile</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="dockerfile"</codeph></title>
+ <codeblock outputclass="dockerfile"><xi:include parse="text" href="code/dockerfile"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="dos">
+ <title>DOS Batch</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="dos"</codeph></title>
+ <codeblock outputclass="dos"><xi:include parse="text" href="code/dos"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="erb">
+ <title>Embedded Ruby</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="erb"</codeph></title>
+ <codeblock outputclass="erb"><xi:include parse="text" href="code/erb"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="fsharp">
+ <title>F#</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="fsharp"</codeph></title>
+ <codeblock outputclass="fsharp"><xi:include parse="text" href="code/fsharp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="go">
+ <title>Go</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="go"</codeph></title>
+ <codeblock outputclass="go"><xi:include parse="text" href="code/go"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="haml">
+ <title>Haml</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="haml"</codeph></title>
+ <codeblock outputclass="haml"><xi:include parse="text" href="code/haml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="haskell">
+ <title>Haskell</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="haskell"</codeph></title>
+ <codeblock outputclass="haskell"><xi:include parse="text" href="code/haskell"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="hs"</codeph></title>
+ <codeblock outputclass="hs"><xi:include parse="text" href="code/haskell"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="html">
+ <title>HTML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="html"</codeph></title>
+ <codeblock outputclass="html"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="xhtml"</codeph></title>
+ <codeblock outputclass="xhtml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="http">
+ <title>HTTP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="http"</codeph></title>
+ <codeblock outputclass="http"><xi:include parse="text" href="code/http"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="ini">
+ <title>INI</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="ini"</codeph></title>
+ <codeblock outputclass="ini"><xi:include parse="text" href="code/ini"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="java">
+ <title>Java</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="java"</codeph></title>
+ <codeblock outputclass="java"><xi:include parse="text" href="code/java"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="json">
+ <title>JSON</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="json"</codeph></title>
+ <codeblock outputclass="json"><xi:include parse="text" href="code/json"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="javascript">
+ <title>JavaScript</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="javascript"</codeph></title>
+ <codeblock outputclass="javascript"><xi:include parse="text" href="code/javascript"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="js"</codeph></title>
+ <codeblock outputclass="js"><xi:include parse="text" href="code/javascript"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="LISP">
+ <title>LISP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="lisp"</codeph></title>
+ <codeblock outputclass="lisp"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="cl"</codeph></title>
+ <codeblock outputclass="cl"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="el"</codeph></title>
+ <codeblock outputclass="el"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="lsp"</codeph></title>
+ <codeblock outputclass="lsp"><xi:include parse="text" href="code/lisp"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="lua">
+ <title>Lua</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="lua"</codeph></title>
+ <codeblock outputclass="lua"><xi:include parse="text" href="code/lua"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="makefile">
+ <title>Makefile</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="makefile"</codeph></title>
+ <codeblock outputclass="makefile"><xi:include parse="text" href="code/makefile"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="make"</codeph></title>
+ <codeblock outputclass="make"><xi:include parse="text" href="code/makefile"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="markdown">
+ <title>Markdown</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="markdown"</codeph></title>
+ <codeblock outputclass="markdown"><xi:include parse="text" href="code/markdown"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="md"</codeph></title>
+ <codeblock outputclass="md"><xi:include parse="text" href="code/markdown"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="matlab">
+ <title>MATLAB/Octave</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="matlab"</codeph></title>
+ <codeblock outputclass="matlab"><xi:include parse="text" href="code/matlab"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="octave"</codeph></title>
+ <codeblock outputclass="octave"><xi:include parse="text" href="code/matlab"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="nginx">
+ <title>Nginx Config</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="nginx"</codeph></title>
+ <codeblock outputclass="nginx"><xi:include parse="text" href="code/nginx"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="objectivec">
+ <title>Objective-C</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="objc"</codeph></title>
+ <codeblock outputclass="objc"><xi:include parse="text" href="code/objectivec"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="m"</codeph></title>
+ <codeblock outputclass="m"><xi:include parse="text" href="code/objectivec"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="perl">
+ <title>Perl</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="perl"</codeph></title>
+ <codeblock outputclass="perl"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="pl"</codeph></title>
+ <codeblock outputclass="pl"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="pm"</codeph></title>
+ <codeblock outputclass="pm"><xi:include parse="text" href="code/perl"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="php">
+ <title>PHP</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="php"</codeph></title>
+ <codeblock outputclass="php"><xi:include parse="text" href="code/php"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="python">
+ <title>Python</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="python"</codeph></title>
+ <codeblock outputclass="python"><xi:include parse="text" href="code/python"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="py"</codeph></title>
+ <codeblock outputclass="py"><xi:include parse="text" href="code/python"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="r">
+ <title>R/S</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="r"</codeph></title>
+ <codeblock outputclass="r"><xi:include parse="text" href="code/r"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="s"</codeph></title>
+ <codeblock outputclass="s"><xi:include parse="text" href="code/r"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="ruby">
+ <title>Ruby</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="ruby"</codeph></title>
+ <codeblock outputclass="ruby"><xi:include parse="text" href="code/ruby"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="rb"</codeph></title>
+ <codeblock outputclass="rb"><xi:include parse="text" href="code/ruby"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="rust">
+ <title>Rust</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="rust"</codeph></title>
+ <codeblock outputclass="rust"><xi:include parse="text" href="code/rust"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="scala">
+ <title>Scala</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="scala"</codeph></title>
+ <codeblock outputclass="scala"><xi:include parse="text" href="code/scala"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="scheme">
+ <title>Scheme</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="scheme"</codeph></title>
+ <codeblock outputclass="scheme"><xi:include parse="text" href="code/scheme"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="scm"</codeph></title>
+ <codeblock outputclass="scm"><xi:include parse="text" href="code/scheme"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="smalltalk">
+ <title>Smalltalk</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="smalltalk"</codeph></title>
+ <codeblock outputclass="smalltalk"><xi:include parse="text" href="code/smalltalk"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="tcl">
+ <title>TCL</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="tcl"</codeph></title>
+ <codeblock outputclass="tcl"><xi:include parse="text" href="code/tcl"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="tex">
+ <title>TeX</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="tex"</codeph></title>
+ <codeblock outputclass="tex"><xi:include parse="text" href="code/tex"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="latex"</codeph></title>
+ <codeblock outputclass="latex"><xi:include parse="text" href="code/tex"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="vala">
+ <title>Vala</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="vala"</codeph></title>
+ <codeblock outputclass="vala"><xi:include parse="text" href="code/vala"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="xml">
+ <title>XML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="xml"</codeph></title>
+ <codeblock outputclass="xml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="myxml"</codeph></title>
+ <codeblock outputclass="myxml"><xi:include parse="text" href="code/xml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="xquery">
+ <title>XQuery</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="xquery"</codeph></title>
+ <codeblock outputclass="xquery"><xi:include parse="text" href="code/xquery"/></codeblock>
+ </section>
+ <section>
+ <title><codeph>outputclass="xq"</codeph></title>
+ <codeblock outputclass="xq"><xi:include parse="text" href="code/xquery"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+<topic id="yaml">
+ <title>YAML</title>
+ <body>
+ <section>
+ <title><codeph>outputclass="yaml"</codeph></title>
+ <codeblock outputclass="yaml"><xi:include parse="text" href="code/yaml"/></codeblock>
+ </section>
+ </body>
+</topic>
+
+</topic>
+
diff --git a/test/syntax/docbook.docbook b/test/syntax/docbook.docbook
new file mode 100644
index 00000000..12d0043c
--- /dev/null
+++ b/test/syntax/docbook.docbook
@@ -0,0 +1,517 @@
+<article xmlns="http://docbook.org/ns/docbook"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="docbook">
+
+<title>Syntax Highlighting</title>
+
+<section id="embedded">
+<title>Embedded Markup</title>
+<programlisting language="c">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <link xlink:href="#">link</link>
+ /* This is <replaceable>replaceable text</replaceable> */
+ int i = 12;
+ printf("hello %s\n", world);
+}
+</programlisting>
+</section>
+
+<section id="actionscript">
+ <title>ActionScript</title>
+ <example>
+ <title><code>language="actionscript"</code></title>
+ <programlisting language="actionscript"><xi:include parse="text" href="code/actionscript"/></programlisting>
+ </example>
+</section>
+
+<section id="apache">
+ <title>Apache Config</title>
+ <example>
+ <title><code>language="apache"</code></title>
+ <programlisting language="apache"><xi:include parse="text" href="code/apache"/></programlisting>
+ </example>
+</section>
+
+<section id="asciidoc">
+ <title>AsciiDoc</title>
+ <example>
+ <title><code>language="asciidoc"</code></title>
+ <programlisting language="asciidoc"><xi:include parse="text" href="code/asciidoc"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="adoc"</code></title>
+ <programlisting language="adoc"><xi:include parse="text" href="code/asciidoc"/></programlisting>
+ </example>
+</section>
+
+<section id="bash">
+ <title>Bash</title>
+ <example>
+ <title><code>language="sh"</code></title>
+ <programlisting language="sh"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="bash"</code></title>
+ <programlisting language="bash"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="csh"</code></title>
+ <programlisting language="csh"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="bourne"</code></title>
+ <programlisting language="bourne"><xi:include parse="text" href="code/bash"/></programlisting>
+ </example>
+</section>
+
+<section id="c">
+ <title>C</title>
+ <example>
+ <title><code>language="c"</code></title>
+ <programlisting language="c"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+</section>
+
+<section id="cs">
+ <title>C#</title>
+ <example>
+ <title><code>language="cs"</code></title>
+ <programlisting language="cs"><xi:include parse="text" href="code/cs"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="csharp"</code></title>
+ <programlisting language="csharp"><xi:include parse="text" href="code/cs"/></programlisting>
+ </example>
+</section>
+
+<section id="cpp">
+ <title>C++</title>
+ <example>
+ <title><code>language="cpp"</code></title>
+ <programlisting language="cpp"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="c++"</code></title>
+ <programlisting language="c++"><xi:include parse="text" href="code/cpp"/></programlisting>
+ </example>
+</section>
+
+<section id="clojure">
+ <title>Clojure</title>
+ <example>
+ <title><code>language="clojure"</code></title>
+ <programlisting language="clojure"><xi:include parse="text" href="code/clojure"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="clj"</code></title>
+ <programlisting language="clj"><xi:include parse="text" href="code/clojure"/></programlisting>
+ </example>
+</section>
+
+<section id="cmake">
+ <title>CMake</title>
+ <example>
+ <title><code>language="cmake"</code></title>
+ <programlisting language="cmake"><xi:include parse="text" href="code/cmake"/></programlisting>
+ </example>
+</section>
+
+<section id="css">
+ <title>CSS</title>
+ <example>
+ <title><code>language="css"</code></title>
+ <programlisting language="css"><xi:include parse="text" href="code/css"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="css21"</code></title>
+ <programlisting language="css21"><xi:include parse="text" href="code/css"/></programlisting>
+ </example>
+</section>
+
+<section id="d">
+ <title>D</title>
+ <example>
+ <title><code>language="d"</code></title>
+ <programlisting language="d"><xi:include parse="text" href="code/d"/></programlisting>
+ </example>
+</section>
+
+<section id="diff">
+ <title>Diff</title>
+ <example>
+ <title><code>language="diff"</code></title>
+ <programlisting language="diff"><xi:include parse="text" href="code/diff"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="patch"</code></title>
+ <programlisting language="patch"><xi:include parse="text" href="code/diff"/></programlisting>
+ </example>
+</section>
+
+<section id="django">
+ <title>Django</title>
+ <example>
+ <title><code>language="django"</code></title>
+ <programlisting language="django"><xi:include parse="text" href="code/django"/></programlisting>
+ </example>
+</section>
+
+<section id="dockerfile">
+ <title>Dockerfile</title>
+ <example>
+ <title><code>language="dockerfile"</code></title>
+ <programlisting language="dockerfile"><xi:include parse="text" href="code/dockerfile"/></programlisting>
+ </example>
+</section>
+
+<section id="dos">
+ <title>DOS Batch</title>
+ <example>
+ <title><code>language="dos"</code></title>
+ <programlisting language="dos"><xi:include parse="text" href="code/dos"/></programlisting>
+ </example>
+</section>
+
+<section id="erb">
+ <title>Embedded Ruby</title>
+ <example>
+ <title><code>language="erb"</code></title>
+ <programlisting language="erb"><xi:include parse="text" href="code/erb"/></programlisting>
+ </example>
+</section>
+
+<section id="fsharp">
+ <title>F#</title>
+ <example>
+ <title><code>language="fsharp"</code></title>
+ <programlisting language="fsharp"><xi:include parse="text" href="code/fsharp"/></programlisting>
+ </example>
+</section>
+
+<section id="go">
+ <title>Go</title>
+ <example>
+ <title><code>language="go"</code></title>
+ <programlisting language="go"><xi:include parse="text" href="code/go"/></programlisting>
+ </example>
+</section>
+
+<section id="haml">
+ <title>Haml</title>
+ <example>
+ <title><code>language="haml"</code></title>
+ <programlisting language="haml"><xi:include parse="text" href="code/haml"/></programlisting>
+ </example>
+</section>
+
+<section id="haskell">
+ <title>Haskell</title>
+ <example>
+ <title><code>language="haskell"</code></title>
+ <programlisting language="haskell"><xi:include parse="text" href="code/haskell"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="hs"</code></title>
+ <programlisting language="hs"><xi:include parse="text" href="code/haskell"/></programlisting>
+ </example>
+</section>
+
+<section id="html">
+ <title>HTML</title>
+ <example>
+ <title><code>language="html"</code></title>
+ <programlisting language="html"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="xhtml"</code></title>
+ <programlisting language="xhtml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+</section>
+
+<section id="http">
+ <title>HTTP</title>
+ <example>
+ <title><code>language="http"</code></title>
+ <programlisting language="http"><xi:include parse="text" href="code/http"/></programlisting>
+ </example>
+</section>
+
+<section id="ini">
+ <title>INI</title>
+ <example>
+ <title><code>language="ini"</code></title>
+ <programlisting language="ini"><xi:include parse="text" href="code/ini"/></programlisting>
+ </example>
+</section>
+
+<section id="java">
+ <title>Java</title>
+ <example>
+ <title><code>language="java"</code></title>
+ <programlisting language="java"><xi:include parse="text" href="code/java"/></programlisting>
+ </example>
+</section>
+
+<section id="json">
+ <title>JSON</title>
+ <example>
+ <title><code>language="json"</code></title>
+ <programlisting language="json"><xi:include parse="text" href="code/json"/></programlisting>
+ </example>
+</section>
+
+<section id="javascript">
+ <title>JavaScript</title>
+ <example>
+ <title><code>language="javascript"</code></title>
+ <programlisting language="javascript"><xi:include parse="text" href="code/javascript"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="js"</code></title>
+ <programlisting language="js"><xi:include parse="text" href="code/javascript"/></programlisting>
+ </example>
+</section>
+
+<section id="LISP">
+ <title>LISP</title>
+ <example>
+ <title><code>language="lisp"</code></title>
+ <programlisting language="lisp"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="cl"</code></title>
+ <programlisting language="cl"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="el"</code></title>
+ <programlisting language="el"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="lsp"</code></title>
+ <programlisting language="lsp"><xi:include parse="text" href="code/lisp"/></programlisting>
+ </example>
+</section>
+
+<section id="lua">
+ <title>Lua</title>
+ <example>
+ <title><code>language="lua"</code></title>
+ <programlisting language="lua"><xi:include parse="text" href="code/lua"/></programlisting>
+ </example>
+</section>
+
+<section id="makefile">
+ <title>Makefile</title>
+ <example>
+ <title><code>language="makefile"</code></title>
+ <programlisting language="makefile"><xi:include parse="text" href="code/makefile"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="make"</code></title>
+ <programlisting language="make"><xi:include parse="text" href="code/makefile"/></programlisting>
+ </example>
+</section>
+
+<section id="markdown">
+ <title>Markdown</title>
+ <example>
+ <title><code>language="markdown"</code></title>
+ <programlisting language="markdown"><xi:include parse="text" href="code/markdown"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="md"</code></title>
+ <programlisting language="md"><xi:include parse="text" href="code/markdown"/></programlisting>
+ </example>
+</section>
+
+<section id="matlab">
+ <title>MATLAB/Octave</title>
+ <example>
+ <title><code>language="matlab"</code></title>
+ <programlisting language="matlab"><xi:include parse="text" href="code/matlab"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="octave"</code></title>
+ <programlisting language="octave"><xi:include parse="text" href="code/matlab"/></programlisting>
+ </example>
+</section>
+
+<section id="nginx">
+ <title>Nginx Config</title>
+ <example>
+ <title><code>language="nginx"</code></title>
+ <programlisting language="nginx"><xi:include parse="text" href="code/nginx"/></programlisting>
+ </example>
+</section>
+
+<section id="objectivec">
+ <title>Objective-C</title>
+ <example>
+ <title><code>language="objc"</code></title>
+ <programlisting language="objc"><xi:include parse="text" href="code/objectivec"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="m"</code></title>
+ <programlisting language="m"><xi:include parse="text" href="code/objectivec"/></programlisting>
+ </example>
+</section>
+
+<section id="perl">
+ <title>Perl</title>
+ <example>
+ <title><code>language="perl"</code></title>
+ <programlisting language="perl"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="pl"</code></title>
+ <programlisting language="pl"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="pm"</code></title>
+ <programlisting language="pm"><xi:include parse="text" href="code/perl"/></programlisting>
+ </example>
+</section>
+
+<section id="php">
+ <title>PHP</title>
+ <example>
+ <title><code>language="php"</code></title>
+ <programlisting language="php"><xi:include parse="text" href="code/php"/></programlisting>
+ </example>
+</section>
+
+<section id="python">
+ <title>Python</title>
+ <example>
+ <title><code>language="python"</code></title>
+ <programlisting language="python"><xi:include parse="text" href="code/python"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="py"</code></title>
+ <programlisting language="py"><xi:include parse="text" href="code/python"/></programlisting>
+ </example>
+</section>
+
+<section id="r">
+ <title>R/S</title>
+ <example>
+ <title><code>language="r"</code></title>
+ <programlisting language="r"><xi:include parse="text" href="code/r"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="s"</code></title>
+ <programlisting language="s"><xi:include parse="text" href="code/r"/></programlisting>
+ </example>
+</section>
+
+<section id="ruby">
+ <title>Ruby</title>
+ <example>
+ <title><code>language="ruby"</code></title>
+ <programlisting language="ruby"><xi:include parse="text" href="code/ruby"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="rb"</code></title>
+ <programlisting language="rb"><xi:include parse="text" href="code/ruby"/></programlisting>
+ </example>
+</section>
+
+<section id="rust">
+ <title>Rust</title>
+ <example>
+ <title><code>language="rust"</code></title>
+ <programlisting language="rust"><xi:include parse="text" href="code/rust"/></programlisting>
+ </example>
+</section>
+
+<section id="scala">
+ <title>Scala</title>
+ <example>
+ <title><code>language="scala"</code></title>
+ <programlisting language="scala"><xi:include parse="text" href="code/scala"/></programlisting>
+ </example>
+</section>
+
+<section id="scheme">
+ <title>Scheme</title>
+ <example>
+ <title><code>language="scheme"</code></title>
+ <programlisting language="scheme"><xi:include parse="text" href="code/scheme"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="scm"</code></title>
+ <programlisting language="scm"><xi:include parse="text" href="code/scheme"/></programlisting>
+ </example>
+</section>
+
+<section id="smalltalk">
+ <title>Smalltalk</title>
+ <example>
+ <title><code>language="smalltalk"</code></title>
+ <programlisting language="smalltalk"><xi:include parse="text" href="code/smalltalk"/></programlisting>
+ </example>
+</section>
+
+<section id="tcl">
+ <title>TCL</title>
+ <example>
+ <title><code>language="tcl"</code></title>
+ <programlisting language="tcl"><xi:include parse="text" href="code/tcl"/></programlisting>
+ </example>
+</section>
+
+<section id="tex">
+ <title>TeX</title>
+ <example>
+ <title><code>language="tex"</code></title>
+ <programlisting language="tex"><xi:include parse="text" href="code/tex"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="latex"</code></title>
+ <programlisting language="latex"><xi:include parse="text" href="code/tex"/></programlisting>
+ </example>
+</section>
+
+<section id="vala">
+ <title>Vala</title>
+ <example>
+ <title><code>language="vala"</code></title>
+ <programlisting language="vala"><xi:include parse="text" href="code/vala"/></programlisting>
+ </example>
+</section>
+
+<section id="xml">
+ <title>XML</title>
+ <example>
+ <title><code>language="xml"</code></title>
+ <programlisting language="xml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="myxml"</code></title>
+ <programlisting language="myxml"><xi:include parse="text" href="code/xml"/></programlisting>
+ </example>
+</section>
+
+<section id="xquery">
+ <title>XQuery</title>
+ <example>
+ <title><code>language="xquery"</code></title>
+ <programlisting language="xquery"><xi:include parse="text" href="code/xquery"/></programlisting>
+ </example>
+ <example>
+ <title><code>language="xq"</code></title>
+ <programlisting language="xq"><xi:include parse="text" href="code/xquery"/></programlisting>
+ </example>
+</section>
+
+<section id="yaml">
+ <title>YAML</title>
+ <example>
+ <title><code>language="yaml"</code></title>
+ <programlisting language="yaml"><xi:include parse="text" href="code/yaml"/></programlisting>
+ </example>
+</section>
+
+</article>
diff --git a/test/syntax/mallard.page b/test/syntax/mallard.page
new file mode 100644
index 00000000..0066207c
--- /dev/null
+++ b/test/syntax/mallard.page
@@ -0,0 +1,713 @@
+<page xmlns="http://projectmallard.org/1.0/"
+ xmlns:e="http://projectmallard.org/experimental/"
+ xmlns:ui="http://projectmallard.org/ui/1.0/"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ id="mallard">
+<title>Syntax Highlighting</title>
+
+<section id="embedded">
+<title>Embedded Markup</title>
+<code mime="text/x-csrc">
+#include &lt;stdlib.h>
+int main(char** argv) {
+ // This is a <link href="#">link</link>
+ /* This is <var>replaceable text</var> */
+ int i = 12;
+ printf(<e:hi>"hello %s\n"</e:hi>, world);
+}
+</code>
+</section>
+
+<section id="actionscript">
+ <title>ActionScript</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-actionscript"</code></title>
+ <code mime="application/x-actionscript"><xi:include parse="text" href="code/actionscript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="actionscript"</code></title>
+ <code type="actionscript"><xi:include parse="text" href="code/actionscript"/></code>
+ </listing>
+</section>
+
+<section id="apache">
+ <title>Apache Config</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-apacheconf"</code></title>
+ <code mime="text/x-apacheconf"><xi:include parse="text" href="code/apache"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="apache"</code></title>
+ <code type="apache"><xi:include parse="text" href="code/apache"/></code>
+ </listing>
+</section>
+
+<section id="asciidoc">
+ <title>AsciiDoc</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-asciidoc"</code></title>
+ <code mime="text/x-asciidoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="asciidoc"</code></title>
+ <code type="asciidoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="adoc"</code></title>
+ <code type="adoc"><xi:include parse="text" href="code/asciidoc"/></code>
+ </listing>
+</section>
+
+<section id="bash">
+ <title>Bash</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-shellscript"</code></title>
+ <code mime="application/x-shellscript"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="sh"</code></title>
+ <code type="sh"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="bash"</code></title>
+ <code type="bash"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="csh"</code></title>
+ <code type="csh"><xi:include parse="text" href="code/bash"/></code>
+ </listing>
+</section>
+
+<section id="c">
+ <title>C</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-chdr"</code></title>
+ <code mime="text/x-chdr"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-csrc"</code></title>
+ <code mime="text/x-csrc"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="c"</code></title>
+ <code type="c"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+</section>
+
+<section id="cs">
+ <title>C#</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-csharp"</code></title>
+ <code mime="text/x-csharp"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cs"</code></title>
+ <code type="cs"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="csharp"</code></title>
+ <code type="csharp"><xi:include parse="text" href="code/cs"/></code>
+ </listing>
+</section>
+
+<section id="cpp">
+ <title>C++</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-c++hdr"</code></title>
+ <code mime="text/x-c++hdr"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-c++src"</code></title>
+ <code mime="text/x-c++src"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cpp"</code></title>
+ <code type="cpp"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="c++"</code></title>
+ <code type="c++"><xi:include parse="text" href="code/cpp"/></code>
+ </listing>
+</section>
+
+<section id="clojure">
+ <title>Clojure</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-clojure"</code></title>
+ <code mime="application/x-clojure"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="clojure"</code></title>
+ <code type="clojure"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="clj"</code></title>
+ <code type="clj"><xi:include parse="text" href="code/clojure"/></code>
+ </listing>
+</section>
+
+<section id="cmake">
+ <title>CMake</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-cmake"</code></title>
+ <code mime="text/x-cmake"><xi:include parse="text" href="code/cmake"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cmake"</code></title>
+ <code type="cmake"><xi:include parse="text" href="code/cmake"/></code>
+ </listing>
+</section>
+
+<section id="css">
+ <title>CSS</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/css"</code></title>
+ <code mime="text/css"><xi:include parse="text" href="code/css"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="css"</code></title>
+ <code type="css"><xi:include parse="text" href="code/css"/></code>
+ </listing>
+</section>
+
+<section id="d">
+ <title>D</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-d"</code></title>
+ <code mime="text/x-d"><xi:include parse="text" href="code/d"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="d"</code></title>
+ <code type="d"><xi:include parse="text" href="code/d"/></code>
+ </listing>
+</section>
+
+<section id="diff">
+ <title>Diff</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-diff"</code></title>
+ <code mime="text/x-diff"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-patch"</code></title>
+ <code mime="text/x-patch"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="diff"</code></title>
+ <code type="diff"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="patch"</code></title>
+ <code type="patch"><xi:include parse="text" href="code/diff"/></code>
+ </listing>
+</section>
+
+<section id="django">
+ <title>Django</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-django-templating"</code></title>
+ <code mime="application/x-django-templating"><xi:include parse="text" href="code/django"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="django"</code></title>
+ <code type="django"><xi:include parse="text" href="code/django"/></code>
+ </listing>
+</section>
+
+<section id="dockerfile">
+ <title>Dockerfile</title>
+ <listing ui:expanded="false">
+ <title><code>type="dockerfile"</code></title>
+ <code type="dockerfile"><xi:include parse="text" href="code/dockerfile"/></code>
+ </listing>
+</section>
+
+<section id="dos">
+ <title>DOS Batch</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-dos-batch"</code></title>
+ <code mime="application/x-dos-batch"><xi:include parse="text" href="code/dos"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="dos"</code></title>
+ <code type="dos"><xi:include parse="text" href="code/dos"/></code>
+ </listing>
+</section>
+
+<section id="erb">
+ <title>Embedded Ruby</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-ruby-templating"</code></title>
+ <code mime="application/x-ruby-templating"><xi:include parse="text" href="code/erb"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="erb"</code></title>
+ <code type="erb"><xi:include parse="text" href="code/erb"/></code>
+ </listing>
+</section>
+
+<section id="fsharp">
+ <title>F#</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-fsharp"</code></title>
+ <code mime="text/x-fsharp"><xi:include parse="text" href="code/fsharp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="fsharp"</code></title>
+ <code type="fsharp"><xi:include parse="text" href="code/fsharp"/></code>
+ </listing>
+</section>
+
+<section id="go">
+ <title>Go</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-go"</code></title>
+ <code mime="text/x-go"><xi:include parse="text" href="code/go"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="go"</code></title>
+ <code type="go"><xi:include parse="text" href="code/go"/></code>
+ </listing>
+</section>
+
+<section id="haml">
+ <title>Haml</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-haml"</code></title>
+ <code mime="text/x-haml"><xi:include parse="text" href="code/haml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="haml"</code></title>
+ <code type="haml"><xi:include parse="text" href="code/haml"/></code>
+ </listing>
+</section>
+
+<section id="haskell">
+ <title>Haskell</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-haskell"</code></title>
+ <code mime="text/x-haskell"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="haskell"</code></title>
+ <code type="haskell"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="hs"</code></title>
+ <code type="hs"><xi:include parse="text" href="code/haskell"/></code>
+ </listing>
+</section>
+
+<section id="html">
+ <title>HTML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/html"</code></title>
+ <code mime="text/html"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="html"</code></title>
+ <code type="html"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xhtml"</code></title>
+ <code type="xhtml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+</section>
+
+<section id="http">
+ <title>HTTP</title>
+ <listing ui:expanded="false">
+ <title><code>type="http"</code></title>
+ <code type="http"><xi:include parse="text" href="code/http"/></code>
+ </listing>
+</section>
+
+<section id="ini">
+ <title>INI</title>
+ <listing ui:expanded="false">
+ <title><code>type="ini"</code></title>
+ <code type="ini"><xi:include parse="text" href="code/ini"/></code>
+ </listing>
+</section>
+
+<section id="java">
+ <title>Java</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-java"</code></title>
+ <code mime="text/x-java"><xi:include parse="text" href="code/java"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="java"</code></title>
+ <code type="java"><xi:include parse="text" href="code/java"/></code>
+ </listing>
+</section>
+
+<section id="json">
+ <title>JSON</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/json"</code></title>
+ <code mime="application/json"><xi:include parse="text" href="code/json"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="json"</code></title>
+ <code type="json"><xi:include parse="text" href="code/json"/></code>
+ </listing>
+</section>
+
+<section id="javascript">
+ <title>JavaScript</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/javascript"</code></title>
+ <code mime="application/javascript"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="javascript"</code></title>
+ <code type="javascript"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="js"</code></title>
+ <code type="js"><xi:include parse="text" href="code/javascript"/></code>
+ </listing>
+</section>
+
+<section id="LISP">
+ <title>LISP</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-lisp"</code></title>
+ <code mime="application/x-lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-emacs-lisp"</code></title>
+ <code mime="text/x-emacs-lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lisp"</code></title>
+ <code type="lisp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="cl"</code></title>
+ <code type="cl"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="el"</code></title>
+ <code type="el"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lsp"</code></title>
+ <code type="lsp"><xi:include parse="text" href="code/lisp"/></code>
+ </listing>
+</section>
+
+<section id="lua">
+ <title>Lua</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-lua"</code></title>
+ <code mime="text/x-lua"><xi:include parse="text" href="code/lua"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="lua"</code></title>
+ <code type="lua"><xi:include parse="text" href="code/lua"/></code>
+ </listing>
+</section>
+
+<section id="makefile">
+ <title>Makefile</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-makefile"</code></title>
+ <code mime="text/x-makefile"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="makefile"</code></title>
+ <code type="makefile"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="make"</code></title>
+ <code type="make"><xi:include parse="text" href="code/makefile"/></code>
+ </listing>
+</section>
+
+<section id="markdown">
+ <title>Markdown</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-markdown"</code></title>
+ <code mime="text/x-markdown"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="markdown"</code></title>
+ <code type="markdown"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="md"</code></title>
+ <code type="md"><xi:include parse="text" href="code/markdown"/></code>
+ </listing>
+</section>
+
+<section id="matlab">
+ <title>MATLAB/Octave</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-matlab"</code></title>
+ <code mime="text/x-matlab"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-octave"</code></title>
+ <code mime="text/x-octave"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="matlab"</code></title>
+ <code type="matlab"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="octave"</code></title>
+ <code type="octave"><xi:include parse="text" href="code/matlab"/></code>
+ </listing>
+</section>
+
+<section id="nginx">
+ <title>Nginx Config</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-nginx-conf"</code></title>
+ <code mime="text/x-nginx-conf"><xi:include parse="text" href="code/nginx"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="nginx"</code></title>
+ <code type="nginx"><xi:include parse="text" href="code/nginx"/></code>
+ </listing>
+</section>
+
+<section id="objectivec">
+ <title>Objective-C</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-objcsrc"</code></title>
+ <code mime="text/x-objcsrc"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="objc"</code></title>
+ <code type="objc"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="m"</code></title>
+ <code type="m"><xi:include parse="text" href="code/objectivec"/></code>
+ </listing>
+</section>
+
+<section id="perl">
+ <title>Perl</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-perl"</code></title>
+ <code mime="application/x-perl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="perl"</code></title>
+ <code type="perl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="pl"</code></title>
+ <code type="pl"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="pm"</code></title>
+ <code type="pm"><xi:include parse="text" href="code/perl"/></code>
+ </listing>
+</section>
+
+<section id="php">
+ <title>PHP</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-php"</code></title>
+ <code mime="application/x-php"><xi:include parse="text" href="code/php"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="php"</code></title>
+ <code type="php"><xi:include parse="text" href="code/php"/></code>
+ </listing>
+</section>
+
+<section id="python">
+ <title>Python</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-python"</code></title>
+ <code mime="text/x-python"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="python"</code></title>
+ <code type="python"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="py"</code></title>
+ <code type="py"><xi:include parse="text" href="code/python"/></code>
+ </listing>
+</section>
+
+<section id="r">
+ <title>R/S</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-r"</code></title>
+ <code mime="text/x-r"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-s"</code></title>
+ <code mime="text/x-s"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="r"</code></title>
+ <code type="r"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="s"</code></title>
+ <code type="s"><xi:include parse="text" href="code/r"/></code>
+ </listing>
+</section>
+
+<section id="ruby">
+ <title>Ruby</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-ruby"</code></title>
+ <code mime="application/x-ruby"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="ruby"</code></title>
+ <code type="ruby"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="rb"</code></title>
+ <code type="rb"><xi:include parse="text" href="code/ruby"/></code>
+ </listing>
+</section>
+
+<section id="rust">
+ <title>Rust</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-rust"</code></title>
+ <code mime="text/x-rust"><xi:include parse="text" href="code/rust"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="rust"</code></title>
+ <code type="rust"><xi:include parse="text" href="code/rust"/></code>
+ </listing>
+</section>
+
+<section id="scala">
+ <title>Scala</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-scala"</code></title>
+ <code mime="text/x-scala"><xi:include parse="text" href="code/scala"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scala"</code></title>
+ <code type="scala"><xi:include parse="text" href="code/scala"/></code>
+ </listing>
+</section>
+
+<section id="scheme">
+ <title>Scheme</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-scheme"</code></title>
+ <code mime="text/x-scheme"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scheme"</code></title>
+ <code type="scheme"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="scm"</code></title>
+ <code type="scm"><xi:include parse="text" href="code/scheme"/></code>
+ </listing>
+</section>
+
+<section id="smalltalk">
+ <title>Smalltalk</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-smalltalk"</code></title>
+ <code mime="text/x-smalltalk"><xi:include parse="text" href="code/smalltalk"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="smalltalk"</code></title>
+ <code type="smalltalk"><xi:include parse="text" href="code/smalltalk"/></code>
+ </listing>
+</section>
+
+<section id="tcl">
+ <title>TCL</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-tcl"</code></title>
+ <code mime="application/x-tcl"><xi:include parse="text" href="code/tcl"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="tcl"</code></title>
+ <code type="tcl"><xi:include parse="text" href="code/tcl"/></code>
+ </listing>
+</section>
+
+<section id="tex">
+ <title>TeX</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-tex"</code></title>
+ <code mime="text/x-tex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="tex"</code></title>
+ <code type="tex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="latex"</code></title>
+ <code type="latex"><xi:include parse="text" href="code/tex"/></code>
+ </listing>
+</section>
+
+<section id="vala">
+ <title>Vala</title>
+ <listing ui:expanded="false">
+ <title><code>mime="text/x-vala"</code></title>
+ <code mime="text/x-vala"><xi:include parse="text" href="code/vala"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="vala"</code></title>
+ <code type="vala"><xi:include parse="text" href="code/vala"/></code>
+ </listing>
+</section>
+
+<section id="xml">
+ <title>XML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/xml"</code></title>
+ <code mime="application/xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>mime="application/docbook+xml"</code></title>
+ <code mime="application/docbook+xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xml"</code></title>
+ <code type="xml"><xi:include parse="text" href="code/xml"/></code>
+ </listing>
+</section>
+
+<section id="xquery">
+ <title>XQuery</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/xquery"</code></title>
+ <code mime="application/xquery"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xquery"</code></title>
+ <code type="xquery"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="xq"</code></title>
+ <code type="xq"><xi:include parse="text" href="code/xquery"/></code>
+ </listing>
+</section>
+
+<section id="yaml">
+ <title>YAML</title>
+ <listing ui:expanded="false">
+ <title><code>mime="application/x-yaml"</code></title>
+ <code mime="application/x-yaml"><xi:include parse="text" href="code/yaml"/></code>
+ </listing>
+ <listing ui:expanded="false">
+ <title><code>type="yaml"</code></title>
+ <code type="yaml"><xi:include parse="text" href="code/yaml"/></code>
+ </listing>
+</section>
+
+</page>
diff --git a/xslt/common/color.xsl b/xslt/common/color.xsl
index 97fedc16..64790609 100644
--- a/xslt/common/color.xsl
+++ b/xslt/common/color.xsl
@@ -15,189 +15,946 @@ along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:math="http://exslt.org/math"
+ exclude-result-prefixes="math"
version="1.0">
<!--!!==========================================================================
Colors
-Specify common named colors to style output.
-:Revision:version="1.0" date="2010-05-25" status="final"
+Common named colors and color utilities for output styling.
+:Revision:version="3.20" date="2016-01-03" status="final"
This stylesheet provides a common interface to specify custom colors for
transformations to presentation-oreinted formats. This allows similar
output for different types of input documents.
+
+This stylesheet also provides a number of templates for manipulating colors
+and extracting information about colors.
+-->
+
+
+<!--**==========================================================================
+color.hex2dec
+Convert a hexidecimal number to decimal.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$hex: The hexidecimal number to convert to decimal.
+
+This template converts a hexidecimal number to decimal. It's useful for getting
+the numeric values of color components in a hexidecimal color code.
+-->
+<xsl:template name="color.hex2dec">
+ <xsl:param name="hex"/>
+ <xsl:variable name="char" select="substring($hex, string-length($hex))"/>
+ <xsl:variable name="dec">
+ <xsl:choose>
+ <xsl:when test="$char = 'a' or $char = 'A'">10</xsl:when>
+ <xsl:when test="$char = 'b' or $char = 'B'">11</xsl:when>
+ <xsl:when test="$char = 'c' or $char = 'C'">12</xsl:when>
+ <xsl:when test="$char = 'd' or $char = 'D'">13</xsl:when>
+ <xsl:when test="$char = 'e' or $char = 'E'">14</xsl:when>
+ <xsl:when test="$char = 'f' or $char = 'F'">15</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$char"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($hex) = 1">
+ <xsl:value-of select="number($dec)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="tens">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="substring($hex, 1, string-length($hex) - 1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$dec + 16 * $tens"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.r
+Extract the red component of a color.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$color: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template extracts the red portion of a color, returning a number between
+0 and 255. It accepts six-digit and three-digit hexidecimal color codes,
+colors specified with #{rgb()}, and colors specified with #{rgba()}. It does
+not accept HSL or named HTML colors.
+-->
+<xsl:template name="color.r">
+ <xsl:param name="color"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 7">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="substring($color, 2, 2)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 4">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="concat(substring($color, 2, 1), substring($color, 2, 1))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, 'rgb(') or starts-with($color, 'rgba(')">
+ <xsl:value-of select="substring-before(substring-after($color, '('), ',')"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.g
+Extract the green component of a color.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$color: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template extracts the green portion of a color, returning a number between
+0 and 255. It accepts six-digit and three-digit hexidecimal color codes,
+colors specified with #{rgb()}, and colors specified with #{rgba()}. It does
+not accept HSL or named HTML colors.
+-->
+<xsl:template name="color.g">
+ <xsl:param name="color"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 7">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="substring($color, 4, 2)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 4">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="concat(substring($color, 3, 1), substring($color, 3, 1))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, 'rgb(') or starts-with($color, 'rgba(')">
+ <xsl:value-of select="substring-before(substring-after($color, ','), ',')"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.b
+Extract the blue component of a color.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$color: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template extracts the blue portion of a color, returning a number between
+0 and 255. It accepts six-digit and three-digit hexidecimal color codes,
+colors specified with #{rgb()}, and colors specified with #{rgba()}. It does
+not accept HSL or named HTML colors.
+-->
+<xsl:template name="color.b">
+ <xsl:param name="color"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 7">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="substring($color, 6, 2)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, '#') and string-length($color) = 4">
+ <xsl:call-template name="color.hex2dec">
+ <xsl:with-param name="hex" select="concat(substring($color, 4, 1), substring($color, 4, 1))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($color, 'rgb(')">
+ <xsl:value-of select="substring-before(
+ substring-after(substring-after($color, ','), ','),
+ ')')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($color, 'rgba(')">
+ <xsl:value-of select="substring-before(
+ substring-after(substring-after($color, ','), ','),
+ ',')"/>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.a
+Extract the alpha value of a color.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$color: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template extracts the alpha, or opacity level, of a color. It returns a
+number between 0.0 and 1.0. It accepts six-digit and three-digit hexidecimal
+color codes, colors specified with #{rgb()}, and colors specified with
+#{rgba()}. It does not accept HSL or named HTML colors. For colors specified
+with anything other than #{rgba()}, it always returns 1.0.
+-->
+<xsl:template name="color.a">
+ <xsl:param name="color"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($color, 'rgba(')">
+ <xsl:value-of select="number(substring-before(substring-after(
+ substring-after(substring-after($color, ','), ','), ','), ')'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1.0</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.rl
+Get the relative luminance of a color.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$color: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template calculates the relative luminance of a color, returning a number
+between 0.0 and 1.0. The relative luminance is used when calculating color
+contrast. The relative luminance algorithm is defined by the WCAG:
+
+http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
+
+This template accepts six-digit and three-digit hexidecimal color codes, colors
+specified with #{rgb()}, and colors specified with #{rgba()}. It does not accept
+HSL or named HTML colors.
+-->
+<xsl:template name="color.rl">
+ <xsl:param name="color"/>
+ <xsl:variable name="r">
+ <xsl:variable name="rsrgb_">
+ <xsl:call-template name="color.r">
+ <xsl:with-param name="color" select="$color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rsrgb" select="$rsrgb_ div 255"/>
+ <xsl:choose>
+ <xsl:when test="$rsrgb &gt; 0.03928">
+ <xsl:value-of select="math:power(($rsrgb + 0.055) div 1.055, 2.4)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$rsrgb div 12.92"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="g">
+ <xsl:variable name="gsrgb_">
+ <xsl:call-template name="color.g">
+ <xsl:with-param name="color" select="$color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="gsrgb" select="$gsrgb_ div 255"/>
+ <xsl:choose>
+ <xsl:when test="$gsrgb &gt; 0.03928">
+ <xsl:value-of select="math:power(($gsrgb + 0.055) div 1.055, 2.4)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$gsrgb div 12.92"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="b">
+ <xsl:variable name="bsrgb_">
+ <xsl:call-template name="color.b">
+ <xsl:with-param name="color" select="$color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="bsrgb" select="$bsrgb_ div 255"/>
+ <xsl:choose>
+ <xsl:when test="$bsrgb &gt; 0.03928">
+ <xsl:value-of select="math:power(($bsrgb + 0.055) div 1.055, 2.4)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$bsrgb div 12.92"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="(0.2126 * $r) + (0.0722 * $b) + (0.7152 * $g)"/>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.contrast
+Get the contrast between two colors.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$bg: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+$fg: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+
+This template calculates the contrast ratio between colors. The contrast ratio
+is a number between 1 and 21. The algorithm is defined by the WCAG:
+
+http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
+
+This template calls *{color.rl} to get the relative luminance of ${bg} and ${fg}.
+It accepts six-digit and three-digit hexidecimal color codes, colors specified
+with #{rgb()}, and colors specified with #{rgba()}. It does not accept HSL or
+named HTML colors. Note that it does not take the alpha value into account when
+calculating the contrast ratio. Semi-transparent colors will have a lower
+actual contrast ratio than what is reported by this template.
+
+The WCAG recommends a contrast ratio of at least 4.5 for normal text, and a
+ratio of at least 3.0 for large-scale text.
+-->
+<xsl:template name="color.contrast">
+ <xsl:param name="bg"/>
+ <xsl:param name="fg"/>
+ <xsl:variable name="bg.rl">
+ <xsl:call-template name="color.rl">
+ <xsl:with-param name="color" select="$bg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fg.rl">
+ <xsl:call-template name="color.rl">
+ <xsl:with-param name="color" select="$fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$bg.rl > $fg.rl">
+ <xsl:value-of select="round(100 * (($bg.rl + 0.05) div ($fg.rl + 0.05))) div 100"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round(100 * (($fg.rl + 0.05) div ($bg.rl + 0.05))) div 100"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--**==========================================================================
+color.blend
+Blend two colors together at a specified mix level.
+:Revision: version="3.20" date="2016-01-03" status="final"
+$bg: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+$fg: A color specified in hexidecimal, #{rgb()}, or #{rgba()}.
+$mix: The mix level, between 0.0 and 1.0.
+
+This template calculates a color by selecting a midpoint between ${bg} and
+${fg}, where the ${mix} parameter specifies how far to move from ${bg} to
+${fg}. For opaque colors, setting ${mix} to 0.0 will result in ${bg}, and
+setting ${mix} to 1.0 will result in ${fg}.
+
+This template takes the alpha values of ${bg} and ${fg} into account, so
+that specifying 1.0 for ${mix} will result in a color that is the result
+of overlaying ${fg} on top of ${bg}. In effect, ${mix} acts as a multiplier
+on the alpha channels of the colors.
+
+This template calls *{color.r}, ${color.g}, ${color.b}, and ${color.a} to get
+the components of ${bg} and ${fg}. It accepts six-digit and three-digit
+hexidecimal color codes, colors specified with #{rgb()}, and colors specified
+with #{rgba()}. It does not accept HSL or named HTML colors.
+
+If the return color is fully opaque, this template returns the color using
+the #{rgb()} scheme. Otherwise, it uses the #{rgba()} scheme.
+-->
+<xsl:template name="color.blend">
+ <xsl:param name="bg" select="'#ffffff'"/>
+ <xsl:param name="fg" select="'#000000'"/>
+ <xsl:param name="mix" select="0.5"/>
+
+ <xsl:variable name="fgr">
+ <xsl:call-template name="color.r">
+ <xsl:with-param name="color" select="$fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fgb">
+ <xsl:call-template name="color.b">
+ <xsl:with-param name="color" select="$fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fgg">
+ <xsl:call-template name="color.g">
+ <xsl:with-param name="color" select="$fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fga">
+ <xsl:call-template name="color.a">
+ <xsl:with-param name="color" select="$fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="bgr">
+ <xsl:call-template name="color.r">
+ <xsl:with-param name="color" select="$bg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="bgb">
+ <xsl:call-template name="color.b">
+ <xsl:with-param name="color" select="$bg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="bgg">
+ <xsl:call-template name="color.g">
+ <xsl:with-param name="color" select="$bg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="bga">
+ <xsl:call-template name="color.a">
+ <xsl:with-param name="color" select="$bg"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="a" select="($fga * $mix) + ($bga * (1 - $mix))"/>
+ <xsl:variable name="r" select="(($bgr * $bga * (1 - $mix)) +
+ ($fgr * $fga * $mix)) div $a"/>
+ <xsl:variable name="g" select="(($bgg * $bga * (1 - $mix)) +
+ ($fgg * $fga * $mix)) div $a"/>
+ <xsl:variable name="b" select="(($bgb * $bga * (1 - $mix)) +
+ ($fgb * $fga * $mix)) div $a"/>
+ <xsl:variable name="rgba" select="$a &lt; 1"/>
+ <xsl:choose>
+ <xsl:when test="$rgba">
+ <xsl:text>rgba(</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>rgb(</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$r &lt; 0">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:when test="$r &gt; 255">
+ <xsl:text>255</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round($r)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>,</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$g &lt; 0">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:when test="$g &gt; 255">
+ <xsl:text>255</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round($g)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>,</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$b &lt; 0">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:when test="$b &gt; 255">
+ <xsl:text>255</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="round($b)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$rgba">
+ <xsl:text>,</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$a &lt; 0">
+ <xsl:text>0</xsl:text>
+ </xsl:when>
+ <xsl:when test="$a &gt; 1.0">
+ <xsl:text>1.0</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$a"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:text>)</xsl:text>
+</xsl:template>
+
+
+<!--#* _color.fgify -->
+<xsl:template name="_color.fgify">
+ <xsl:param name="color"/>
+ <xsl:param name="target" select="5"/>
+ <xsl:param name="recdepth" select="0"/>
+ <xsl:variable name="newcolor">
+ <xsl:call-template name="color.blend">
+ <xsl:with-param name="bg" select="$color"/>
+ <xsl:with-param name="fg" select="$color.fg"/>
+ <xsl:with-param name="mix" select="0.1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="contrast">
+ <xsl:call-template name="color.contrast">
+ <xsl:with-param name="bg" select="$color.bg"/>
+ <xsl:with-param name="fg" select="$newcolor"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$recdepth > 10">
+ <xsl:message>
+ <xsl:text>Recursion depth exceeded calculating fg color</xsl:text>
+ </xsl:message>
+ <xsl:value-of select="$newcolor"/>
+ </xsl:when>
+ <xsl:when test="$contrast >= $target">
+ <xsl:value-of select="$newcolor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$newcolor"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="recdepth" select="$recdepth + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+<!--#* _color.bgify -->
+<xsl:template name="_color.bgify">
+ <xsl:param name="color"/>
+ <xsl:param name="target" select="19"/>
+ <xsl:param name="recdepth" select="0"/>
+ <xsl:variable name="newcolor">
+ <xsl:call-template name="color.blend">
+ <xsl:with-param name="bg" select="$color"/>
+ <xsl:with-param name="fg" select="$color.bg"/>
+ <xsl:with-param name="mix" select="0.2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="contrast">
+ <xsl:call-template name="color.contrast">
+ <xsl:with-param name="bg" select="$newcolor"/>
+ <xsl:with-param name="fg" select="$color.fg"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$recdepth > 20">
+ <xsl:message>
+ <xsl:text>Recursion depth exceeded calculating bg color</xsl:text>
+ </xsl:message>
+ <xsl:value-of select="$newcolor"/>
+ </xsl:when>
+ <xsl:when test="$contrast >= $target">
+ <xsl:value-of select="$newcolor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$newcolor"/>
+ <xsl:with-param name="target" select="$target"/>
+ <xsl:with-param name="recdepth" select="$recdepth + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+
+
+<!--@@==========================================================================
+color.fg
+The primary text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameters specifies the normal color of text. It should have a high color
+contrast against @{color.bg}. Other text colors can be automatically computed
+based on this color.
+-->
+<xsl:param name="color.fg" select="'#000000'"/>
+
+
+<!--@@==========================================================================
+color.bg
+The normal background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameters specifies the background color. It should have a high color
+contrast against @{color.fg}. Other background colors can be automatically
+computed based on this color.
+-->
+<xsl:param name="color.bg" select="'#ffffff'"/>
+
+
+<!--@@==========================================================================
+color.red
+A red accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of red that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
+-->
+<xsl:param name="color.red" select="'#cc0000'"/>
+
+
+<!--@@==========================================================================
+color.fg.red
+A red text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of red that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.red} and @{color.fg}.
-->
+<xsl:param name="color.fg.red">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.red"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.background
-The background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.red
+A red background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the default background color. Foreground colors
-should be legible on this color.
+This parameter specifies a shade of red that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.red} and @{color.bg}.
-->
-<xsl:param name="color.background" select="'#ffffff'"/>
+<xsl:param name="color.bg.red">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.red"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.link
-The color of links.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.orange
+An orange accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the color for unvisited links. It should be
-legible on all background colors.
+This parameter specifies a shade of orange that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
-->
-<xsl:param name="color.link" select="'#204a87'"/>
+<xsl:param name="color.orange" select="'#f57900'"/>
<!--@@==========================================================================
-color.link_visited
-The color of visited links.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.fg.orange
+An orange text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the color for visited links. It should be
-legible on all background colors.
+This parameter specifies a shade of orange that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.orange} and @{color.fg}.
-->
-<xsl:param name="color.link_visited" select="'#5c3566'"/>
+<xsl:param name="color.fg.orange">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.orange"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.text
-The normal text color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.orange
+An orange background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the default color for normal text. It should be
-legible on all background colors.
+This parameter specifies a shade of orange that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.orange} and @{color.bg}.
-->
-<xsl:param name="color.text" select="'#000000'"/>
+<xsl:param name="color.bg.orange">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.orange"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.text_light
-The light text color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.yellow
+A yellow accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the color for light text. The light text
-color is used to make bold headings and certain parenthetical text
-less intense. It should be legible on all background colors.
+This parameter specifies a shade of yellow that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
-->
-<xsl:param name="color.text_light" select="'#2e3436'"/>
+<xsl:param name="color.yellow" select="'#edd400'"/>
<!--@@==========================================================================
-color.text_error
-The error text color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.fg.yellow
+A yellow text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the color for error text. The error text
-color is used to style error messages from command line sessions.
-It should be legible on all background colors.
+This parameter specifies a shade of yellow that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.yellow} and @{color.fg}.
-->
-<xsl:param name="color.text_error" select="'#a40000'"/>
+<xsl:param name="color.fg.yellow">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.yellow"/>
+ <xsl:with-param name="target" select="5.5"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.blue_background
-The blue background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.yellow
+A yellow background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the blue background color. The blue
-background color may be used by certain types of block elements.
-Foreground colors should be legible on this color.
+This parameter specifies a shade of yellow that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.yellow} and @{color.bg}.
-->
-<xsl:param name="color.blue_background" select="'#e6f2ff'"/>
+<xsl:param name="color.bg.yellow">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.yellow"/>
+ <xsl:with-param name="target" select="20"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.blue_border
-The blue border color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.green
+A green accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the blue border color. The blue
-border color may be used by certain types of block elements.
+This parameter specifies a shade of green that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
-->
-<xsl:param name="color.blue_border" select="'#729fcf'"/>
+<xsl:param name="color.green" select="'#73d216'"/>
<!--@@==========================================================================
-color.gray_background
-The gray background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.fg.green
+A green text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the gray background color. The gray
-background color may be used by certain types of block elements.
-Foreground colors should be legible on this color.
+This parameter specifies a shade of green that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.green} and @{color.fg}.
-->
-<xsl:param name="color.gray_background" select="'#f3f3f0'"/>
+<xsl:param name="color.fg.green">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.green"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.dark_background
-The dark gray background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.green
+A green background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the dark gray background color. The dark
-gray background color may be used by certain types of block elements.
-Foreground colors should be legible on this color.
+This parameter specifies a shade of green that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.green} and @{color.bg}.
-->
-<xsl:param name="color.dark_background" select="'#e5e5e3'"/>
+<xsl:param name="color.bg.green">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.green"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.gray_border
-The gray border color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.blue
+A blue accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the gray border color. The gray
-border color may be used by certain types of block elements.
+This parameter specifies a shade of blue that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
-->
-<xsl:param name="color.gray_border" select="'#babdb6'"/>
+<xsl:param name="color.blue" select="'#3465a4'"/>
+
+
+<!--@@==========================================================================
+color.fg.blue
+A blue text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+This parameter specifies a shade of blue that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.blue} and @{color.fg}.
+-->
+<xsl:param name="color.fg.blue">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.blue"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.red_background
-The red background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.blue
+A blue background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the red background color. The red
-background color may be used by certain types of block elements.
-Foreground colors should be legible on this color.
+This parameter specifies a shade of blue that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.blue} and @{color.bg}.
-->
-<xsl:param name="color.red_background" select="'#ffdede'"/>
+<xsl:param name="color.bg.blue">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.blue"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.red_border
-The red border color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.purple
+A purple accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the red border color. The red
-border color may be used by certain types of block elements.
+This parameter specifies a shade of purple that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
-->
-<xsl:param name="color.red_border" select="'#ef2929'"/>
+<xsl:param name="color.purple" select="'#75507b'"/>
<!--@@==========================================================================
-color.yellow_background
-The yellow background color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.fg.purple
+A purple text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the yellow background color. The yellow
-background color may be used by certain types of block elements.
-Foreground colors should be legible on this color.
+This parameter specifies a shade of purple that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.purple} and @{color.fg}.
-->
-<xsl:param name="color.yellow_background" select="'#fffacc'"/>
+<xsl:param name="color.fg.purple">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.purple"/>
+ </xsl:call-template>
+</xsl:param>
<!--@@==========================================================================
-color.yellow_border
-The yellow border color.
-:Revision:version="1.0" date="2010-05-25" status="final"
+color.bg.purple
+A purple background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
-This parameter specifies the yellow border color. The yellow
-border color may be used by certain types of block elements.
+This parameter specifies a shade of purple that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.purple} and @{color.bg}.
-->
-<xsl:param name="color.yellow_border" select="'#edd400'"/>
+<xsl:param name="color.bg.purple">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.purple"/>
+ </xsl:call-template>
+</xsl:param>
+
+
+<!--@@==========================================================================
+color.gray
+A gray accent color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of gray that is suitable for borders and
+other accents. It should have some contrast against background colors, but it
+does not need as high of a contrast as text colors.
+-->
+<xsl:param name="color.gray" select="'#babdb6'"/>
+
+
+<!--@@==========================================================================
+color.fg.gray
+A gray text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of gray that is suitable for text. It should
+have a high color contrast against @{color.bg}. If not specified, it can be
+automatically computed based on @{color.gray} and @{color.fg}.
+-->
+<xsl:param name="color.fg.gray">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.gray"/>
+ </xsl:call-template>
+</xsl:param>
+
+
+<!--@@==========================================================================
+color.bg.gray
+A gray background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of gray that is suitable for backgrounds.
+It should have a high color contrast against @{color.fg}. If not specified,
+it can be automatically computed based on @{color.gray} and @{color.bg}.
+-->
+<xsl:param name="color.bg.gray">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.gray"/>
+ </xsl:call-template>
+</xsl:param>
+
+
+<!--@@==========================================================================
+color.fg.dark
+A dark gray text color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a dark shade of gray that is suitable for text. It
+should have a very high color contrast against @{color.bg}. It is typically
+used to slightly reduce the visual weight of headers and bold text. If not
+specified, it can be automatically computed based on @{color.gray} and
+@{color.fg}.
+-->
+<xsl:param name="color.fg.dark">
+ <xsl:call-template name="_color.fgify">
+ <xsl:with-param name="color" select="$color.gray"/>
+ <xsl:with-param name="target" select="8"/>
+ </xsl:call-template>
+</xsl:param>
+
+
+<!--@@==========================================================================
+color.bg.dark
+A dark gray background color.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This parameter specifies a shade of gray that is suitable for backgrounds,
+and is darker than @{color.bg.gray}. It should have a high color contrast
+against @{color.fg}. It is typically used at the intersection of shaded
+rows and columns in a table, or as a very light gray accent color. If not
+specified, it can be automatically computed based on @{color.gray} and
+@{color.bg}.
+-->
+<xsl:param name="color.bg.dark">
+ <xsl:call-template name="_color.bgify">
+ <xsl:with-param name="color" select="$color.gray"/>
+ <xsl:with-param name="target" select="17"/>
+ </xsl:call-template>
+</xsl:param>
+
+
+<!--
+Old color parameters below. Kept for compatibility with existing
+customizations that reference these colors.
+-->
+
+<!--#@ color.background -->
+<xsl:param name="color.background" select="$color.bg"/>
+
+<!--#@ color.link -->
+<xsl:param name="color.link" select="$color.fg.blue"/>
+
+<!--#@ color.link_visited -->
+<xsl:param name="color.link_visited" select="$color.fg.purple"/>
+
+<!--#@ color.text -->
+<xsl:param name="color.text" select="$color.fg"/>
+
+<!--#@ color.text_light -->
+<xsl:param name="color.text_light" select="$color.fg.dark"/>
+
+<!--#@ color.text_error -->
+<xsl:param name="color.text_error" select="$color.fg.red"/>
+
+<!--#@ color.blue_background -->
+<xsl:param name="color.blue_background" select="$color.bg.blue"/>
+
+<!--#@ color.blue_border -->
+<xsl:param name="color.blue_border" select="$color.blue"/>
+
+<!--#@ color.gray_background -->
+<xsl:param name="color.gray_background" select="$color.bg.gray"/>
+
+<!--#@ color.dark_background -->
+<xsl:param name="color.dark_background" select="$color.bg.dark"/>
+
+<!--#@ color.gray_border -->
+<xsl:param name="color.gray_border" select="$color.gray"/>
+
+<!--#@ color.red_background -->
+<xsl:param name="color.red_background" select="$color.bg.red"/>
+
+<!--#@ color.red_border -->
+<xsl:param name="color.red_border" select="$color.red"/>
+
+<!--#@ color.yellow_background -->
+<xsl:param name="color.yellow_background" select="$color.bg.yellow"/>
+
+<!--#@ color.yellow_border -->
+<xsl:param name="color.yellow_border" select="$color.yellow"/>
</xsl:stylesheet>
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index d5601a48..24e6ebc2 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -743,9 +743,9 @@ body {
font-family: sans-serif;
margin: 0; padding: 0;
background-color: </xsl:text>
- <xsl:value-of select="$color.background"/><xsl:text>;
+ <xsl:value-of select="$color.bg"/><xsl:text>;
color: </xsl:text>
- <xsl:value-of select="$color.text"/><xsl:text>;
+ <xsl:value-of select="$color.fg"/><xsl:text>;
direction: </xsl:text><xsl:value-of select="$direction"/><xsl:text>;
}
article, aside, nav, header, footer, section {
@@ -775,7 +775,7 @@ div.page > footer {
}
article {
min-height: 20em;
- background-color: </xsl:text><xsl:value-of select="$color.background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg"/><xsl:text>;
padding: 10px;
}
section {
@@ -788,23 +788,23 @@ section section {
div.trails {
margin: 0;
padding: 0.2em 10px;
- background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
div.trail {
margin: 0.2em 0;
padding: 0 1em 0 1em;
text-indent: -1em;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
a.trail { white-space: nowrap; }
div.hgroup {
margin: 0 0 0.5em 0;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
section > div.inner > div.hgroup {
margin-top: 0;
border-bottom: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
margin-left: -10px;
margin-right: -10px;
padding-left: 10px;
@@ -812,7 +812,7 @@ section > div.inner > div.hgroup {
}
section.links > div.hgroup {
border-bottom: solid 2px </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
margin-left: -10px;
margin-right: -10px;
padding-left: 10px;
@@ -823,7 +823,7 @@ section section.links > div.hgroup {
}
h1, h2, h3, h4, h5, h6, h7 {
margin: 0; padding: 0;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
font-weight: bold;
}
h1 { font-size: 2em; }
@@ -846,9 +846,9 @@ div.clear {
.center { text-align: center; }
footer.about {
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>;
margin: 0;
- background-color: </xsl:text><xsl:value-of select="$color.background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg"/><xsl:text>;
}
footer.about > div.inner > div.hgroup {
margin: 0; padding: 0;
@@ -901,24 +901,24 @@ div.license {
table {
border-collapse: collapse;
- border-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ border-color: </xsl:text><xsl:value-of select="$color.gray"/><xsl:text>;
border-width: 1px;
}
td, th {
padding: 0.5em;
vertical-align: top;
- border-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ border-color: </xsl:text><xsl:value-of select="$color.gray"/><xsl:text>;
border-width: 1px;
}
thead td, thead th, tfoot td, tfoot th {
font-weight: bold;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
- background-color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.dark"/><xsl:text>;
}
th {
text-align: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
font-weight: bold;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
ul, ol, dl { margin: 0; padding: 0; }
@@ -957,11 +957,11 @@ a:visited { color: </xsl:text>
<xsl:value-of select="$color.link_visited"/><xsl:text>; }
a:hover {
border-bottom: dotted 1px </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
p a {
border-bottom: dotted 1px </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
a img { border: none; }
</xsl:text>
@@ -1004,7 +1004,7 @@ All parameters can be automatically computed if not provided.
div.title {
margin: 0 0 0.2em 0;
font-weight: bold;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
div.title h1, div.title h2, div.title h3, div.title h4, div.title h5, div.title h6 {
margin: 0;
@@ -1018,7 +1018,7 @@ pre.contents {
padding: 0.5em 1em 0.5em 1em;
}
div.links-center { text-align: center; }
-div.links .desc { color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>; }
+div.links .desc { color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>; }
div.links > div.inner > div.region > div.desc { font-style: italic; }
div.links ul { margin: 0; padding: 0; }
div.links ul ul {
@@ -1033,9 +1033,9 @@ div.sectionlinks {
display: inline-block;
padding: 0 1em 0 1em;
background-color: </xsl:text>
- <xsl:value-of select="$color.blue_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.blue"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
div.sectionlinks ul { margin: 0; }
div.sectionlinks li { padding: 0; }
@@ -1056,7 +1056,7 @@ div.nextlinks {
clear: both;
}
div.nextlinks a {
- background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.gray"/><xsl:text>;
display: inline-block;
position: relative;
height: 1.44em;
@@ -1077,32 +1077,32 @@ a.nextlinks-prev:after, a.nextlinks-next:after {
a.nextlinks-prev:after {
</xsl:text><xsl:value-of select="$right"/><xsl:text>: 100%;
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
a.nextlinks-next:after {
</xsl:text><xsl:value-of select="$left"/><xsl:text>: 100%;
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
div.nextlinks a:hover {
border: none;
- background: </xsl:text><xsl:value-of select="$color.blue_background"/><xsl:text>
+ background: </xsl:text><xsl:value-of select="$color.bg.blue"/><xsl:text>
}
a.nextlinks-prev:hover:after {
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>-color: </xsl:text>
- <xsl:value-of select="$color.blue_background"/><xsl:text>
+ <xsl:value-of select="$color.bg.blue"/><xsl:text>
}
a.nextlinks-next:hover:after {
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>-color: </xsl:text>
- <xsl:value-of select="$color.blue_background"/><xsl:text>
+ <xsl:value-of select="$color.bg.blue"/><xsl:text>
}
div.serieslinks {
display: inline-block;
padding: 0 1em 0 1em;
background-color: </xsl:text>
- <xsl:value-of select="$color.blue_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.blue"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
div.serieslinks ul { margin: 0; }
div.serieslinks li { padding: 0; }
@@ -1113,17 +1113,17 @@ pre.numbered {
float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0.5em;
text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.yellow_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.yellow"/><xsl:text>;
}
div.code {
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
}
div.example {
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
}
div.example > div.inner > div.region > div.desc { font-style: italic; }
@@ -1132,11 +1132,11 @@ div.figure {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
padding: 4px;
color: </xsl:text>
- <xsl:value-of select="$color.text_light"/><xsl:text>;
+ <xsl:value-of select="$color.fg.dark"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
@media (max-width: 960px) {
div.figure {
@@ -1152,11 +1152,11 @@ div.figure > div.inner > div.region > div.contents {
clear: both;
text-align: center;
color: </xsl:text>
- <xsl:value-of select="$color.text"/><xsl:text>;
+ <xsl:value-of select="$color.fg"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.background"/><xsl:text>;
+ <xsl:value-of select="$color.bg"/><xsl:text>;
}
div.list > div.inner > div.title { margin-bottom: 0.5em; }
div.listing > div.inner { margin: 0; padding: 0; }
@@ -1164,9 +1164,9 @@ div.listing > div.inner > div.region > div.desc { font-style: italic; }
div.note {
padding: 6px;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.dark_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.dark"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
div.note > div.inner > div.title {
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
@@ -1262,7 +1262,7 @@ div.quote > div.inner:before {
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
text-align: center;
color: </xsl:text>
- <xsl:value-of select="$color.dark_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.dark"/><xsl:text>;
}
div.quote > div.inner > div.title {
margin: 0;
@@ -1279,26 +1279,26 @@ div.quote > div.inner > div.region > div.cite {
margin-top: 0.5em;
margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
<xsl:value-of select="$icons.size.quote"/><xsl:text>px;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>;
}
div.quote > div.inner > div.region > div.cite::before {
<!-- FIXME: i18n -->
content: '&#x2015; ';
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.gray"/><xsl:text>;
}
div.screen {
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
}
ol.steps, ul.steps {
margin: 0;
padding: 0.5em 1em 0.5em 1em;
border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
- <xsl:value-of select="$color.yellow_border"/><xsl:text>;
+ <xsl:value-of select="$color.yellow"/><xsl:text>;
box-shadow: 0 1px 2px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
}
ol.steps .steps {
padding: 0;
@@ -1314,9 +1314,9 @@ div.synopsis > div.contents, div.synopsis > pre.contents {
border-top: solid 1px;
border-bottom: solid 1px;
border-color: </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
div.synopsis > div.inner > div.region > div.desc { font-style: italic; }
div.synopsis div.code {
@@ -1327,87 +1327,87 @@ div.synopsis div.code {
div.synopsis div.code > pre.contents { margin: 0; padding: 0; }
div.table > div.desc { font-style: italic; }
tr.shade {
- background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
td.shade {
- background-color: </xsl:text><xsl:value-of select="$color.gray_background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.gray"/><xsl:text>;
}
tr.shade td.shade {
- background-color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.bg.dark"/><xsl:text>;
}
span.app { font-style: italic; }
span.cmd {
font-family: monospace;
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
padding: 0 0.2em 0 0.2em;
}
span.cmd span.cmd { background-color: none; padding: 0; }
pre span.cmd { background-color: none; padding: 0; }
span.code {
font-family: monospace;
- border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
+ border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.bg.dark"/><xsl:text>;
}
span.code span.code { border: none; }
pre span.code { border: none; }
span.em { font-style: italic; }
span.em-bold {
font-style: normal; font-weight: bold;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
pre span.error {
- color: </xsl:text><xsl:value-of select="$color.text_error"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.red"/><xsl:text>;
}
span.file { font-family: monospace; }
span.gui, span.guiseq { color: </xsl:text>
- <xsl:value-of select="$color.text_light"/><xsl:text>; }
+ <xsl:value-of select="$color.fg.dark"/><xsl:text>; }
span.input { font-family: monospace; }
pre span.input {
font-weight: bold;
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
kbd {
font-family: inherit;
font-size: inherit;
color: </xsl:text>
- <xsl:value-of select="$color.text_light"/><xsl:text>;
+ <xsl:value-of select="$color.fg.dark"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.gray_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.gray"/><xsl:text>;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
border-radius: 2px;
box-shadow: 1px 1px 2px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
margin: 0 0.2em 0 0.2em;
- padding: 0 0.5em 0 0.5em;
+ padding: 0.2em 0.5em 0 0.5em;
white-space: nowrap;
}
kbd.key-Fn {
font-weight: bold;
color: </xsl:text>
- <xsl:value-of select="$color.blue_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
span.key a {
border-bottom: none;
}
a > kbd {
color: </xsl:text><xsl:value-of select="$color.link"/><xsl:text>;
- border-color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
+ border-color: </xsl:text><xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
span.keyseq {
color: </xsl:text>
- <xsl:value-of select="$color.text_light"/><xsl:text>;
+ <xsl:value-of select="$color.fg.dark"/><xsl:text>;
white-space: nowrap
}
span.output { font-family: monospace; }
pre span.output {
- color: </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg"/><xsl:text>;
}
pre span.prompt {
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
}
span.sys { font-family: monospace; }
span.var { font-style: italic; }
@@ -1420,11 +1420,11 @@ div.media-controls {
min-width: 24em;
height: 24px;
margin: 0; padding: 0;
- border-left: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
- border-right: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
- border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
- background-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
- color: </xsl:text><xsl:value-of select="$color.background"/><xsl:text>;
+ border-left: solid 1px </xsl:text><xsl:value-of select="$color.fg"/><xsl:text>;;
+ border-right: solid 1px </xsl:text><xsl:value-of select="$color.fg"/><xsl:text>;;
+ border-bottom: solid 1px </xsl:text><xsl:value-of select="$color.fg"/><xsl:text>;;
+ background-color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.bg"/><xsl:text>;
-moz-border-bottom-left-radius: 4px;
-moz-border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
@@ -1433,7 +1433,7 @@ div.media-controls {
border-bottom-right-radius: 4px;
}
div.media-controls-audio {
- border-top: solid 1px </xsl:text><xsl:value-of select="$color.text"/><xsl:text>;;
+ border-top: solid 1px </xsl:text><xsl:value-of select="$color.fg"/><xsl:text>;;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
@@ -1442,13 +1442,13 @@ button.media-play {
height: 24px;
padding: 0 2px 0 2px; line-height: 0;
float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
- background-color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
border: none;
border-</xsl:text><xsl:value-of select="$right"/><xsl:text>: solid 1px </xsl:text>
- <xsl:value-of select="$color.text"/><xsl:text>;;
+ <xsl:value-of select="$color.fg"/><xsl:text>;;
}
button.media-play:hover, button.media-play:focus {
- background-color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
+ background-color: </xsl:text><xsl:value-of select="$color.fg.blue"/><xsl:text>;
}
button.media-play canvas { margin: 0; }
div.media-range {
@@ -1469,7 +1469,7 @@ div.media-time > span {
}
span.media-duration {
font-size: 12px;
- color: </xsl:text><xsl:value-of select="$color.dark_background"/><xsl:text>;
+ color: </xsl:text><xsl:value-of select="$color.bg.dark"/><xsl:text>;
opacity: 0.8;
}
div.media-ttml { margin: 0; padding: 0; }
@@ -1487,11 +1487,11 @@ div.media-ttml-p {
padding: 6px;
max-width: 24em;
border: solid 1px </xsl:text>
- <xsl:value-of select="$color.yellow_border"/><xsl:text>;
+ <xsl:value-of select="$color.fg.yellow"/><xsl:text>;
background-color: </xsl:text>
- <xsl:value-of select="$color.yellow_background"/><xsl:text>;
+ <xsl:value-of select="$color.bg.yellow"/><xsl:text>;
box-shadow: 2px 2px 4px </xsl:text>
- <xsl:value-of select="$color.gray_border"/><xsl:text>;
+ <xsl:value-of select="$color.gray"/><xsl:text>;
}
div.yelp-data { display: none; }
.ui-expander > div.inner > div.title span.title,
@@ -1609,15 +1609,56 @@ All parameters can be automatically computed if not provided.
</xsl:call-template>
</xsl:param>
<xsl:if test="$html.syntax.highlight">
- <xsl:text>
-pre.syntax span.function, pre.syntax span.keyword, pre.syntax span.tag {
- color: </xsl:text><xsl:value-of select="$color.blue_border"/><xsl:text>;
-}
-pre.syntax span.string, pre.syntax span.operator {
- color: </xsl:text><xsl:value-of select="$color.text_light"/><xsl:text>;
-}
-</xsl:text>
- </xsl:if>
+.hljs a {
+ color: inherit;
+ border-bottom: dotted 1px <xsl:value-of select="$color.fg.blue"/>;
+}
+.hljs a:hover, .hljs a:hover * { color: <xsl:value-of select="$color.fg.blue"/>; }
+.hljs-addition {
+ color: <xsl:value-of select="$color.fg.green"/>;
+ background-color: <xsl:value-of select="$color.bg.green"/>;
+}
+.hljs-deletion {
+ color: <xsl:value-of select="$color.fg.red"/>;
+ background-color: <xsl:value-of select="$color.bg.red"/>;
+}
+.hljs-emphasis { font-style: italic; }
+.hljs-strong { font-weight: bold; }
+.hljs-attr { color: <xsl:value-of select="$color.fg.blue"/>; }
+.hljs-attribute { color: <xsl:value-of select="$color.fg.yellow"/>; }
+.hljs-built_in { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-bullet { color: <xsl:value-of select="$color.fg.green"/>; }
+.hljs-class { }
+.hljs-code { }
+.hljs-comment { color: <xsl:value-of select="$color.fg.gray"/>; }
+.hljs-doctag { }
+.hljs-formula { color: <xsl:value-of select="$color.fg.dark"/>; }
+.hljs-function { }
+.hljs-keyword { color: <xsl:value-of select="$color.fg.purple"/>; }
+.hljs-link { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-literal { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-meta { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-name { color: <xsl:value-of select="$color.fg.red"/>; }
+.hljs-number { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-params { color: <xsl:value-of select="$color.fg.orange"/>; }
+.hljs-quote { color: <xsl:value-of select="$color.fg.gray"/>; }
+.hljs-regexp { color: <xsl:value-of select="$color.fg.red"/>; }
+.hljs-rest_arg { }
+.hljs-section { color: <xsl:value-of select="$color.fg.blue"/>; }
+.hljs-string { color: <xsl:value-of select="$color.fg.green"/>; }
+.hljs-subst { }
+.hljs-symbol { color: <xsl:value-of select="$color.fg.green"/>; }
+.hljs-tag { color: <xsl:value-of select="$color.fg.red"/>; }
+.hljs-title { color: <xsl:value-of select="$color.fg.blue"/>; }
+.hljs-type { }
+.hljs-variable { }
+.hljs-selector-attr { }
+.hljs-selector-class { color: <xsl:value-of select="$color.fg.red"/>; }
+.hljs-selector-id { color: <xsl:value-of select="$color.fg.red"/>; }
+.hljs-selector-tag { color: <xsl:value-of select="$color.fg.purple"/>; }
+.hljs-template-tag { }
+.hljs-template-variable { }
+</xsl:if>
</xsl:template>
@@ -1669,6 +1710,9 @@ ouput the contents of that tag.
<xsl:call-template name="html.js.jquery">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
+ <xsl:call-template name="html.js.syntax">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:call-template name="html.js.mathjax">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
@@ -1703,14 +1747,6 @@ output relative to @{html.js.root}.
<xsl:text>jquery.js</xsl:text>
</xsl:attribute>
</script>
- <xsl:if test="$html.syntax.highlight">
- <script type="text/javascript">
- <xsl:attribute name="src">
- <xsl:value-of select="$html.js.root"/>
- <xsl:text>jquery.syntax.js</xsl:text>
- </xsl:attribute>
- </script>
- </xsl:if>
</xsl:template>
@@ -1761,9 +1797,6 @@ and *{html.js.syntax}. It then calls the mode
<xsl:call-template name="html.js.media">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
- <xsl:call-template name="html.js.syntax">
- <xsl:with-param name="node" select="$node"/>
- </xsl:call-template>
<xsl:apply-templates mode="html.js.mode" select="$node"/>
<xsl:call-template name="html.js.content.custom">
<xsl:with-param name="node" select="$node"/>
@@ -1795,7 +1828,7 @@ $(document).ready (function () {
var highlight_hash = function () {
if (location.hash != '') {
var sect = $(location.hash);
- sect.css('background-color', '</xsl:text><xsl:value-of select="$color.yellow_background"/><xsl:text>');
+ sect.css('background-color', '</xsl:text><xsl:value-of select="$color.bg.yellow"/><xsl:text>');
window.setTimeout(function () {
sect.css({
'-webkit-transition': 'background-color 2s linear',
@@ -1925,11 +1958,11 @@ control for audio and video elements as well as support for captions.
<xsl:param name="node" select="."/>
<xsl:text><![CDATA[
yelp_color_text_light = ']]></xsl:text>
-<xsl:value-of select="$color.text_light"/><xsl:text><![CDATA[';
+<xsl:value-of select="$color.fg.dark"/><xsl:text><![CDATA[';
yelp_color_gray_background = ']]></xsl:text>
-<xsl:value-of select="$color.gray_background"/><xsl:text><![CDATA[';
+<xsl:value-of select="$color.bg.gray"/><xsl:text><![CDATA[';
yelp_color_gray_border = ']]></xsl:text>
-<xsl:value-of select="$color.gray_border"/><xsl:text><![CDATA[';
+<xsl:value-of select="$color.gray"/><xsl:text><![CDATA[';
yelp_paint_zoom = function (zoom, zoomed) {
var ctxt = zoom.children('canvas')[0].getContext('2d');
ctxt.strokeStyle = ctxt.fillStyle = yelp_color_text_light;
@@ -2171,23 +2204,26 @@ $(document).ready(function () {
<!--**==========================================================================
html.js.syntax
-Output JavaScript for syntax highlighting
-:Revision: version="1.0" date="2011-04-16" status="final"
+Output #{script} elements for syntax highlighting.
+:Revision: version="3.20" date="2016-01-03" status="final"
$node: The node to create JavaScript for.
-This template outputs JavaScript that does syntax highlighting. JavaScript
-@{html.syntax.highlight} is #{true}. Note that this content just initializes
-the syntax highlighting. The real work is done by #{jquery.syntax.js}, which
-is included by *{html.js.syntax}.
+This template outputs HTML #{script} elements to enable syntax highlighting.
+It only outputs if @{html.syntax.highlight} is #{true}. It outputs one #{script}
+element to load in #{highlight.js}, and another to initialize #{highlight.js}
+on all #{code} elements with #{"syntax"} in the class value.
-->
<xsl:template name="html.js.syntax">
<xsl:param name="node" select="."/>
<xsl:if test="$html.syntax.highlight">
-<xsl:text><![CDATA[
-$(document).ready( function () { jQuery.syntax({root: ']]></xsl:text>
-<xsl:value-of select="$html.js.root"/><xsl:text><![CDATA[', blockLayout: 'yelp',
-theme: false, linkify: false}); });
-]]></xsl:text>
+ <script type="text/javascript" src="highlight.pack.js"></script>
+ <script>
+document.addEventListener('DOMContentLoaded', function() {
+ var matches = document.querySelectorAll('code.syntax')
+ for (var match of matches) {
+ hljs.highlightBlock(match);
+ }
+}, false);</script>
</xsl:if>
</xsl:template>
@@ -2329,79 +2365,39 @@ if ${dir} is non-empty.
<!--**==========================================================================
html.syntax.class
Output HTML class values for syntax highlighting.
-:Revision:version="3.12" date="2013-11-02" status="final"
+:Revision:version="3.20" date="2016-01-03" status="final"
$node: The source element whose content will be syntax highlighted.
-$mime: A MIME type identifying the content, as from a Mallard #{mime} attribute.
-$language: A name identifying the content as from a DocBook #{language} attribute.
-This template looks at ${mime} and ${language} and determines if there is a
-suitable syntax highlighting brush available. If so, it outputs a string that
-should be placed in the #{class} attribute of a #{pre} element by the calling
-template.
+This template calls %{html.syntax.class.mode} on ${node}. If the result of that
+mode is a suitable language identifier, it outputs appropriate CSS class names
+to enable syntax highlighting. The output should be placed in the #{class}
+attribute of a #{pre} or similar output element by the calling template.
+
+Importing stylesheets should implement %{html.syntax.class.mode} for any source
+elements that may be syntax highlighted, then call this template when building
+the #{class} attribute for output elements.
-->
<xsl:template name="html.syntax.class">
<xsl:param name="node" select="."/>
- <xsl:param name="mime" select="$node/@mime"/>
- <xsl:param name="language" select="$node/@language"/>
- <xsl:choose>
- <xsl:when test="$mime = 'application/x-shellscript' or $language = 'bash'">
- <xsl:text>syntax brush-bash-script</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-csrc' or $mime = 'text/x-chdr' or
- $mime = 'text/x-c++hdr' or $mime = 'text/x-c++src' or
- $mime = 'text/x-objcsrc' or $language = 'c' or
- $language = 'cpp' or $language = 'objc'">
- <xsl:text>syntax brush-clang</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-csharp' or $language = 'csharp'">
- <xsl:text>syntax brush-csharp</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/css' or $language = 'css'">
- <xsl:text>syntax brush-css</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-patch' or $language = 'diff'">
- <xsl:text>syntax brush-diff</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/html' or $mime = 'application/xml' or
- substring($mime, string-length($mime) - 3) = '+xml' or
- $language = 'html' or $language = 'xml'">
- <xsl:text>syntax brush-html</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-java' or $language = 'java'">
- <xsl:text>syntax brush-java</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'application/javascript' or $language = 'javascript'">
- <xsl:text>syntax brush-javascript</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-scheme' or $mime = 'text/x-emacs-lisp' or
- $language = 'lisp'">
- <xsl:text>syntax brush-lisp</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-lua' or $language = 'lua'">
- <xsl:text>syntax brush-lua</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-pascal' or $language = 'pascal'">
- <xsl:text>syntax brush-pascal</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'application/x-perl' or $language = 'perl'">
- <xsl:text>syntax brush-perl5</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'application/x-php' or $language = 'php'">
- <xsl:text>syntax brush-php-script</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-python' or $language = 'python'">
- <xsl:text>syntax brush-python</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'application/x-ruby' or $language = 'ruby'">
- <xsl:text>syntax brush-ruby</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'text/x-sql' or $language = 'sql'">
- <xsl:text>syntax brush-sql</xsl:text>
- </xsl:when>
- <xsl:when test="$mime = 'application/x-yaml' or $language = 'yaml'">
- <xsl:text>syntax brush-yaml</xsl:text>
- </xsl:when>
- </xsl:choose>
+ <xsl:variable name="class">
+ <xsl:apply-templates mode="html.syntax.class.mode" select="$node"/>
+ </xsl:variable>
+ <xsl:if test="normalize-space($class) != ''">
+ <xsl:text>syntax language-</xsl:text>
+ <xsl:value-of select="$class"/>
+ </xsl:if>
</xsl:template>
+<!--%%==========================================================================
+html.syntax.class.mode
+Get the syntax highlighting language for a source-specific element.
+:Revision:version="3.20" date="2016-01-03" status="final"
+
+This mode is called by *{html.syntax.class} on source elements that may have
+syntax highlighted. This template should be implemented by importing stylesheets.
+It should return a simple language identifier.
+-->
+<xsl:template mode="html.syntax.class.mode" select="*"/>
+
+
</xsl:stylesheet>
diff --git a/xslt/dita/html/dita2html-block.xsl b/xslt/dita/html/dita2html-block.xsl
index aa432444..44217f07 100644
--- a/xslt/dita/html/dita2html-block.xsl
+++ b/xslt/dita/html/dita2html-block.xsl
@@ -115,7 +115,14 @@ FIXME
<xsl:with-param name="node" select="$node"/>
<xsl:with-param name="class" select="$class"/>
</xsl:call-template>
- <pre class="contents">
+ <pre class="contents"><code>
+ <xsl:if test="$html.syntax.highlight">
+ <xsl:attribute name="class">
+ <xsl:call-template name="html.syntax.class">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
<!-- Strip off a leading newline -->
<xsl:if test="$children[1]/self::text()">
<xsl:choose>
@@ -127,9 +134,9 @@ FIXME
</xsl:otherwise>
</xsl:choose>
</xsl:if>
- <xsl:apply-templates mode="dita2html.topic.mdoe"
+ <xsl:apply-templates mode="dita2html.topic.mode"
select="$children[not(position() = 1 and self::text())]"/>
- </pre>
+ </code></pre>
</div>
</xsl:template>
@@ -155,6 +162,209 @@ FIXME
</xsl:call-template>
</xsl:template>
+<xsl:template mode="html.syntax.class.mode" match="&topic_codeblock;">
+ <xsl:param name="language" select="translate(@outputclass,
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYX',
+ 'abcdefghijklmnopqrstuvwxyz')"/>
+ <xsl:choose>
+ <!-- ActionScript -->
+ <xsl:when test="$language = 'actionscript'">
+ <xsl:text>actionscript</xsl:text>
+ </xsl:when>
+ <!-- Apache -->
+ <xsl:when test="$language = 'apache'">
+ <xsl:text>apache</xsl:text>
+ </xsl:when>
+ <!-- AsciiDoc -->
+ <xsl:when test="$language = 'asciidoc' or $language = 'adoc'">
+ <xsl:text>asciidoc</xsl:text>
+ </xsl:when>
+ <!-- Bash -->
+ <xsl:when test="$language = 'sh' or $language = 'bash' or
+ $language = 'csh' or $language = 'bourne'">
+ <xsl:text>bash</xsl:text>
+ </xsl:when>
+ <!-- C -->
+ <xsl:when test="$language = 'c'">
+ <xsl:text>c</xsl:text>
+ </xsl:when>
+ <!-- C# -->
+ <xsl:when test="$language = 'cs' or $language = 'csharp'">
+ <xsl:text>cs</xsl:text>
+ </xsl:when>
+ <!-- C++ -->
+ <xsl:when test="$language = 'cpp' or $language = 'c++'">
+ <xsl:text>cpp</xsl:text>
+ </xsl:when>
+ <!-- Clojure -->
+ <xsl:when test="$language = 'clojure' or $language = 'clj'">
+ <xsl:text>clojure</xsl:text>
+ </xsl:when>
+ <!-- CMake -->
+ <xsl:when test="$language = 'cmake'">
+ <xsl:text>cmake</xsl:text>
+ </xsl:when>
+ <!-- CSS -->
+ <xsl:when test="$language = 'css' or $language = 'css21'">
+ <xsl:text>css</xsl:text>
+ </xsl:when>
+ <!-- D -->
+ <xsl:when test="$language = 'd'">
+ <xsl:text>d</xsl:text>
+ </xsl:when>
+ <!-- Diff -->
+ <xsl:when test="$language = 'diff' or $language = 'patch'">
+ <xsl:text>diff</xsl:text>
+ </xsl:when>
+ <!-- Django -->
+ <xsl:when test="$language = 'django'">
+ <xsl:text>django</xsl:text>
+ </xsl:when>
+ <!-- Dockerfile -->
+ <xsl:when test="$language = 'dockerfile'">
+ <xsl:text>dockerfile</xsl:text>
+ </xsl:when>
+ <!-- DOS -->
+ <xsl:when test="$language = 'dos'">
+ <xsl:text>dos</xsl:text>
+ </xsl:when>
+ <!-- Embedded Ruby -->
+ <xsl:when test="$language = 'erb'">
+ <xsl:text>erb</xsl:text>
+ </xsl:when>
+ <!-- F# -->
+ <xsl:when test="$language = 'fsharp'">
+ <xsl:text>fsharp</xsl:text>
+ </xsl:when>
+ <!-- Go -->
+ <xsl:when test="$language = 'go'">
+ <xsl:text>go</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="$language = 'haml'">
+ <xsl:text>haml</xsl:text>
+ </xsl:when>
+ <!-- Haskell -->
+ <xsl:when test="$language = 'haskell' or $language = 'hs'">
+ <xsl:text>hs</xsl:text>
+ </xsl:when>
+ <!-- HTML -->
+ <xsl:when test="$language = 'html' or $language = 'xhtml'">
+ <xsl:text>html</xsl:text>
+ </xsl:when>
+ <!-- HTTP -->
+ <xsl:when test="$language = 'http'">
+ <xsl:text>http</xsl:text>
+ </xsl:when>
+ <!-- INI -->
+ <xsl:when test="$language = 'ini'">
+ <xsl:text>ini</xsl:text>
+ </xsl:when>
+ <!-- Java -->
+ <xsl:when test="$language = 'java'">
+ <xsl:text>java</xsl:text>
+ </xsl:when>
+ <!-- Javascript -->
+ <xsl:when test="$language = 'js' or $language = 'javascript'">
+ <xsl:text>javascript</xsl:text>
+ </xsl:when>
+ <!-- JSON -->
+ <xsl:when test="$language = 'json'">
+ <xsl:text>json</xsl:text>
+ </xsl:when>
+ <!-- LISP -->
+ <xsl:when test="$language = 'lisp' or $language = 'el' or
+ $language = 'cl' or $language = 'lsp'">
+ <xsl:text>lisp</xsl:text>
+ </xsl:when>
+ <!-- Lua -->
+ <xsl:when test="$language = 'lua'">
+ <xsl:text>lua</xsl:text>
+ </xsl:when>
+ <!-- Makefile -->
+ <xsl:when test="$language = 'makefile' or $language = 'make'">
+ <xsl:text>makefile</xsl:text>
+ </xsl:when>
+ <!-- Markdown -->
+ <xsl:when test="$language = 'markdown' or $language = 'md'">
+ <xsl:text>markdown</xsl:text>
+ </xsl:when>
+ <!-- MATLAB/Octave -->
+ <xsl:when test="$language = 'matlab' or $language = 'octave'">
+ <xsl:text>matlab</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="$language = 'nginx'">
+ <xsl:text>nginx</xsl:text>
+ </xsl:when>
+ <!-- Objective C -->
+ <xsl:when test="$language = 'objc' or $language = 'm'">
+ <xsl:text>objectivec</xsl:text>
+ </xsl:when>
+ <!-- Perl -->
+ <xsl:when test="$language = 'perl' or
+ $language = 'pl' or $language = 'pm'">
+ <xsl:text>perl</xsl:text>
+ </xsl:when>
+ <!-- PHP -->
+ <xsl:when test="$language = 'php'">
+ <xsl:text>php</xsl:text>
+ </xsl:when>
+ <!-- Python -->
+ <xsl:when test="$language = 'py' or $language = 'python'">
+ <xsl:text>python</xsl:text>
+ </xsl:when>
+ <!-- R/S -->
+ <xsl:when test="$language = 'r' or $language = 's'">
+ <xsl:text>r</xsl:text>
+ </xsl:when>
+ <!-- Ruby -->
+ <xsl:when test="$language = 'ruby' or $language = 'rb'">
+ <xsl:text>ruby</xsl:text>
+ </xsl:when>
+ <!-- Rust -->
+ <xsl:when test="$language = 'rust'">
+ <xsl:text>rust</xsl:text>
+ </xsl:when>
+ <!-- Scala -->
+ <xsl:when test="$language = 'scala'">
+ <xsl:text>scala</xsl:text>
+ </xsl:when>
+ <!-- Scheme -->
+ <xsl:when test="$language = 'scheme' or $language = 'scm'">
+ <xsl:text>scheme</xsl:text>
+ </xsl:when>
+ <!-- Smalltalk -->
+ <xsl:when test="$language = 'smalltalk'">
+ <xsl:text>smalltalk</xsl:text>
+ </xsl:when>
+ <!-- TCL -->
+ <xsl:when test="$language = 'tcl'">
+ <xsl:text>tcl</xsl:text>
+ </xsl:when>
+ <!-- TeX -->
+ <xsl:when test="$language = 'tex' or $language = 'latex'">
+ <xsl:text>tex</xsl:text>
+ </xsl:when>
+ <!-- Vala -->
+ <xsl:when test="$language = 'vala'">
+ <xsl:text>vala</xsl:text>
+ </xsl:when>
+ <!-- XML -->
+ <xsl:when test="$language = 'xml' or $language = 'myxml'">
+ <xsl:text>xml</xsl:text>
+ </xsl:when>
+ <!-- XQuery -->
+ <xsl:when test="$language = 'xq' or $language = 'xquery'">
+ <xsl:text>xquery</xsl:text>
+ </xsl:when>
+ <!-- YAML -->
+ <xsl:when test="$language = 'yaml'">
+ <xsl:text>yaml</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
<!-- = context = -->
<xsl:template mode="dita2html.topic.mode" match="&topic_context;">
<xsl:call-template name="dita2html.div">
diff --git a/xslt/dita/html/dita2html-topic.xsl b/xslt/dita/html/dita2html-topic.xsl
index 21d5d5c4..2353a270 100644
--- a/xslt/dita/html/dita2html-topic.xsl
+++ b/xslt/dita/html/dita2html-topic.xsl
@@ -44,6 +44,13 @@ REMARK: Describe this module
</xsl:call-template>
</xsl:for-each>
</xsl:when>
+ <xsl:when test="&topic_topic;">
+ <!-- Don't call the stylesheets this way for publishing, but
+ sometimes it's useful for one-off simple topic tests. -->
+ <xsl:call-template name="html.output">
+ <xsl:with-param name="node" select="&topic_topic;"/>
+ </xsl:call-template>
+ </xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Unmatched root element: </xsl:text>
@@ -304,7 +311,7 @@ REMARK: Describe this module
</xsl:template>
-<!-- == map == -->
+<!-- == map & html.*.mode == -->
<!-- = map % html.title.mode = -->
<xsl:template mode="html.title.mode" match="&map_map;">
@@ -352,7 +359,7 @@ REMARK: Describe this module
</xsl:template>
-<!-- == topicref == -->
+<!-- == topicref % html.*.mode == -->
<!-- = topicref % html.title.mode = -->
<xsl:template mode="html.title.mode" match="&map_topicref;">
@@ -440,6 +447,31 @@ REMARK: Describe this module
</xsl:template>
+<!-- == topic % html.*.mode == -->
+<!-- These only get called when using a topic as a top-level, instead
+of a map. You shouldn't generally use these stylesheets that way, but
+it's occasionally useful for testing simple topics. -->
+
+<!-- = topic % html.title.mode = -->
+<xsl:template mode="html.title.mode" match="&topic_topic;">
+ <xsl:value-of select="&topic_title_all;"/>
+</xsl:template>
+
+<!-- = topic % html.header.mode = -->
+<xsl:template mode="html.header.mode" match="&topic_topic;">
+</xsl:template>
+
+<!-- = topic % html.footer.mode = -->
+<xsl:template mode="html.footer.mode" match="&topic_topic;">
+ <xsl:call-template name="dita2html.topic.about"/>
+</xsl:template>
+
+<!-- = topic % html.body.mode = -->
+<xsl:template mode="html.body.mode" match="&topic_topic;">
+ <xsl:apply-templates mode="dita2html.topic.mode" select="."/>
+</xsl:template>
+
+
<!-- == CSS == -->
<xsl:template mode="html.css.mode" match="*">
diff --git a/xslt/dita/html/dita2html.xsl b/xslt/dita/html/dita2html.xsl
index 11703794..21bc585f 100644
--- a/xslt/dita/html/dita2html.xsl
+++ b/xslt/dita/html/dita2html.xsl
@@ -16,7 +16,7 @@ along with this program; see the file COPYING.LGPL. If not, see <http://www.gnu
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:html="http://www.w3.org/1999/xhtml"
- exclude-result-prefixes="html mml"
+ exclude-result-prefixes="html"
version="1.0">
<!--!!==========================================================================
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index d0e2b049..232969b4 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -360,15 +360,14 @@ This template handles conditional processing.
<xsl:with-param name="number" select="$number"/>
</xsl:call-template></pre>
</xsl:if>
- <pre>
- <xsl:attribute name="class">
- <xsl:text>contents </xsl:text>
- <xsl:if test="$html.syntax.highlight and $node/@language">
+ <pre class="contents"><code>
+ <xsl:if test="$html.syntax.highlight and $node/@language">
+ <xsl:attribute name="class">
<xsl:call-template name="html.syntax.class">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
- </xsl:if>
- </xsl:attribute>
+ </xsl:attribute>
+ </xsl:if>
<!-- Strip off a leading newline -->
<xsl:if test="$children[1]/self::text()">
<xsl:choose>
@@ -381,7 +380,7 @@ This template handles conditional processing.
</xsl:choose>
</xsl:if>
<xsl:apply-templates select="$children[not(position() = 1 and self::text())]"/>
- </pre>
+ </code></pre>
</div>
</xsl:if>
</xsl:template>
@@ -591,6 +590,211 @@ This template handles conditional processing.
</xsl:call-template>
</xsl:template>
+<xsl:template mode="html.syntax.class.mode"
+ match="programlisting | db:programlisting">
+ <xsl:param name="language" select="translate(@language,
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYX',
+ 'abcdefghijklmnopqrstuvwxyz')"/>
+ <!-- Try to accept the same values as xslthl -->
+ <xsl:choose>
+ <!-- ActionScript -->
+ <xsl:when test="$language = 'actionscript'">
+ <xsl:text>actionscript</xsl:text>
+ </xsl:when>
+ <!-- Apache -->
+ <xsl:when test="$language = 'apache'">
+ <xsl:text>apache</xsl:text>
+ </xsl:when>
+ <!-- AsciiDoc -->
+ <xsl:when test="$language = 'asciidoc' or $language = 'adoc'">
+ <xsl:text>asciidoc</xsl:text>
+ </xsl:when>
+ <!-- Bash -->
+ <xsl:when test="$language = 'sh' or $language = 'bash' or
+ $language = 'csh' or $language = 'bourne'">
+ <xsl:text>bash</xsl:text>
+ </xsl:when>
+ <!-- C -->
+ <xsl:when test="$language = 'c'">
+ <xsl:text>c</xsl:text>
+ </xsl:when>
+ <!-- C# -->
+ <xsl:when test="$language = 'cs' or $language = 'csharp'">
+ <xsl:text>cs</xsl:text>
+ </xsl:when>
+ <!-- C++ -->
+ <xsl:when test="$language = 'cpp' or $language = 'c++'">
+ <xsl:text>cpp</xsl:text>
+ </xsl:when>
+ <!-- Clojure -->
+ <xsl:when test="$language = 'clojure' or $language = 'clj'">
+ <xsl:text>clojure</xsl:text>
+ </xsl:when>
+ <!-- CMake -->
+ <xsl:when test="$language = 'cmake'">
+ <xsl:text>cmake</xsl:text>
+ </xsl:when>
+ <!-- CSS -->
+ <xsl:when test="$language = 'css' or $language = 'css21'">
+ <xsl:text>css</xsl:text>
+ </xsl:when>
+ <!-- D -->
+ <xsl:when test="$language = 'd'">
+ <xsl:text>d</xsl:text>
+ </xsl:when>
+ <!-- Diff -->
+ <xsl:when test="$language = 'diff' or $language = 'patch'">
+ <xsl:text>diff</xsl:text>
+ </xsl:when>
+ <!-- Django -->
+ <xsl:when test="$language = 'django'">
+ <xsl:text>django</xsl:text>
+ </xsl:when>
+ <!-- Dockerfile -->
+ <xsl:when test="$language = 'dockerfile'">
+ <xsl:text>dockerfile</xsl:text>
+ </xsl:when>
+ <!-- DOS -->
+ <xsl:when test="$language = 'dos'">
+ <xsl:text>dos</xsl:text>
+ </xsl:when>
+ <!-- Embedded Ruby -->
+ <xsl:when test="$language = 'erb'">
+ <xsl:text>erb</xsl:text>
+ </xsl:when>
+ <!-- F# -->
+ <xsl:when test="$language = 'fsharp'">
+ <xsl:text>fsharp</xsl:text>
+ </xsl:when>
+ <!-- Go -->
+ <xsl:when test="$language = 'go'">
+ <xsl:text>go</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="$language = 'haml'">
+ <xsl:text>haml</xsl:text>
+ </xsl:when>
+ <!-- Haskell -->
+ <xsl:when test="$language = 'haskell' or $language = 'hs'">
+ <xsl:text>hs</xsl:text>
+ </xsl:when>
+ <!-- HTML -->
+ <xsl:when test="$language = 'html' or $language = 'xhtml'">
+ <xsl:text>html</xsl:text>
+ </xsl:when>
+ <!-- HTTP -->
+ <xsl:when test="$language = 'http'">
+ <xsl:text>http</xsl:text>
+ </xsl:when>
+ <!-- INI -->
+ <xsl:when test="$language = 'ini'">
+ <xsl:text>ini</xsl:text>
+ </xsl:when>
+ <!-- Java -->
+ <xsl:when test="$language = 'java'">
+ <xsl:text>java</xsl:text>
+ </xsl:when>
+ <!-- Javascript -->
+ <xsl:when test="$language = 'js' or $language = 'javascript'">
+ <xsl:text>javascript</xsl:text>
+ </xsl:when>
+ <!-- JSON -->
+ <xsl:when test="$language = 'json'">
+ <xsl:text>json</xsl:text>
+ </xsl:when>
+ <!-- LISP -->
+ <xsl:when test="$language = 'lisp' or $language = 'el' or
+ $language = 'cl' or $language = 'lsp'">
+ <xsl:text>lisp</xsl:text>
+ </xsl:when>
+ <!-- Lua -->
+ <xsl:when test="$language = 'lua'">
+ <xsl:text>lua</xsl:text>
+ </xsl:when>
+ <!-- Makefile -->
+ <xsl:when test="$language = 'makefile' or $language = 'make'">
+ <xsl:text>makefile</xsl:text>
+ </xsl:when>
+ <!-- Markdown -->
+ <xsl:when test="$language = 'markdown' or $language = 'md'">
+ <xsl:text>markdown</xsl:text>
+ </xsl:when>
+ <!-- MATLAB/Octave -->
+ <xsl:when test="$language = 'matlab' or $language = 'octave'">
+ <xsl:text>matlab</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="$language = 'nginx'">
+ <xsl:text>nginx</xsl:text>
+ </xsl:when>
+ <!-- Objective C -->
+ <xsl:when test="$language = 'objc' or $language = 'm'">
+ <xsl:text>objectivec</xsl:text>
+ </xsl:when>
+ <!-- Perl -->
+ <xsl:when test="$language = 'perl' or
+ $language = 'pl' or $language = 'pm'">
+ <xsl:text>perl</xsl:text>
+ </xsl:when>
+ <!-- PHP -->
+ <xsl:when test="$language = 'php'">
+ <xsl:text>php</xsl:text>
+ </xsl:when>
+ <!-- Python -->
+ <xsl:when test="$language = 'py' or $language = 'python'">
+ <xsl:text>python</xsl:text>
+ </xsl:when>
+ <!-- R/S -->
+ <xsl:when test="$language = 'r' or $language = 's'">
+ <xsl:text>r</xsl:text>
+ </xsl:when>
+ <!-- Ruby -->
+ <xsl:when test="$language = 'ruby' or $language = 'rb'">
+ <xsl:text>ruby</xsl:text>
+ </xsl:when>
+ <!-- Rust -->
+ <xsl:when test="$language = 'rust'">
+ <xsl:text>rust</xsl:text>
+ </xsl:when>
+ <!-- Scala -->
+ <xsl:when test="$language = 'scala'">
+ <xsl:text>scala</xsl:text>
+ </xsl:when>
+ <!-- Scheme -->
+ <xsl:when test="$language = 'scheme' or $language = 'scm'">
+ <xsl:text>scheme</xsl:text>
+ </xsl:when>
+ <!-- Smalltalk -->
+ <xsl:when test="$language = 'smalltalk'">
+ <xsl:text>smalltalk</xsl:text>
+ </xsl:when>
+ <!-- TCL -->
+ <xsl:when test="$language = 'tcl'">
+ <xsl:text>tcl</xsl:text>
+ </xsl:when>
+ <!-- TeX -->
+ <xsl:when test="$language = 'tex' or $language = 'latex'">
+ <xsl:text>tex</xsl:text>
+ </xsl:when>
+ <!-- Vala -->
+ <xsl:when test="$language = 'vala'">
+ <xsl:text>vala</xsl:text>
+ </xsl:when>
+ <!-- XML -->
+ <xsl:when test="$language = 'xml' or $language = 'myxml'">
+ <xsl:text>xml</xsl:text>
+ </xsl:when>
+ <!-- XQuery -->
+ <xsl:when test="$language = 'xq' or $language = 'xquery'">
+ <xsl:text>xquery</xsl:text>
+ </xsl:when>
+ <!-- YAML -->
+ <xsl:when test="$language = 'yaml'">
+ <xsl:text>yaml</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
<!-- = screen = -->
<xsl:template match="screen | db:screen">
<xsl:call-template name="db2html.pre"/>
diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl
index e690cc91..8fe3645d 100644
--- a/xslt/docbook/html/db2html-division.xsl
+++ b/xslt/docbook/html/db2html-division.xsl
@@ -195,14 +195,14 @@ REMARK: Talk about some of the parameters
<xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
<xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
</xsl:apply-templates>
+ <xsl:if test="$depth_in_chunk = 0 and
+ not($node/processing-instruction('db2html.no_sectionlinks'))">
+ <xsl:call-template name="db2html.links.section">
+ <xsl:with-param name="node" select="$node"/>
+ <xsl:with-param name="divisions" select="$divisions"/>
+ </xsl:call-template>
+ </xsl:if>
</div>
- <xsl:if test="$depth_in_chunk = 0 and
- not($node/processing-instruction('db2html.no_sectionlinks'))">
- <xsl:call-template name="db2html.links.section">
- <xsl:with-param name="node" select="$node"/>
- <xsl:with-param name="divisions" select="$divisions"/>
- </xsl:call-template>
- </xsl:if>
<xsl:for-each select="$divisions">
<xsl:if test="not($chunk_divisions) or not(self::&db_chunks;)">
<xsl:apply-templates select=".">
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 6eb999cd..f980c0db 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -78,15 +78,14 @@ syntax highlighting support based on the #{mime} attribute of ${node}, using
<xsl:with-param name="node" select="$node"/>
</xsl:call-template></pre>
</xsl:if>
- <pre>
- <xsl:attribute name="class">
- <xsl:text>contents </xsl:text>
- <xsl:if test="$html.syntax.highlight and $node/@mime">
+ <pre class="contents"><code>
+ <xsl:if test="$html.syntax.highlight and ($node/@mime or $node/@type)">
+ <xsl:attribute name="class">
<xsl:call-template name="html.syntax.class">
<xsl:with-param name="node" select="$node"/>
</xsl:call-template>
- </xsl:if>
- </xsl:attribute>
+ </xsl:attribute>
+ </xsl:if>
<xsl:if test="$first">
<xsl:call-template name="utils.strip_newlines">
<xsl:with-param name="string" select="$first"/>
@@ -103,7 +102,7 @@ syntax highlighting support based on the #{mime} attribute of ${node}, using
<xsl:with-param name="trailing" select="true()"/>
</xsl:call-template>
</xsl:if>
- </pre>
+ </code></pre>
</div>
</xsl:if>
</xsl:template>
@@ -166,6 +165,238 @@ in accordance with the Mallard specification on fallback block content.
<xsl:call-template name="mal2html.pre"/>
</xsl:template>
+<xsl:template mode="html.syntax.class.mode" match="mal:code | mal:screen">
+ <xsl:variable name="type" select="concat(' ', translate(@type,
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYX',
+ 'abcdefghijklmnopqrstuvwxyz'),
+ ' ')"/>
+ <xsl:choose>
+ <!-- First do checks for embedded and derivative things, where people
+ might reasonably put other matched values in the type attribute. -->
+ <!-- Clojure -->
+ <xsl:when test="@mime = 'application/x-clojure' or
+ contains($type, ' clojure ') or contains($type, ' clj ')">
+ <xsl:text>clojure</xsl:text>
+ </xsl:when>
+ <!-- Django -->
+ <xsl:when test="@mime = 'application/x-django-templating' or contains($type, ' django ')">
+ <xsl:text>django</xsl:text>
+ </xsl:when>
+ <!-- Embedded Ruby -->
+ <xsl:when test="@mime = 'application/x-ruby-templating' or contains($type, ' erb ')">
+ <xsl:text>erb</xsl:text>
+ </xsl:when>
+ <!-- JSON -->
+ <xsl:when test="@mime = 'application/json' or contains($type, ' json ')">
+ <xsl:text>json</xsl:text>
+ </xsl:when>
+ <!-- PHP -->
+ <xsl:when test="@mime = 'application/x-php' or contains($type, ' php ')">
+ <xsl:text>php</xsl:text>
+ </xsl:when>
+ <!-- Scheme -->
+ <xsl:when test="@mime = 'text/x-scheme' or
+ contains($type, ' scheme ') or contains($type, ' scm ')">
+ <xsl:text>scheme</xsl:text>
+ </xsl:when>
+
+ <!-- Then do the rest of the checks. -->
+ <!-- ActionScript -->
+ <xsl:when test="@mime = 'application/x-actionscript' or contains($type, ' actionscript ')">
+ <xsl:text>actionscript</xsl:text>
+ </xsl:when>
+ <!-- Apache -->
+ <xsl:when test="@mime = 'text/x-apacheconf' or contains($type, ' apache ')">
+ <xsl:text>apache</xsl:text>
+ </xsl:when>
+ <!-- AsciiDoc -->
+ <xsl:when test="@mime = 'text/x-asciidoc' or
+ contains($type, ' asciidoc ') or contains($type, ' adoc ')">
+ <xsl:text>asciidoc</xsl:text>
+ </xsl:when>
+ <!-- Bash -->
+ <xsl:when test="@mime = 'application/x-shellscript' or
+ contains($type, ' sh ') or contains($type, ' bash ') or
+ contains($type, ' csh ')">
+ <xsl:text>bash</xsl:text>
+ </xsl:when>
+ <!-- C -->
+ <xsl:when test="@mime = 'text/x-csrc' or @mime = 'text/x-chdr' or
+ contains($type, ' c ')">
+ <xsl:text>c</xsl:text>
+ </xsl:when>
+ <!-- C# -->
+ <xsl:when test="@mime = 'text/x-csharp' or
+ contains($type, ' cs ') or contains($type, ' csharp ')">
+ <xsl:text>cs</xsl:text>
+ </xsl:when>
+ <!-- C++ -->
+ <xsl:when test="@mime = 'text/x-c++hdr' or @mime = 'text/x-c++src' or
+ contains($type, ' cpp ') or contains($type, ' c++ ')">
+ <xsl:text>cpp</xsl:text>
+ </xsl:when>
+ <!-- CMake -->
+ <xsl:when test="@mime = 'text/x-cmake' or contains($type, ' cmake ')">
+ <xsl:text>cmake</xsl:text>
+ </xsl:when>
+ <!-- CSS -->
+ <xsl:when test="@mime = 'text/css' or contains($type, ' css ')">
+ <xsl:text>css</xsl:text>
+ </xsl:when>
+ <!-- D -->
+ <xsl:when test="@mime = 'text/x-d' or contains($type, ' d ')">
+ <xsl:text>d</xsl:text>
+ </xsl:when>
+ <!-- Diff -->
+ <xsl:when test="@mime = 'text/x-diff' or @mime = 'text/x-patch' or
+ contains($type, ' diff ') or contains($type, ' patch ')">
+ <xsl:text>diff</xsl:text>
+ </xsl:when>
+ <!-- Dockerfile -->
+ <xsl:when test="contains($type, ' dockerfile ')">
+ <xsl:text>dockerfile</xsl:text>
+ </xsl:when>
+ <!-- DOS -->
+ <xsl:when test="@mime = 'application/x-dos-batch' or contains($type, ' dos ')">
+ <xsl:text>dos</xsl:text>
+ </xsl:when>
+ <!-- F# -->
+ <xsl:when test="@mime = 'text/x-fsharp' or contains($type, ' fsharp ')">
+ <xsl:text>fsharp</xsl:text>
+ </xsl:when>
+ <!-- Go -->
+ <xsl:when test="@mime = 'text/x-go' or contains($type, ' go ')">
+ <xsl:text>go</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="@mime = 'text/x-haml' or contains($type, ' haml ')">
+ <xsl:text>haml</xsl:text>
+ </xsl:when>
+ <!-- Haskell -->
+ <xsl:when test="@mime = 'text/x-haskell' or
+ contains($type, ' haskell ') or contains($type, ' hs ')">
+ <xsl:text>hs</xsl:text>
+ </xsl:when>
+ <!-- HTML -->
+ <xsl:when test="@mime = 'text/html' or
+ contains($type, ' html ') or contains($type, ' xhtml ')">
+ <xsl:text>html</xsl:text>
+ </xsl:when>
+ <!-- HTTP -->
+ <xsl:when test="contains($type, ' http ')">
+ <xsl:text>http</xsl:text>
+ </xsl:when>
+ <!-- INI -->
+ <xsl:when test="contains($type, ' ini ')">
+ <xsl:text>ini</xsl:text>
+ </xsl:when>
+ <!-- Java -->
+ <xsl:when test="@mime = 'text/x-java' or contains($type, ' java ')">
+ <xsl:text>java</xsl:text>
+ </xsl:when>
+ <!-- Javascript -->
+ <xsl:when test="@mime = 'application/javascript' or
+ contains($type, ' js ') or contains($type, ' javascript ')">
+ <xsl:text>javascript</xsl:text>
+ </xsl:when>
+ <!-- LISP -->
+ <xsl:when test="@mime = 'application/x-lisp' or @mime = 'text/x-emacs-lisp' or
+ contains($type, ' lisp ') or contains($type, ' el ') or
+ contains($type, ' cl ') or contains($type, ' lsp ')">
+ <xsl:text>lisp</xsl:text>
+ </xsl:when>
+ <!-- Lua -->
+ <xsl:when test="@mime = 'text/x-lua' or contains($type, ' lua ')">
+ <xsl:text>lua</xsl:text>
+ </xsl:when>
+ <!-- Makefile -->
+ <xsl:when test="@mime = 'text/x-makefile' or
+ contains($type, ' makefile ') or contains($type, ' make ')">
+ <xsl:text>makefile</xsl:text>
+ </xsl:when>
+ <!-- Markdown -->
+ <xsl:when test="@mime = 'text/x-markdown' or
+ contains($type, ' markdown ') or contains($type, ' md ')">
+ <xsl:text>markdown</xsl:text>
+ </xsl:when>
+ <!-- MATLAB/Octave -->
+ <xsl:when test="@mime = 'text/x-matlab' or @mime = 'text/x-octave' or
+ contains($type, ' matlab ') or contains($type, ' octave ')">
+ <xsl:text>matlab</xsl:text>
+ </xsl:when>
+ <!-- Nginx -->
+ <xsl:when test="@mime = 'text/x-nginx-conf' or contains($type, ' nginx ')">
+ <xsl:text>nginx</xsl:text>
+ </xsl:when>
+ <!-- Objective C -->
+ <xsl:when test="@mime = 'text/x-objcsrc' or
+ contains($type, ' objc ') or contains($type, ' m ')">
+ <xsl:text>objectivec</xsl:text>
+ </xsl:when>
+ <!-- Perl -->
+ <xsl:when test="@mime = 'application/x-perl' or contains($type, ' perl ') or
+ contains($type, ' pl ') or contains($type, ' pm ')">
+ <xsl:text>perl</xsl:text>
+ </xsl:when>
+ <!-- Python -->
+ <xsl:when test="@mime = 'text/x-python' or
+ contains($type, ' py ') or contains($type, ' python ')">
+ <xsl:text>python</xsl:text>
+ </xsl:when>
+ <!-- R/S -->
+ <xsl:when test="@mime = 'text/x-r' or @mime = 'text/x-s' or
+ contains($type, ' r ') or contains($type, ' s ')">
+ <xsl:text>r</xsl:text>
+ </xsl:when>
+ <!-- Ruby -->
+ <xsl:when test="@mime = 'application/x-ruby' or
+ contains($type, ' ruby ') or contains($type, ' rb ')">
+ <xsl:text>ruby</xsl:text>
+ </xsl:when>
+ <!-- Rust -->
+ <xsl:when test="@mime = 'text/x-rust' or contains($type, ' rust ')">
+ <xsl:text>rust</xsl:text>
+ </xsl:when>
+ <!-- Scala -->
+ <xsl:when test="@mime = 'text/x-scala' or contains($type, ' scala ')">
+ <xsl:text>scala</xsl:text>
+ </xsl:when>
+ <!-- Smalltalk -->
+ <xsl:when test="@mime = 'text/x-smalltalk' or contains($type, ' smalltalk ')">
+ <xsl:text>smalltalk</xsl:text>
+ </xsl:when>
+ <!-- TCL -->
+ <xsl:when test="@mime = 'application/x-tcl' or @mime = 'text/x-tcl' or
+ contains($type, ' tcl ')">
+ <xsl:text>tcl</xsl:text>
+ </xsl:when>
+ <!-- TeX -->
+ <xsl:when test="@mime = 'text/x-tex' or
+ contains($type, ' tex ') or contains($type, ' latex ')">
+ <xsl:text>tex</xsl:text>
+ </xsl:when>
+ <!-- Vala -->
+ <xsl:when test="@mime = 'text/x-vala' or contains($type, ' vala ')">
+ <xsl:text>vala</xsl:text>
+ </xsl:when>
+ <!-- XML -->
+ <xsl:when test="@mime = 'application/xml' or
+ substring(@mime, string-length(@mime) - 3) = '+xml'
+ or contains($type, ' xml ')">
+ <xsl:text>xml</xsl:text>
+ </xsl:when>
+ <!-- XQuery -->
+ <xsl:when test="@mime = 'application/xquery' or
+ contains($type, ' xq ') or contains($type, ' xquery ')">
+ <xsl:text>xquery</xsl:text>
+ </xsl:when>
+ <!-- YAML -->
+ <xsl:when test="@mime = 'application/x-yaml' or contains($type, ' yaml ')">
+ <xsl:text>yaml</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
<!-- = comment = -->
<xsl:template mode="mal2html.block.mode" match="mal:comment">
<xsl:variable name="if"><xsl:call-template name="mal.if.test"/></xsl:variable><xsl:if test="$if != ''">