[yelp-xsl/wip/html5] Switch to highlight.js and revamp color stylesheet



commit ff740f6c5e64a7ac213b7b3b9f7f47cb0c080e23
Author: Shaun McCance <shaunm redhat com>
Date:   Sun Jan 3 12:33:26 2016 -0500

    Switch to highlight.js and revamp color stylesheet
    
    Switching from the dead jQuery.syntax to the actively maintained highlight.js
    for syntax highlighting. highlight.js doesn't require jQuery, doesn't break
    inline markup, and has nicely namespaced class names that avoid clashes with
    classes used elsewhere in these stylesheets.
    
    Previously, we included the JavaScript for syntax highlighting, but didn't
    provide any CSS to specify colors, leaving a large chunk of work to users
    to get syntax highlighting visible. This is because the colors defined in
    color.xsl weren't useful as text colors. This commit introduces a new color
    system which includes background, foreground, and accent shades for six
    colors, as well as multiple shades of gray. Many of these colors can now
    be automatically computed, thanks to color algorithms built into the XSLT.

 .gitignore                               |    1 +
 js/Makefile.am                           |   43 +-
 js/highlight.pack.js                     |    3 +
 js/jquery.syntax.brush.apache.js         |   41 -
 js/jquery.syntax.brush.applescript.js    |   57 --
 js/jquery.syntax.brush.assembly.js       |   37 -
 js/jquery.syntax.brush.bash-script.js    |   67 --
 js/jquery.syntax.brush.bash.js           |   33 -
 js/jquery.syntax.brush.basic.js          |   51 --
 js/jquery.syntax.brush.clang.js          |   89 ---
 js/jquery.syntax.brush.csharp.js         |   47 --
 js/jquery.syntax.brush.css.js            |   80 --
 js/jquery.syntax.brush.diff.js           |   24 -
 js/jquery.syntax.brush.go.js             |   47 --
 js/jquery.syntax.brush.haskell.js        |   45 --
 js/jquery.syntax.brush.html.js           |   66 --
 js/jquery.syntax.brush.io.js             |   45 --
 js/jquery.syntax.brush.java.js           |   45 --
 js/jquery.syntax.brush.javascript.js     |   40 -
 js/jquery.syntax.brush.kai.js            |   29 -
 js/jquery.syntax.brush.lisp.js           |   34 -
 js/jquery.syntax.brush.lua.js            |   44 --
 js/jquery.syntax.brush.ocaml.js          |   73 --
 js/jquery.syntax.brush.ooc.js            |   46 --
 js/jquery.syntax.brush.pascal.js         |   51 --
 js/jquery.syntax.brush.perl5.js          |   52 --
 js/jquery.syntax.brush.php-script.js     |   48 --
 js/jquery.syntax.brush.php.js            |   15 -
 js/jquery.syntax.brush.plain.js          |   10 -
 js/jquery.syntax.brush.protobuf.js       |   43 --
 js/jquery.syntax.brush.python.js         |   44 --
 js/jquery.syntax.brush.ruby.js           |   77 --
 js/jquery.syntax.brush.scala.js          |   44 --
 js/jquery.syntax.brush.smalltalk.js      |   29 -
 js/jquery.syntax.brush.sql.js            |   31 -
 js/jquery.syntax.brush.super-collider.js |   57 --
 js/jquery.syntax.brush.xml.js            |   50 --
 js/jquery.syntax.brush.yaml.js           |   29 -
 js/jquery.syntax.core.js                 | 1177 ------------------------------
 js/jquery.syntax.js                      |  317 --------
 js/jquery.syntax.layout.editor.js        |  291 --------
 js/jquery.syntax.layout.fixed.js         |   70 --
 js/jquery.syntax.layout.inline.js        |   13 -
 js/jquery.syntax.layout.list.js          |   54 --
 js/jquery.syntax.layout.plain.js         |   15 -
 js/jquery.syntax.layout.table.js         |   58 --
 js/jquery.syntax.layout.yelp.js          |    4 -
 js/syntax.html                           |  194 -----
 test/syntax/Makefile                     |   11 +
 test/syntax/code/actionscript            |   24 +
 test/syntax/code/apache                  |   19 +
 test/syntax/code/asciidoc                |   65 ++
 test/syntax/code/bash                    |   30 +
 test/syntax/code/clojure                 |   18 +
 test/syntax/code/cmake                   |   19 +
 test/syntax/code/cpp                     |   15 +
 test/syntax/code/cs                      |   38 +
 test/syntax/code/css                     |   25 +
 test/syntax/code/d                       |   44 ++
 test/syntax/code/diff                    |   30 +
 test/syntax/code/django                  |   16 +
 test/syntax/code/dockerfile              |   48 ++
 test/syntax/code/dos                     |   24 +
 test/syntax/code/erb                     |   10 +
 test/syntax/code/fsharp                  |   48 ++
 test/syntax/code/go                      |   34 +
 test/syntax/code/haml                    |   14 +
 test/syntax/code/haskell                 |   38 +
 test/syntax/code/http                    |    6 +
 test/syntax/code/ini                     |   12 +
 test/syntax/code/java                    |   35 +
 test/syntax/code/javascript              |   37 +
 test/syntax/code/json                    |   12 +
 test/syntax/code/lisp                    |   22 +
 test/syntax/code/lua                     |   32 +
 test/syntax/code/makefile                |   13 +
 test/syntax/code/markdown                |   22 +
 test/syntax/code/matlab                  |   45 ++
 test/syntax/code/nginx                   |   47 ++
 test/syntax/code/objectivec              |   43 ++
 test/syntax/code/perl                    |   41 +
 test/syntax/code/php                     |   52 ++
 test/syntax/code/python                  |   12 +
 test/syntax/code/r                       |   68 ++
 test/syntax/code/ruby                    |   28 +
 test/syntax/code/rust                    |   55 ++
 test/syntax/code/scala                   |   44 ++
 test/syntax/code/scheme                  |   28 +
 test/syntax/code/smalltalk               |   39 +
 test/syntax/code/tcl                     |   26 +
 test/syntax/code/tex                     |   17 +
 test/syntax/code/vala                    |   46 ++
 test/syntax/code/xml                     |   24 +
 test/syntax/code/xquery                  |   20 +
 test/syntax/code/yaml                    |   39 +
 test/syntax/dita.dita                    |  614 ++++++++++++++++
 test/syntax/docbook.docbook              |  517 +++++++++++++
 test/syntax/mallard.page                 |  713 ++++++++++++++++++
 xslt/common/color.xsl                    |  955 ++++++++++++++++++++++---
 xslt/common/html.xsl                     |  368 +++++-----
 xslt/dita/html/dita2html-block.xsl       |  216 ++++++-
 xslt/dita/html/dita2html-topic.xsl       |   36 +-
 xslt/dita/html/dita2html.xsl             |    2 +-
 xslt/docbook/html/db2html-block.xsl      |  218 ++++++-
 xslt/docbook/html/db2html-division.xsl   |   14 +-
 xslt/mallard/html/mal2html-block.xsl     |  245 ++++++-
 106 files changed, 5028 insertions(+), 4165 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index da1d68b..df78e4b 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 6fbd4a0..bc3eef2 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 0000000..fe36d8d
--- /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 def
 ault 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 serverro
 ot 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|fi
 
le|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 get
 cap 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-w
 hile 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_sourcel
 ist 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_d
 epends 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 pub
 lic 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 mo
 df 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 i
 nt 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 debu
 g 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 w
 orkdir 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 sub
 st 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:"%[qQ
 
wWx]?<",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:"\\(|=|$",e
 
E:!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 dot
 net 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 Da
 te 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={litera
 l:"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("ma
 tlab",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 logsp
 ace 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 deb
 ug 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 re
 gister 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",f
 unction(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 e
 lse 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
 interf
 ace",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:"me
 ta",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 wit
 
h",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 f
 or-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 n
 ot 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 forma
 t 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 Obj
 ect",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-z
 
A-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/test/syntax/Makefile b/test/syntax/Makefile
new file mode 100644
index 0000000..975a897
--- /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 0000000..9c35adf
--- /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 0000000..3bf2af4
--- /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 0000000..bfeb895
--- /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 0000000..b265481
--- /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 0000000..ebce235
--- /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 0000000..2bbea38
--- /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 0000000..37497ac
--- /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 0000000..f58190a
--- /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 0000000..e7a102b
--- /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 0000000..92cc8d8
--- /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 0000000..4f4c04f
--- /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 0000000..150037f
--- /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 0000000..e796dc7
--- /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 0000000..246ca3d
--- /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 0000000..f7ea620
--- /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 0000000..b7a0031
--- /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 0000000..aa8663a
--- /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 0000000..fb4bab3
--- /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 0000000..acb8378
--- /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 0000000..34631a1
--- /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 0000000..03a5c29
--- /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 0000000..7683240
--- /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 0000000..5a6bc04
--- /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 0000000..9710b22
--- /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 0000000..2b62208
--- /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 0000000..58174ee
--- /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 0000000..cd1ec79
--- /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 0000000..e7f66da
--- /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 0000000..81fa717
--- /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 0000000..adf4b7e
--- /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 0000000..177f2ff
--- /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 0000000..3b08442
--- /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 0000000..ec43315
--- /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 0000000..1216323
--- /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 0000000..2f27747
--- /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 0000000..1fb2378
--- /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 0000000..6d0fd4d
--- /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 0000000..d0de617
--- /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 0000000..b62a98c
--- /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 0000000..7c960a7
--- /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 0000000..c05db10
--- /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 0000000..10b2555
--- /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 0000000..aed0468
--- /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 0000000..7f002c4
--- /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 0000000..9ac5efd
--- /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 0000000..49c4939
--- /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 0000000..72662ed
--- /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 0000000..12d0043
--- /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 0000000..0066207
--- /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 97fedc1..6479060 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 d5601a4..24e6ebc 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 aa43244..44217f0 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 21d5d5c..2353a27 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 1170379..21bc585 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 d0e2b04..232969b 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 e690cc9..8fe3645 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 6eb999c..f980c0d 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 != ''">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]