Skip to content
This repository
Browse code

Docs

  • Loading branch information...
commit 96838cebe3638934527aff3b7a760c18306026da 1 parent 0bdad25
Dav Glass davglass authored
80 output/assets/css/main.css
@@ -30,50 +30,6 @@ body {
30 30 padding: 0;
31 31 }
32 32
33   -
34   -ul.links {
35   - list-style-type: none;
36   - padding-left: 0;
37   -}
38   -
39   -ul.links li {
40   - margin-bottom: 8px;
41   -}
42   -
43   -ul.links .button {
44   - display: block;
45   - text-align: left;
46   -}
47   -
48   -.crumbs {
49   - background: whiteSmoke;
50   - background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
51   - background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
52   - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
53   - border-top: 1px solid #DFDFDF;
54   - border-bottom: 1px solid #DFDFDF;
55   - padding: 0.25em 1.25em 0.25em;
56   - margin-bottom: 0.75em;
57   -}
58   -.crumbs a, .crumbs a:visited {
59   - color: #30418C;
60   -}
61   -
62   -#hd {
63   - background: whiteSmoke;
64   - background: -moz-linear-gradient(top,#DCDBD9 0,#F6F5F3 100%);
65   - background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#DCDBD9),color-stop(100%,#F6F5F3));
66   - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#dcdbd9',endColorstr='#F6F5F3',GradientType=0);
67   - border-bottom: 1px solid #DFDFDF;
68   - padding: 0.75em 0 0.5em;
69   - margin-bottom: 15px;
70   -}
71   -
72   -#hd img {
73   - margin-right: 10px;
74   - vertical-align: middle;
75   -}
76   -
77 33 /* -- Links ----------------------------------------------------------------- */
78 34 a {
79 35 color: #356de4;
@@ -144,7 +100,7 @@ code, kbd, pre, samp {
144 100 line-height: 1.35;
145 101 }
146 102
147   -p code, p kbd, p samp {
  103 +p code, p kbd, p samp, li code, li kbd, li samp {
148 104 background: #FCFBFA;
149 105 border: 1px solid #EFEEED;
150 106 padding: 0 3px;
@@ -234,6 +190,7 @@ th {
234 190 /* -- Layout and Content ---------------------------------------------------- */
235 191 #doc {
236 192 margin: auto;
  193 + max-width: 1200px;
237 194 min-width: 960px;
238 195 padding-bottom: 50px;
239 196 }
@@ -397,3 +354,36 @@ th {
397 354
398 355 /* List with extra vertical spacing between items. */
399 356 .spaced li { margin: 0.8em 0; }
  357 +ada;
  358 + *padding-bottom: 5px;
  359 +}
  360 +
  361 +.button:hover {
  362 + border-color: #466899;
  363 + -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  364 + -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  365 + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  366 + color: #fff;
  367 + text-decoration: none;
  368 + -moz-text-shadow: 1px 1px 0 #222;
  369 + -webkit-text-shadow: 1px 1px 0 #222;
  370 + text-shadow: 1px 1px 0 #222;
  371 +
  372 + background: #6396D8; /* old browsers */
  373 + background: -moz-linear-gradient(top, #6396D8 0%, #5A83BC 50%, #547AB7 51%, #466899 100%); /* firefox */
  374 + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#6396D8), color-stop(50%,#5A83BC), color-stop(51%,#547AB7), color-stop(100%,#466899)); /* webkit */
  375 + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6396D8', endColorstr='#466899',GradientType=0 ); /* ie */
  376 +}
  377 +
  378 +/* Big download button, like on the Home page. */
  379 +.button.download {
  380 + display: block;
  381 + font-size: 18px;
  382 + margin: 0 0 1em;
  383 + padding: 9px 17px 8px;
  384 +}
  385 +
  386 +.newwindow { text-align: center; }
  387 +
  388 +/* List with extra vertical spacing between items. */
  389 +.spaced li { margin: 0.8em 0; }
3  output/assets/vendor/prettify/prettify-min.js
... ... @@ -1,2 +1 @@
1   -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.ignoreCase){ac=true}else{if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){S=true;ac=false;break}}}var Y={b:8,t:9,n:10,v:11,f:12,r:13};function ab(ah){var ag=ah.charCodeAt(0);if(ag!==92){return ag}var af=ah.charAt(1);ag=Y[af];if(ag){return ag}else{if("0"<=af&&af<="7"){return parseInt(ah.substring(1),8)}else{if(af==="u"||af==="x"){return parseInt(ah.substring(2),16)}else{return ah.charCodeAt(1)}}}}function T(af){if(af<32){return(af<16?"\\x0":"\\x")+af.toString(16)}var ag=String.fromCharCode(af);if(ag==="\\"||ag==="-"||ag==="["||ag==="]"){ag="\\"+ag}return ag}function X(am){var aq=am.substring(1,am.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ak=[];var af=[];var ao=aq[0]==="^";for(var ar=ao?1:0,aj=aq.length;ar<aj;++ar){var ah=aq[ar];if(/\\[bdsw]/i.test(ah)){ak.push(ah)}else{var ag=ab(ah);var al;if(ar+2<aj&&"-"===aq[ar+1]){al=ab(aq[ar+2]);ar+=2}else{al=ag}af.push([ag,al]);if(!(al<65||ag>122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;ar<af.length;++ar){var at=af[ar];if(at[0]<=ap[1]+1){ap[1]=Math.max(ap[1],at[1])}else{ai.push(ap=at)}}var an=["["];if(ao){an.push("^")}an.push.apply(an,ak);for(var ar=0;ar<ai.length;++ar){var at=ai[ar];an.push(T(at[0]));if(at[1]>at[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){an[af]=-1}}}}for(var ak=1;ak<an.length;++ak){if(-1===an[ak]){an[ak]=++ad}}for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am;if(an[am]===undefined){aj[ak]="(?:"}}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){aj[ak]="\\"+an[am]}}}}for(var ak=0,am=0;ak<ah;++ak){if("^"===aj[ak]&&"^"!==aj[ak+1]){aj[ak]=""}}if(al.ignoreCase&&S){for(var ak=0;ak<ah;++ak){var ag=aj[ak];var ai=ag.charAt(0);if(ag.length>=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.global||ae.multiline){throw new Error(""+ae)}aa.push("(?:"+W(ae)+")")}return new RegExp(aa.join("|"),ac?"gi":"g")}function a(V){var U=/(?:^|\s)nocode(?:\s|$)/;var X=[];var T=0;var Z=[];var W=0;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=document.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Y=S&&"pre"===S.substring(0,3);function aa(ab){switch(ab.nodeType){case 1:if(U.test(ab.className)){return}for(var ae=ab.firstChild;ae;ae=ae.nextSibling){aa(ae)}var ad=ab.nodeName;if("BR"===ad||"LI"===ad){X[W]="\n";Z[W<<1]=T++;Z[(W++<<1)|1]=ab}break;case 3:case 4:var ac=ab.nodeValue;if(ac.length){if(!Y){ac=ac.replace(/[ \t\r\n]+/g," ")}else{ac=ac.replace(/\r\n?/g,"\n")}X[W]=ac;Z[W<<1]=T;T+=ac.length;Z[(W++<<1)|1]=ab}break}}aa(V);return{sourceCode:X.join("").replace(/\n$/,""),spans:Z}}function B(S,U,W,T){if(!U){return}var V={sourceCode:U,basePos:S};W(V);T.push.apply(T,V.decorations)}var v=/\S/;function o(S){var V=undefined;for(var U=S.firstChild;U;U=U.nextSibling){var T=U.nodeType;V=(T===1)?(V?S:U):(T===3)?(v.test(U.nodeValue)?S:V):V}return V===S?undefined:V}function g(U,T){var S={};var V;(function(){var ad=U.concat(T);var ah=[];var ag={};for(var ab=0,Z=ad.length;ab<Z;++ab){var Y=ad[ab];var ac=Y[3];if(ac){for(var ae=ac.length;--ae>=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae<aq;++ae){var ag=an[ae];var ap=aj[ag];var ai=void 0;var am;if(typeof ap==="string"){am=false}else{var aa=S[ag.charAt(0)];if(aa){ai=ag.match(aa[1]);ap=aa[0]}else{for(var ao=0;ao<X;++ao){aa=T[ao];ai=ag.match(aa[1]);if(ai){ap=aa[0];break}}if(!ai){ap=F}}am=ap.length>=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y<W.length;++Y){ae(W[Y])}if(ag===(ag|0)){W[0].setAttribute("value",ag)}var aa=ac.createElement("OL");aa.className="linenums";var X=Math.max(0,((ag-1))|0)||0;for(var Y=0,T=W.length;Y<T;++Y){af=W[Y];af.className="L"+((Y+X)%10);if(!af.firstChild){af.appendChild(ac.createTextNode("\xA0"))}aa.appendChild(af)}V.appendChild(aa)}function D(ac){var aj=/\bMSIE\b/.test(navigator.userAgent);var am=/\n/g;var al=ac.sourceCode;var an=al.length;var V=0;var aa=ac.spans;var T=aa.length;var ah=0;var X=ac.decorations;var Y=X.length;var Z=0;X[Y]=an;var ar,aq;for(aq=ar=0;aq<Y;){if(X[aq]!==X[aq+2]){X[ar++]=X[aq++];X[ar++]=X[aq++]}else{aq+=2}}Y=ar;for(aq=ar=0;aq<Y;){var at=X[aq];var ab=X[aq+1];var W=aq+2;while(W+2<=Y&&X[W+1]===ab){W+=2}X[ar++]=at;X[ar++]=ab;aq=W}Y=X.length=ar;var ae=null;while(ah<T){var af=aa[ah];var S=aa[ah+2]||an;var ag=X[Z];var ap=X[Z+2]||an;var W=Math.min(S,ap);var ak=aa[ah+1];var U;if(ak.nodeType!==1&&(U=al.substring(V,W))){if(aj){U=U.replace(am,"\r")}ak.nodeValue=U;var ai=ak.ownerDocument;var ao=ai.createElement("SPAN");ao.className=X[Z+1];var ad=ak.parentNode;ad.replaceChild(ao,ak);ao.appendChild(ak);if(V<S){aa[ah+1]=ak=ai.createTextNode(al.substring(W,S));ad.insertBefore(ak,ao.nextSibling)}}V=W;if(V>=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*</.test(S)?"default-markup":"default-code"}return t[T]}c(K,["default-code"]);c(g([],[[F,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa<ac.length;++aa){for(var Z=0,V=ac[aa].length;Z<V;++Z){T.push(ac[aa][Z])}}ac=null;var W=Date;if(!W.now){W={now:function(){return +(new Date)}}}var X=0;var S;var ab=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ae=/\bprettyprint\b/;function U(){var ag=(window.PR_SHOULD_USE_CONTINUATION?W.now()+250:Infinity);for(;X<T.length&&W.now()<ag;X++){var aj=T[X];var ai=aj.className;if(ai.indexOf("prettyprint")>=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X<T.length){setTimeout(U,250)}else{if(ad){ad()}}}U()}window.prettyPrintOne=y;window.prettyPrint=b;window.PR={createSimpleLexer:g,registerLangHandler:c,sourceDecorator:i,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:n,PR_COMMENT:j,PR_DECLARATION:E,PR_KEYWORD:z,PR_LITERAL:G,PR_NOCODE:N,PR_PLAIN:F,PR_PUNCTUATION:L,PR_SOURCE:J,PR_STRING:C,PR_TAG:m,PR_TYPE:O}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
2   -egisterLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
  1 +window.PR_SHOULD_USE_CONTINUATION=true;var prettyPrintOne;var prettyPrint;(function(){var O=window;var j=["break,continue,do,else,for,if,return,while"];var v=[j,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var q=[v,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var m=[q,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var y=[q,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var T=[y,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"];var s="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes";var x=[q,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var t="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var J=[j,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var g=[j,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var I=[j,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var B=[m,T,x,t+J,g,I];var f=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;var D="str";var A="kwd";var k="com";var Q="typ";var H="lit";var M="pun";var G="pln";var n="tag";var F="dec";var K="src";var R="atn";var o="atv";var P="nocode";var N="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function l(ab){var af=0;var U=false;var ae=false;for(var X=0,W=ab.length;X<W;++X){var ag=ab[X];if(ag.ignoreCase){ae=true}else{if(/[a-z]/i.test(ag.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){U=true;ae=false;break}}}var aa={b:8,t:9,n:10,v:11,f:12,r:13};function ad(aj){var ai=aj.charCodeAt(0);if(ai!==92){return ai}var ah=aj.charAt(1);ai=aa[ah];if(ai){return ai}else{if("0"<=ah&&ah<="7"){return parseInt(aj.substring(1),8)}else{if(ah==="u"||ah==="x"){return parseInt(aj.substring(2),16)}else{return aj.charCodeAt(1)}}}}function V(ah){if(ah<32){return(ah<16?"\\x0":"\\x")+ah.toString(16)}var ai=String.fromCharCode(ah);return(ai==="\\"||ai==="-"||ai==="]"||ai==="^")?"\\"+ai:ai}function Z(an){var ar=an.substring(1,an.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ah=[];var ap=ar[0]==="^";var ao=["["];if(ap){ao.push("^")}for(var at=ap?1:0,al=ar.length;at<al;++at){var aj=ar[at];if(/\\[bdsw]/i.test(aj)){ao.push(aj)}else{var ai=ad(aj);var am;if(at+2<al&&"-"===ar[at+1]){am=ad(ar[at+2]);at+=2}else{am=ai}ah.push([ai,am]);if(!(am<65||ai>122)){if(!(am<65||ai>90)){ah.push([Math.max(65,ai)|32,Math.min(am,90)|32])}if(!(am<97||ai>122)){ah.push([Math.max(97,ai)&~32,Math.min(am,122)&~32])}}}}ah.sort(function(aw,av){return(aw[0]-av[0])||(av[1]-aw[1])});var ak=[];var aq=[];for(var at=0;at<ah.length;++at){var au=ah[at];if(au[0]<=aq[1]+1){aq[1]=Math.max(aq[1],au[1])}else{ak.push(aq=au)}}for(var at=0;at<ak.length;++at){var au=ak[at];ao.push(V(au[0]));if(au[1]>au[0]){if(au[1]+1>au[0]){ao.push("-")}ao.push(V(au[1]))}}ao.push("]");return ao.join("")}function Y(an){var al=an.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var aj=al.length;var ap=[];for(var am=0,ao=0;am<aj;++am){var ai=al[am];if(ai==="("){++ao}else{if("\\"===ai.charAt(0)){var ah=+ai.substring(1);if(ah){if(ah<=ao){ap[ah]=-1}else{al[am]=V(ah)}}}}}for(var am=1;am<ap.length;++am){if(-1===ap[am]){ap[am]=++af}}for(var am=0,ao=0;am<aj;++am){var ai=al[am];if(ai==="("){++ao;if(!ap[ao]){al[am]="(?:"}}else{if("\\"===ai.charAt(0)){var ah=+ai.substring(1);if(ah&&ah<=ao){al[am]="\\"+ap[ah]}}}}for(var am=0;am<aj;++am){if("^"===al[am]&&"^"!==al[am+1]){al[am]=""}}if(an.ignoreCase&&U){for(var am=0;am<aj;++am){var ai=al[am];var ak=ai.charAt(0);if(ai.length>=2&&ak==="["){al[am]=Z(ai)}else{if(ak!=="\\"){al[am]=ai.replace(/[a-zA-Z]/g,function(aq){var ar=aq.charCodeAt(0);return"["+String.fromCharCode(ar&~32,ar|32)+"]"})}}}}return al.join("")}var ac=[];for(var X=0,W=ab.length;X<W;++X){var ag=ab[X];if(ag.global||ag.multiline){throw new Error(""+ag)}ac.push("(?:"+Y(ag)+")")}return new RegExp(ac.join("|"),ae?"gi":"g")}function b(aa,Y){var W=/(?:^|\s)nocode(?:\s|$)/;var ab=[];var Z=0;var X=[];var V=0;function U(ac){switch(ac.nodeType){case 1:if(W.test(ac.className)){return}for(var af=ac.firstChild;af;af=af.nextSibling){U(af)}var ae=ac.nodeName.toLowerCase();if("br"===ae||"li"===ae){ab[V]="\n";X[V<<1]=Z++;X[(V++<<1)|1]=ac}break;case 3:case 4:var ad=ac.nodeValue;if(ad.length){if(!Y){ad=ad.replace(/[ \t\r\n]+/g," ")}else{ad=ad.replace(/\r\n?/g,"\n")}ab[V]=ad;X[V<<1]=Z;Z+=ad.length;X[(V++<<1)|1]=ac}break}}U(aa);return{sourceCode:ab.join("").replace(/\n$/,""),spans:X}}function C(U,W,Y,V){if(!W){return}var X={sourceCode:W,basePos:U};Y(X);V.push.apply(V,X.decorations)}var w=/\S/;function p(U){var X=undefined;for(var W=U.firstChild;W;W=W.nextSibling){var V=W.nodeType;X=(V===1)?(X?U:W):(V===3)?(w.test(W.nodeValue)?U:X):X}return X===U?undefined:X}function h(W,V){var U={};var X;(function(){var af=W.concat(V);var aj=[];var ai={};for(var ad=0,ab=af.length;ad<ab;++ad){var aa=af[ad];var ae=aa[3];if(ae){for(var ag=ae.length;--ag>=0;){U[ae.charAt(ag)]=aa}}var ah=aa[1];var ac=""+ah;if(!ai.hasOwnProperty(ac)){aj.push(ah);ai[ac]=null}}aj.push(/[\0-\uffff]/);X=l(aj)})();var Z=V.length;var Y=function(aj){var ab=aj.sourceCode,aa=aj.basePos;var af=[aa,G];var ah=0;var ap=ab.match(X)||[];var al={};for(var ag=0,at=ap.length;ag<at;++ag){var ai=ap[ag];var ar=al[ai];var ak=void 0;var ao;if(typeof ar==="string"){ao=false}else{var ac=U[ai.charAt(0)];if(ac){ak=ai.match(ac[1]);ar=ac[0]}else{for(var aq=0;aq<Z;++aq){ac=V[aq];ak=ai.match(ac[1]);if(ak){ar=ac[0];break}}if(!ak){ar=G}}ao=ar.length>=5&&"lang-"===ar.substring(0,5);if(ao&&!(ak&&typeof ak[1]==="string")){ao=false;ar=K}if(!ao){al[ai]=ar}}var ad=ah;ah+=ai.length;if(!ao){af.push(aa+ad,ar)}else{var an=ak[1];var am=ai.indexOf(an);var ae=am+an.length;if(ak[2]){ae=ai.length-ak[2].length;am=ae-an.length}var au=ar.substring(5);C(aa+ad,ai.substring(0,am),Y,af);C(aa+ad+am,an,r(au,an),af);C(aa+ad+ae,ai.substring(ae),Y,af)}}aj.decorations=af};return Y}function i(V){var Y=[],U=[];if(V.tripleQuotedStrings){Y.push([D,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(V.multiLineStrings){Y.push([D,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{Y.push([D,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(V.verbatimStrings){U.push([D,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var ab=V.hashComments;if(ab){if(V.cStyleComments){if(ab>1){Y.push([k,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{Y.push([k,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}U.push([D,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])}else{Y.push([k,/^#[^\r\n]*/,null,"#"])}}if(V.cStyleComments){U.push([k,/^\/\/[^\r\n]*/,null]);U.push([k,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(V.regexLiterals){var aa=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");U.push(["lang-regex",new RegExp("^"+N+"("+aa+")")])}var X=V.types;if(X){U.push([Q,X])}var W=(""+V.keywords).replace(/^ | $/g,"");if(W.length){U.push([A,new RegExp("^(?:"+W.replace(/[\s,]+/g,"|")+")\\b"),null])}Y.push([G,/^\s+/,null," \r\n\t\xA0"]);var Z=/^.[^\s\w\.$@\'\"\`\/\\]*/;U.push([H,/^@[a-z_$][a-z_$@0-9]*/i,null],[Q,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[G,/^[a-z_$][a-z_$@0-9]*/i,null],[H,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[G,/^\\[\s\S]?/,null],[M,Z,null]);return h(Y,U)}var L=i({keywords:B,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function S(W,ah,aa){var V=/(?:^|\s)nocode(?:\s|$)/;var ac=/\r\n?|\n/;var ad=W.ownerDocument;var ag=ad.createElement("li");while(W.firstChild){ag.appendChild(W.firstChild)}var X=[ag];function af(am){switch(am.nodeType){case 1:if(V.test(am.className)){break}if("br"===am.nodeName){ae(am);if(am.parentNode){am.parentNode.removeChild(am)}}else{for(var ao=am.firstChild;ao;ao=ao.nextSibling){af(ao)}}break;case 3:case 4:if(aa){var an=am.nodeValue;var ak=an.match(ac);if(ak){var aj=an.substring(0,ak.index);am.nodeValue=aj;var ai=an.substring(ak.index+ak[0].length);if(ai){var al=am.parentNode;al.insertBefore(ad.createTextNode(ai),am.nextSibling)}ae(am);if(!aj){am.parentNode.removeChild(am)}}}break}}function ae(al){while(!al.nextSibling){al=al.parentNode;if(!al){return}}function aj(am,at){var ar=at?am.cloneNode(false):am;var ap=am.parentNode;if(ap){var aq=aj(ap,1);var ao=am.nextSibling;aq.appendChild(ar);for(var an=ao;an;an=ao){ao=an.nextSibling;aq.appendChild(an)}}return ar}var ai=aj(al.nextSibling,0);for(var ak;(ak=ai.parentNode)&&ak.nodeType===1;){ai=ak}X.push(ai)}for(var Z=0;Z<X.length;++Z){af(X[Z])}if(ah===(ah|0)){X[0].setAttribute("value",ah)}var ab=ad.createElement("ol");ab.className="linenums";var Y=Math.max(0,((ah-1))|0)||0;for(var Z=0,U=X.length;Z<U;++Z){ag=X[Z];ag.className="L"+((Z+Y)%10);if(!ag.firstChild){ag.appendChild(ad.createTextNode("\xA0"))}ab.appendChild(ag)}W.appendChild(ab)}function E(af){var X=/\bMSIE\s(\d+)/.exec(navigator.userAgent);X=X&&+X[1]<=8;var ao=/\n/g;var an=af.sourceCode;var ap=an.length;var Y=0;var ad=af.spans;var V=ad.length;var aj=0;var aa=af.decorations;var ab=aa.length;var ac=0;aa[ab]=ap;var av,at;for(at=av=0;at<ab;){if(aa[at]!==aa[at+2]){aa[av++]=aa[at++];aa[av++]=aa[at++]}else{at+=2}}ab=av;for(at=av=0;at<ab;){var aw=aa[at];var ae=aa[at+1];var Z=at+2;while(Z+2<=ab&&aa[Z+1]===ae){Z+=2}aa[av++]=aw;aa[av++]=ae;at=Z}ab=aa.length=av;var au=af.sourceNode;var ak;if(au){ak=au.style.display;au.style.display="none"}try{var ah=null;while(aj<V){var ai=ad[aj];var U=ad[aj+2]||ap;var ar=aa[ac+2]||ap;var Z=Math.min(U,ar);var am=ad[aj+1];var W;if(am.nodeType!==1&&(W=an.substring(Y,Z))){if(X){W=W.replace(ao,"\r")}am.nodeValue=W;var al=am.ownerDocument;var aq=al.createElement("span");aq.className=aa[ac+1];var ag=am.parentNode;ag.replaceChild(aq,am);aq.appendChild(am);if(Y<U){ad[aj+1]=am=al.createTextNode(an.substring(Z,U));ag.insertBefore(am,aq.nextSibling)}}Y=Z;if(Y>=U){aj+=2}if(Y>=ar){ac+=2}}}finally{if(au){au.style.display=ak}}}var u={};function d(W,X){for(var U=X.length;--U>=0;){var V=X[U];if(!u.hasOwnProperty(V)){u[V]=W}else{if(O.console){console.warn("cannot override language handler %s",V)}}}}function r(V,U){if(!(V&&u.hasOwnProperty(V))){V=/^\s*</.test(U)?"default-markup":"default-code"}return u[V]}d(L,["default-code"]);d(h([],[[G,/^[^<?]+/],[F,/^<!\w[^>]*(?:>|$)/],[k,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[M,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);d(h([[G,/^[\s]+/,null," \t\r\n"],[o,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[n,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[R,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[M,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);d(h([],[[o,/^[\s\S]+/]]),["uq.val"]);d(i({keywords:m,hashComments:true,cStyleComments:true,types:f}),["c","cc","cpp","cxx","cyc","m"]);d(i({keywords:"null,true,false"}),["json"]);d(i({keywords:T,hashComments:true,cStyleComments:true,verbatimStrings:true,types:f}),["cs"]);d(i({keywords:y,cStyleComments:true}),["java"]);d(i({keywords:I,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);d(i({keywords:J,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);d(i({keywords:t,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);d(i({keywords:g,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);d(i({keywords:x,cStyleComments:true,regexLiterals:true}),["js"]);d(i({keywords:s,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);d(h([],[[D,/^[\s\S]+/]]),["regex"]);function e(X){var W=X.langExtension;try{var U=b(X.sourceNode,X.pre);var V=U.sourceCode;X.sourceCode=V;X.spans=U.spans;X.basePos=0;r(W,V)(X);E(X)}catch(Y){if(O.console){console.log(Y&&Y.stack?Y.stack:Y)}}}function z(Y,X,W){var U=document.createElement("pre");U.innerHTML=Y;if(W){S(U,W,true)}var V={langExtension:X,numberLines:W,sourceNode:U,pre:1};e(V);return U.innerHTML}function c(aj){function ab(al){return document.getElementsByTagName(al)}var ah=[ab("pre"),ab("code"),ab("xmp")];var V=[];for(var ae=0;ae<ah.length;++ae){for(var ac=0,Y=ah[ae].length;ac<Y;++ac){V.push(ah[ae][ac])}}ah=null;var Z=Date;if(!Z.now){Z={now:function(){return +(new Date)}}}var aa=0;var U;var af=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ak=/\bprettyprint\b/;var W=/\bprettyprinted\b/;var ag=/pre|xmp/i;var ai=/^code$/i;var ad=/^(?:pre|code|xmp)$/i;function X(){var ar=(O.PR_SHOULD_USE_CONTINUATION?Z.now()+250:Infinity);for(;aa<V.length&&Z.now()<ar;aa++){var at=V[aa];var au=at.className;if(ak.test(au)&&!W.test(au)){var aw=false;for(var ao=at.parentNode;ao;ao=ao.parentNode){var ax=ao.tagName;if(ad.test(ax)&&ao.className&&ak.test(ao.className)){aw=true;break}}if(!aw){at.className+=" prettyprinted";var aq=au.match(af);var am;if(!aq&&(am=p(at))&&ai.test(am.tagName)){aq=am.className.match(af)}if(aq){aq=aq[1]}var ap;if(ag.test(at.tagName)){ap=1}else{var an=at.currentStyle;var al=(an?an.whiteSpace:(document.defaultView&&document.defaultView.getComputedStyle)?document.defaultView.getComputedStyle(at,null).getPropertyValue("white-space"):0);ap=al&&"pre"===al.substring(0,3)}var av=at.className.match(/\blinenums\b(?::(\d+))?/);av=av?av[1]&&av[1].length?+av[1]:true:false;if(av){S(at,av,ap)}U={langExtension:aq,sourceNode:at,numberLines:av,pre:ap};e(U)}}}if(aa<V.length){setTimeout(X,250)}else{if(aj){aj()}}}X()}var a=O.PR={createSimpleLexer:h,registerLangHandler:d,sourceDecorator:i,PR_ATTRIB_NAME:R,PR_ATTRIB_VALUE:o,PR_COMMENT:k,PR_DECLARATION:F,PR_KEYWORD:A,PR_LITERAL:H,PR_NOCODE:P,PR_PLAIN:G,PR_PUNCTUATION:M,PR_SOURCE:K,PR_STRING:D,PR_TAG:n,PR_TYPE:Q,prettyPrintOne:O.prettyPrintOne=z,prettyPrint:O.prettyPrint=c};if(typeof define==="function"&&define.amd){define("google-code-prettify",[],function(){return a})}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
597 output/assets/vendor/prettify/prettify.js
@@ -56,7 +56,7 @@
56 56 */
57 57
58 58 // JSLint declarations
59   -/*global console, document, navigator, setTimeout, window */
  59 +/*global console, document, navigator, setTimeout, window, define */
60 60
61 61 /**
62 62 * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
@@ -65,12 +65,30 @@
65 65 */
66 66 window['PR_SHOULD_USE_CONTINUATION'] = true;
67 67
  68 +/**
  69 + * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
  70 + * {@code class=prettyprint} and prettify them.
  71 + *
  72 + * @param {Function?} opt_whenDone if specified, called when the last entry
  73 + * has been finished.
  74 + */
  75 +var prettyPrintOne;
  76 +/**
  77 + * Pretty print a chunk of code.
  78 + *
  79 + * @param {string} sourceCodeHtml code as html
  80 + * @return {string} code as html, but prettier
  81 + */
  82 +var prettyPrint;
  83 +
  84 +
68 85 (function () {
  86 + var win = window;
69 87 // Keyword lists for various languages.
70 88 // We use things that coerce to strings to make them compact when minified
71 89 // and to defeat aggressive optimizers that fold large string constants.
72 90 var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
73   - var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
  91 + var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
74 92 "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
75 93 "static,struct,switch,typedef,union,unsigned,void,volatile"];
76 94 var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
@@ -86,12 +104,13 @@ window['PR_SHOULD_USE_CONTINUATION'] = true;
86 104 "transient"];
87 105 var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
88 106 "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
89   - "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
90   - "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
91   - "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
  107 + "fixed,foreach,from,group,implicit,in,interface,internal,into,is,let," +
  108 + "lock,object,out,override,orderby,params,partial,readonly,ref,sbyte," +
  109 + "sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort," +
  110 + "var,virtual,where"];
92 111 var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
93 112 "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
94   - "true,try,unless,until,when,while,yes";
  113 + "throw,true,try,unless,until,when,while,yes";
95 114 var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
96 115 "debugger,eval,export,function,get,null,set,undefined,var,with," +
97 116 "Infinity,NaN"];
@@ -111,7 +130,7 @@ window['PR_SHOULD_USE_CONTINUATION'] = true;
111 130 var ALL_KEYWORDS = [
112 131 CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
113 132 PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
114   - var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
  133 + var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;
115 134
116 135 // token style names. correspond to css classes
117 136 /**
@@ -145,7 +164,7 @@ window['PR_SHOULD_USE_CONTINUATION'] = true;
145 164 */
146 165 var PR_PUNCTUATION = 'pun';
147 166 /**
148   - * token style for a punctuation string.
  167 + * token style for plain text.
149 168 * @const
150 169 */
151 170 var PR_PLAIN = 'pln';
@@ -197,14 +216,14 @@ window['PR_SHOULD_USE_CONTINUATION'] = true;
197 216 * "in" keyword since it's not a keyword in many languages, and might be used
198 217 * as a count of inches.
199 218 *
200   - * <p>The link a above does not accurately describe EcmaScript rules since
  219 + * <p>The link above does not accurately describe EcmaScript rules since
201 220 * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
202 221 * very well in practice.
203 222 *
204 223 * @private
205 224 * @const
206 225 */
207   -var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
  226 +var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
208 227
209 228 // CAVEAT: this does not properly handle the case where a regular
210 229 // expression immediately follows another since a regular expression may
@@ -223,7 +242,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
223 242 */
224 243 function combinePrefixPatterns(regexs) {
225 244 var capturedGroupIndex = 0;
226   -
  245 +
227 246 var needToFoldCase = false;
228 247 var ignoreCase = false;
229 248 for (var i = 0, n = regexs.length; i < n; ++i) {
@@ -237,7 +256,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
237 256 break;
238 257 }
239 258 }
240   -
  259 +
241 260 var escapeCharToCodeUnit = {
242 261 'b': 8,
243 262 't': 9,
@@ -246,7 +265,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
246 265 'f': 0xc,
247 266 'r': 0xd
248 267 };
249   -
  268 +
250 269 function decodeEscape(charsetPart) {
251 270 var cc0 = charsetPart.charCodeAt(0);
252 271 if (cc0 !== 92 /* \\ */) {
@@ -264,18 +283,16 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
264 283 return charsetPart.charCodeAt(1);
265 284 }
266 285 }
267   -
  286 +
268 287 function encodeEscape(charCode) {
269 288 if (charCode < 0x20) {
270 289 return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
271 290 }
272 291 var ch = String.fromCharCode(charCode);
273   - if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
274   - ch = '\\' + ch;
275   - }
276   - return ch;
  292 + return (ch === '\\' || ch === '-' || ch === ']' || ch === '^')
  293 + ? "\\" + ch : ch;
277 294 }
278   -
  295 +
279 296 function caseFoldCharset(charSet) {
280 297 var charsetParts = charSet.substring(1, charSet.length - 1).match(
281 298 new RegExp(
@@ -287,13 +304,16 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
287 304 + '|-'
288 305 + '|[^-\\\\]',
289 306 'g'));
290   - var groups = [];
291 307 var ranges = [];
292 308 var inverse = charsetParts[0] === '^';
  309 +
  310 + var out = ['['];
  311 + if (inverse) { out.push('^'); }
  312 +
293 313 for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
294 314 var p = charsetParts[i];
295 315 if (/\\[bdsw]/i.test(p)) { // Don't muck with named groups.
296   - groups.push(p);
  316 + out.push(p);
297 317 } else {
298 318 var start = decodeEscape(p);
299 319 var end;
@@ -318,12 +338,12 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
318 338 }
319 339 }
320 340 }
321   -
  341 +
322 342 // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
323 343 // -> [[1, 12], [14, 14], [16, 17]]
324 344 ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
325 345 var consolidatedRanges = [];
326   - var lastRange = [NaN, NaN];
  346 + var lastRange = [];
327 347 for (var i = 0; i < ranges.length; ++i) {
328 348 var range = ranges[i];
329 349 if (range[0] <= lastRange[1] + 1) {
@@ -332,10 +352,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
332 352 consolidatedRanges.push(lastRange = range);
333 353 }
334 354 }
335   -
336   - var out = ['['];
337   - if (inverse) { out.push('^'); }
338   - out.push.apply(out, groups);
  355 +
339 356 for (var i = 0; i < consolidatedRanges.length; ++i) {
340 357 var range = consolidatedRanges[i];
341 358 out.push(encodeEscape(range[0]));
@@ -347,7 +364,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
347 364 out.push(']');
348 365 return out.join('');
349 366 }
350   -
  367 +
351 368 function allowAnywhereFoldCaseAndRenumberGroups(regex) {
352 369 // Split into character sets, escape sequences, punctuation strings
353 370 // like ('(', '(?:', ')', '^'), and runs of characters that do not
@@ -361,17 +378,17 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
361 378 + '|\\\\[0-9]+' // a back-reference or octal escape
362 379 + '|\\\\[^ux0-9]' // other escape sequence
363 380 + '|\\(\\?[:!=]' // start of a non-capturing group
364   - + '|[\\(\\)\\^]' // start/emd of a group, or line start
  381 + + '|[\\(\\)\\^]' // start/end of a group, or line start
365 382 + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
366 383 + ')',
367 384 'g'));
368 385 var n = parts.length;
369   -
  386 +
370 387 // Maps captured group numbers to the number they will occupy in
371 388 // the output or to -1 if that has not been determined, or to
372 389 // undefined if they need not be capturing in the output.
373 390 var capturedGroups = [];
374   -
  391 +
375 392 // Walk over and identify back references to build the capturedGroups
376 393 // mapping.
377 394 for (var i = 0, groupIndex = 0; i < n; ++i) {
@@ -381,12 +398,19 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
381 398 ++groupIndex;
382 399 } else if ('\\' === p.charAt(0)) {
383 400 var decimalValue = +p.substring(1);
384   - if (decimalValue && decimalValue <= groupIndex) {
385   - capturedGroups[decimalValue] = -1;
  401 + if (decimalValue) {
  402 + if (decimalValue <= groupIndex) {
  403 + capturedGroups[decimalValue] = -1;
  404 + } else {
  405 + // Replace with an unambiguous escape sequence so that
  406 + // an octal escape sequence does not turn into a backreference
  407 + // to a capturing group from an earlier regex.
  408 + parts[i] = encodeEscape(decimalValue);
  409 + }
386 410 }
387 411 }
388 412 }
389   -
  413 +
390 414 // Renumber groups and reduce capturing groups to non-capturing groups
391 415 // where possible.
392 416 for (var i = 1; i < capturedGroups.length; ++i) {
@@ -398,23 +422,23 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
398 422 var p = parts[i];
399 423 if (p === '(') {
400 424 ++groupIndex;
401   - if (capturedGroups[groupIndex] === undefined) {
  425 + if (!capturedGroups[groupIndex]) {
402 426 parts[i] = '(?:';
403 427 }
404 428 } else if ('\\' === p.charAt(0)) {
405 429 var decimalValue = +p.substring(1);
406 430 if (decimalValue && decimalValue <= groupIndex) {
407   - parts[i] = '\\' + capturedGroups[groupIndex];
  431 + parts[i] = '\\' + capturedGroups[decimalValue];
408 432 }
409 433 }
410 434 }
411   -
  435 +
412 436 // Remove any prefix anchors so that the output will match anywhere.
413 437 // ^^ really does mean an anchored match though.
414   - for (var i = 0, groupIndex = 0; i < n; ++i) {
  438 + for (var i = 0; i < n; ++i) {
415 439 if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
416 440 }
417   -
  441 +
418 442 // Expand letters to groups to handle mixing of case-sensitive and
419 443 // case-insensitive patterns if necessary.
420 444 if (regex.ignoreCase && needToFoldCase) {
@@ -434,10 +458,10 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
434 458 }
435 459 }
436 460 }
437   -
  461 +
438 462 return parts.join('');
439 463 }
440   -
  464 +
441 465 var rewritten = [];
442 466 for (var i = 0, n = regexs.length; i < n; ++i) {
443 467 var regex = regexs[i];
@@ -445,7 +469,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
445 469 rewritten.push(
446 470 '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
447 471 }
448   -
  472 +
449 473 return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
450 474 }
451 475
@@ -473,8 +497,8 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
473 497 * <pre>
474 498 * {
475 499 * sourceCode: "print 'Hello '\n + 'World';",
476   - * // 1 2
477   - * // 012345678901234 5678901234567
  500 + * // 1 2
  501 + * // 012345678901234 5678901234567
478 502 * spans: [0, #1, 6, #2, 14, #3, 15, #4]
479 503 * }
480 504 * </pre>
@@ -491,25 +515,18 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
491 515 * </p>
492 516 *
493 517 * @param {Node} node an HTML DOM subtree containing source-code.
  518 + * @param {boolean} isPreformatted true if white-space in text nodes should
  519 + * be considered significant.
494 520 * @return {Object} source code and the text nodes in which they occur.
495 521 */
496   - function extractSourceSpans(node) {
  522 + function extractSourceSpans(node, isPreformatted) {
497 523 var nocode = /(?:^|\s)nocode(?:\s|$)/;
498   -
  524 +
499 525 var chunks = [];
500 526 var length = 0;
501 527 var spans = [];
502 528 var k = 0;
503   -
504   - var whitespace;
505   - if (node.currentStyle) {
506   - whitespace = node.currentStyle.whiteSpace;
507   - } else if (window.getComputedStyle) {
508   - whitespace = document.defaultView.getComputedStyle(node, null)
509   - .getPropertyValue('white-space');
510   - }
511   - var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
512   -
  529 +
513 530 function walk(node) {
514 531 switch (node.nodeType) {
515 532 case 1: // Element
@@ -517,8 +534,8 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
517 534 for (var child = node.firstChild; child; child = child.nextSibling) {
518 535 walk(child);
519 536 }
520   - var nodeName = node.nodeName;
521   - if ('BR' === nodeName || 'LI' === nodeName) {
  537 + var nodeName = node.nodeName.toLowerCase();
  538 + if ('br' === nodeName || 'li' === nodeName) {
522 539 chunks[k] = '\n';
523 540 spans[k << 1] = length++;
524 541 spans[(k++ << 1) | 1] = node;
@@ -541,9 +558,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
541 558 break;
542 559 }
543 560 }
544   -
  561 +
545 562 walk(node);
546   -
  563 +
547 564 return {
548 565 sourceCode: chunks.join('').replace(/\n$/, ''),
549 566 spans: spans
@@ -815,12 +832,13 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
815 832 } else {
816 833 // Stop C preprocessor declarations at an unclosed open comment
817 834 shortcutStylePatterns.push(
818   - [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
  835 + [PR_COMMENT, /^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,
819 836 null, '#']);
820 837 }
  838 + // #include <stdio.h>
821 839 fallthroughStylePatterns.push(
822 840 [PR_STRING,
823   - /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
  841 + /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,
824 842 null]);
825 843 } else {
826 844 shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
@@ -868,6 +886,45 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
868 886 }
869 887
870 888 shortcutStylePatterns.push([PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0']);
  889 +
  890 + var punctuation =
  891 + // The Bash man page says
  892 +
  893 + // A word is a sequence of characters considered as a single
  894 + // unit by GRUB. Words are separated by metacharacters,
  895 + // which are the following plus space, tab, and newline: { }
  896 + // | & $ ; < >
  897 + // ...
  898 +
  899 + // A word beginning with # causes that word and all remaining
  900 + // characters on that line to be ignored.
  901 +
  902 + // which means that only a '#' after /(?:^|[{}|&$;<>\s])/ starts a
  903 + // comment but empirically
  904 + // $ echo {#}
  905 + // {#}
  906 + // $ echo \$#
  907 + // $#
  908 + // $ echo }#
  909 + // }#
  910 +
  911 + // so /(?:^|[|&;<>\s])/ is more appropriate.
  912 +
  913 + // http://gcc.gnu.org/onlinedocs/gcc-2.95.3/cpp_1.html#SEC3
  914 + // suggests that this definition is compatible with a
  915 + // default mode that tries to use a single token definition
  916 + // to recognize both bash/python style comments and C
  917 + // preprocessor directives.
  918 +
  919 + // This definition of punctuation does not include # in the list of
  920 + // follow-on exclusions, so # will not be broken before if preceeded
  921 + // by a punctuation character. We could try to exclude # after
  922 + // [|&;<>] but that doesn't seem to cause many major problems.
  923 + // If that does turn out to be a problem, we should change the below
  924 + // when hc is truthy to include # in the run of punctuation characters
  925 + // only when not followint [|&;<>].
  926 + /^.[^\s\w\.$@\'\"\`\/\\]*/;
  927 +
871 928 fallthroughStylePatterns.push(
872 929 // TODO(mikesamuel): recognize non-latin letters and numerals in idents
873 930 [PR_LITERAL, /^@[a-z_$][a-z_$@0-9]*/i, null],
@@ -888,7 +945,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
888 945 null, '0123456789'],
889 946 // Don't treat escaped quotes in bash as starting strings. See issue 144.
890 947 [PR_PLAIN, /^\\[\s\S]?/, null],
891   - [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
  948 + [PR_PUNCTUATION, punctuation, null]);
892 949
893 950 return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
894 951 }
@@ -909,37 +966,28 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
909 966 * HTMLOListElement, and each line is moved into a separate list item.
910 967 * This requires cloning elements, so the input might not have unique
911 968 * IDs after numbering.
  969 + * @param {boolean} isPreformatted true iff white-space in text nodes should
  970 + * be treated as significant.
912 971 */
913   - function numberLines(node, opt_startLineNum) {
  972 + function numberLines(node, opt_startLineNum, isPreformatted) {
914 973 var nocode = /(?:^|\s)nocode(?:\s|$)/;
915 974 var lineBreak = /\r\n?|\n/;
916   -
  975 +
917 976 var document = node.ownerDocument;
918   -
919   - var whitespace;
920   - if (node.currentStyle) {
921   - whitespace = node.currentStyle.whiteSpace;
922   - } else if (window.getComputedStyle) {
923   - whitespace = document.defaultView.getComputedStyle(node, null)
924   - .getPropertyValue('white-space');
925   - }
926   - // If it's preformatted, then we need to split lines on line breaks
927   - // in addition to <BR>s.
928   - var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
929   -
930   - var li = document.createElement('LI');
  977 +
  978 + var li = document.createElement('li');
931 979 while (node.firstChild) {
932 980 li.appendChild(node.firstChild);
933 981 }
934 982 // An array of lines. We split below, so this is initialized to one
935 983 // un-split line.
936 984 var listItems = [li];
937   -
  985 +
938 986 function walk(node) {
939 987 switch (node.nodeType) {
940 988 case 1: // Element
941 989 if (nocode.test(node.className)) { break; }
942   - if ('BR' === node.nodeName) {
  990 + if ('br' === node.nodeName) {
943 991 breakAfter(node);
944 992 // Discard the <BR> since it is now flush against a </LI>.
945 993 if (node.parentNode) {
@@ -974,7 +1022,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
974 1022 break;
975 1023 }
976 1024 }
977   -
  1025 +
978 1026 // Split a line after the given node.
979 1027 function breakAfter(lineEndNode) {
980 1028 // If there's nothing to the right, then we can skip ending the line
@@ -984,7 +1032,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
984 1032 lineEndNode = lineEndNode.parentNode;
985 1033 if (!lineEndNode) { return; }
986 1034 }
987   -
  1035 +
988 1036 function breakLeftOf(limit, copy) {
989 1037 // Clone shallowly if this node needs to be on both sides of the break.
990 1038 var rightSide = copy ? limit.cloneNode(false) : limit;
@@ -1006,9 +1054,9 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1006 1054 }
1007 1055 return rightSide;
1008 1056 }
1009   -
  1057 +
1010 1058 var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
1011   -
  1059 +
1012 1060 // Walk the parent chain until we reach an unattached LI.
1013 1061 for (var parent;
1014 1062 // Check nodeType since IE invents document fragments.
@@ -1018,20 +1066,20 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1018 1066 // Put it on the list of lines for later processing.
1019 1067 listItems.push(copiedListItem);
1020 1068 }
1021   -
  1069 +
1022 1070 // Split lines while there are lines left to split.
1023 1071 for (var i = 0; // Number of lines that have been split so far.
1024 1072 i < listItems.length; // length updated by breakAfter calls.
1025 1073 ++i) {
1026 1074 walk(listItems[i]);
1027 1075 }
1028   -
  1076 +
1029 1077 // Make sure numeric indices show correctly.
1030 1078 if (opt_startLineNum === (opt_startLineNum|0)) {
1031 1079 listItems[0].setAttribute('value', opt_startLineNum);
1032 1080 }
1033   -
1034   - var ol = document.createElement('OL');
  1081 +
  1082 + var ol = document.createElement('ol');
1035 1083 ol.className = 'linenums';
1036 1084 var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
1037 1085 for (var i = 0, n = listItems.length; i < n; ++i) {
@@ -1045,7 +1093,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1045 1093 }
1046 1094 ol.appendChild(li);
1047 1095 }
1048   -
  1096 +
1049 1097 node.appendChild(ol);
1050 1098 }
1051 1099
@@ -1063,25 +1111,26 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1063 1111 * @private
1064 1112 */
1065 1113 function recombineTagsAndDecorations(job) {
1066   - var isIE = /\bMSIE\b/.test(navigator.userAgent);
  1114 + var isIE8OrEarlier = /\bMSIE\s(\d+)/.exec(navigator.userAgent);
  1115 + isIE8OrEarlier = isIE8OrEarlier && +isIE8OrEarlier[1] <= 8;
1067 1116 var newlineRe = /\n/g;
1068   -
  1117 +
1069 1118 var source = job.sourceCode;
1070 1119 var sourceLength = source.length;
1071 1120 // Index into source after the last code-unit recombined.
1072 1121 var sourceIndex = 0;
1073   -
  1122 +
1074 1123 var spans = job.spans;
1075 1124 var nSpans = spans.length;
1076 1125 // Index into spans after the last span which ends at or before sourceIndex.
1077 1126 var spanIndex = 0;
1078   -
  1127 +
1079 1128 var decorations = job.decorations;
1080 1129 var nDecorations = decorations.length;
1081 1130 // Index into decorations after the last decoration which ends at or before
1082 1131 // sourceIndex.
1083 1132 var decorationIndex = 0;
1084   -
  1133 +
1085 1134 // Remove all zero-length decorations.
1086 1135 decorations[nDecorations] = sourceLength;
1087 1136 var decPos, i;
@@ -1094,7 +1143,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1094 1143 }
1095 1144 }
1096 1145 nDecorations = decPos;
1097   -
  1146 +
1098 1147 // Simplify decorations.
1099 1148 for (i = decPos = 0; i < nDecorations;) {
1100 1149 var startPos = decorations[i];
@@ -1108,52 +1157,65 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1108 1157 decorations[decPos++] = startDec;
1109 1158 i = end;
1110 1159 }
1111   -
  1160 +
1112 1161 nDecorations = decorations.length = decPos;
1113   -
1114   - var decoration = null;
1115   - while (spanIndex < nSpans) {
1116   - var spanStart = spans[spanIndex];
1117   - var spanEnd = spans[spanIndex + 2] || sourceLength;
1118   -
1119   - var decStart = decorations[decorationIndex];
1120   - var decEnd = decorations[decorationIndex + 2] || sourceLength;
1121   -
1122   - var end = Math.min(spanEnd, decEnd);
1123   -
1124   - var textNode = spans[spanIndex + 1];
1125   - var styledText;
1126   - if (textNode.nodeType !== 1 // Don't muck with <BR>s or <LI>s
1127   - // Don't introduce spans around empty text nodes.
1128   - && (styledText = source.substring(sourceIndex, end))) {
1129   - // This may seem bizarre, and it is. Emitting LF on IE causes the
1130   - // code to display with spaces instead of line breaks.
1131   - // Emitting Windows standard issue linebreaks (CRLF) causes a blank
1132   - // space to appear at the beginning of every line but the first.
1133   - // Emitting an old Mac OS 9 line separator makes everything spiffy.
1134   - if (isIE) { styledText = styledText.replace(newlineRe, '\r'); }
1135   - textNode.nodeValue = styledText;
1136   - var document = textNode.ownerDocument;
1137   - var span = document.createElement('SPAN');
1138   - span.className = decorations[decorationIndex + 1];
1139   - var parentNode = textNode.parentNode;
1140   - parentNode.replaceChild(span, textNode);
1141   - span.appendChild(textNode);
1142   - if (sourceIndex < spanEnd) { // Split off a text node.
1143   - spans[spanIndex + 1] = textNode
1144   - // TODO: Possibly optimize by using '' if there's no flicker.
1145   - = document.createTextNode(source.substring(end, spanEnd));
1146   - parentNode.insertBefore(textNode, span.nextSibling);
  1162 +
  1163 + var sourceNode = job.sourceNode;
  1164 + var oldDisplay;
  1165 + if (sourceNode) {
  1166 + oldDisplay = sourceNode.style.display;
  1167 + sourceNode.style.display = 'none';
  1168 + }
  1169 + try {
  1170 + var decoration = null;
  1171 + while (spanIndex < nSpans) {
  1172 + var spanStart = spans[spanIndex];
  1173 + var spanEnd = spans[spanIndex + 2] || sourceLength;
  1174 +
  1175 + var decEnd = decorations[decorationIndex + 2] || sourceLength;
  1176 +
  1177 + var end = Math.min(spanEnd, decEnd);
  1178 +
  1179 + var textNode = spans[spanIndex + 1];
  1180 + var styledText;
  1181 + if (textNode.nodeType !== 1 // Don't muck with <BR>s or <LI>s
  1182 + // Don't introduce spans around empty text nodes.
  1183 + && (styledText = source.substring(sourceIndex, end))) {
  1184 + // This may seem bizarre, and it is. Emitting LF on IE causes the
  1185 + // code to display with spaces instead of line breaks.
  1186 + // Emitting Windows standard issue linebreaks (CRLF) causes a blank
  1187 + // space to appear at the beginning of every line but the first.
  1188 + // Emitting an old Mac OS 9 line separator makes everything spiffy.
  1189 + if (isIE8OrEarlier) {
  1190 + styledText = styledText.replace(newlineRe, '\r');
  1191 + }
  1192 + textNode.nodeValue = styledText;
  1193 + var document = textNode.ownerDocument;
  1194 + var span = document.createElement('span');
  1195 + span.className = decorations[decorationIndex + 1];
  1196 + var parentNode = textNode.parentNode;
  1197 + parentNode.replaceChild(span, textNode);
  1198 + span.appendChild(textNode);
  1199 + if (sourceIndex < spanEnd) { // Split off a text node.
  1200 + spans[spanIndex + 1] = textNode
  1201 + // TODO: Possibly optimize by using '' if there's no flicker.
  1202 + = document.createTextNode(source.substring(end, spanEnd));
  1203 + parentNode.insertBefore(textNode, span.nextSibling);
  1204 + }
  1205 + }
  1206 +
  1207 + sourceIndex = end;
  1208 +
  1209 + if (sourceIndex >= spanEnd) {
  1210 + spanIndex += 2;
  1211 + }
  1212 + if (sourceIndex >= decEnd) {
  1213 + decorationIndex += 2;
1147 1214 }
1148 1215 }
1149   -
1150   - sourceIndex = end;
1151   -
1152   - if (sourceIndex >= spanEnd) {
1153   - spanIndex += 2;
1154   - }
1155   - if (sourceIndex >= decEnd) {
1156   - decorationIndex += 2;
  1216 + } finally {
  1217 + if (sourceNode) {
  1218 + sourceNode.style.display = oldDisplay;
1157 1219 }
1158 1220 }
1159 1221 }
@@ -1182,7 +1244,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1182 1244 var ext = fileExtensions[i];
1183 1245 if (!langHandlerRegistry.hasOwnProperty(ext)) {
1184 1246 langHandlerRegistry[ext] = handler;
1185   - } else if (window['console']) {
  1247 + } else if (win['console']) {
1186 1248 console['warn']('cannot override language handler %s', ext);
1187 1249 }
1188 1250 }
@@ -1294,14 +1356,15 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1294 1356 'tripleQuotedStrings': true,
1295 1357 'regexLiterals': true
1296 1358 }), ['coffee']);
1297   - registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
  1359 + registerLangHandler(
  1360 + createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
1298 1361
1299 1362 function applyDecorator(job) {
1300 1363 var opt_langExtension = job.langExtension;
1301 1364
1302 1365 try {
1303 1366 // Extract tags, and convert the source code to plain text.
1304   - var sourceAndSpans = extractSourceSpans(job.sourceNode);
  1367 + var sourceAndSpans = extractSourceSpans(job.sourceNode, job.pre);
1305 1368 /** Plain text. @type {string} */
1306 1369 var source = sourceAndSpans.sourceCode;
1307 1370 job.sourceCode = source;
@@ -1315,7 +1378,7 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1315 1378 // modifying the sourceNode in place.
1316 1379 recombineTagsAndDecorations(job);
1317 1380 } catch (e) {
1318   - if ('console' in window) {
  1381 + if (win['console']) {
1319 1382 console['log'](e && e['stack'] ? e['stack'] : e);
1320 1383 }
1321 1384 }
@@ -1329,19 +1392,20 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1329 1392 * or the 1-indexed number of the first line in sourceCodeHtml.
1330 1393 */
1331 1394 function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
1332   - var container = document.createElement('PRE');
  1395 + var container = document.createElement('pre');
1333 1396 // This could cause images to load and onload listeners to fire.
1334 1397 // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
1335 1398 // We assume that the inner HTML is from a trusted source.
1336 1399 container.innerHTML = sourceCodeHtml;
1337 1400 if (opt_numberLines) {
1338   - numberLines(container, opt_numberLines);
  1401 + numberLines(container, opt_numberLines, true);
1339 1402 }
1340 1403
1341 1404 var job = {
1342 1405 langExtension: opt_langExtension,
1343 1406 numberLines: opt_numberLines,
1344   - sourceNode: container
  1407 + sourceNode: container,
  1408 + pre: 1
1345 1409 };
1346 1410 applyDecorator(job);
1347 1411 return container.innerHTML;
@@ -1371,59 +1435,88 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1371 1435
1372 1436 var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
1373 1437 var prettyPrintRe = /\bprettyprint\b/;
  1438 + var prettyPrintedRe = /\bprettyprinted\b/;
  1439 + var preformattedTagNameRe = /pre|xmp/i;
  1440 + var codeRe = /^code$/i;
  1441 + var preCodeXmpRe = /^(?:pre|code|xmp)$/i;
1374 1442
1375 1443 function doWork() {
1376   - var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
  1444 + var endTime = (win['PR_SHOULD_USE_CONTINUATION'] ?
1377 1445 clock['now']() + 250 /* ms */ :
1378 1446 Infinity);
1379 1447 for (; k < elements.length && clock['now']() < endTime; k++) {
1380 1448 var cs = elements[k];
1381 1449 var className = cs.className;
1382   - if (className.indexOf('prettyprint') >= 0) {
1383   - // If the classes includes a language extensions, use it.
1384   - // Language extensions can be specified like
1385   - // <pre class="prettyprint lang-cpp">
1386   - // the language extension "cpp" is used to find a language handler as
1387   - // passed to PR.registerLangHandler.
1388   - // HTML5 recommends that a language be specified using "language-"
1389   - // as the prefix instead. Google Code Prettify supports both.
1390   - // http://dev.w3.org/html5/spec-author-view/the-code-element.html
1391   - var langExtension = className.match(langExtensionRe);
1392   - // Support <pre class="prettyprint"><code class="language-c">
1393   - var wrapper;
1394   - if (!langExtension && (wrapper = childContentWrapper(cs))
1395   - && "CODE" === wrapper.tagName) {
1396   - langExtension = wrapper.className.match(langExtensionRe);
1397   - }
1398   -
1399   - if (langExtension) {
1400   - langExtension = langExtension[1];
1401   - }
  1450 + if (prettyPrintRe.test(className)
  1451 + // Don't redo this if we've already done it.
  1452 + // This allows recalling pretty print to just prettyprint elements
  1453 + // that have been added to the page since last call.
  1454 + && !prettyPrintedRe.test(className)) {
1402 1455
1403 1456 // make sure this is not nested in an already prettified element
1404 1457 var nested = false;
1405 1458 for (var p = cs.parentNode; p; p = p.parentNode) {
1406   - if ((p.tagName === 'pre' || p.tagName === 'code' ||
1407   - p.tagName === 'xmp') &&
1408   - p.className && p.className.indexOf('prettyprint') >= 0) {
  1459 + var tn = p.tagName;
  1460 + if (preCodeXmpRe.test(tn)
  1461 + && p.className && prettyPrintRe.test(p.className)) {
1409 1462 nested = true;
1410 1463 break;
1411 1464 }
1412 1465 }
1413 1466 if (!nested) {
  1467 + // Mark done. If we fail to prettyprint for whatever reason,
  1468 + // we shouldn't try again.
  1469 + cs.className += ' prettyprinted';
  1470 +
  1471 + // If the classes includes a language extensions, use it.
  1472 + // Language extensions can be specified like
  1473 + // <pre class="prettyprint lang-cpp">
  1474 + // the language extension "cpp" is used to find a language handler
  1475 + // as passed to PR.registerLangHandler.
  1476 + // HTML5 recommends that a language be specified using "language-"
  1477 + // as the prefix instead. Google Code Prettify supports both.
  1478 + // http://dev.w3.org/html5/spec-author-view/the-code-element.html
  1479 + var langExtension = className.match(langExtensionRe);
  1480 + // Support <pre class="prettyprint"><code class="language-c">
  1481 + var wrapper;
  1482 + if (!langExtension && (wrapper = childContentWrapper(cs))
  1483 + && codeRe.test(wrapper.tagName)) {
  1484 + langExtension = wrapper.className.match(langExtensionRe);
  1485 + }
  1486 +
  1487 + if (langExtension) { langExtension = langExtension[1]; }
  1488 +
  1489 + var preformatted;
  1490 + if (preformattedTagNameRe.test(cs.tagName)) {
  1491 + preformatted = 1;
  1492 + } else {
  1493 + var currentStyle = cs['currentStyle'];
  1494 + var whitespace = (
  1495 + currentStyle
  1496 + ? currentStyle['whiteSpace']
  1497 + : (document.defaultView
  1498 + && document.defaultView.getComputedStyle)
  1499 + ? document.defaultView.getComputedStyle(cs, null)
  1500 + .getPropertyValue('white-space')
  1501 + : 0);
  1502 + preformatted = whitespace
  1503 + && 'pre' === whitespace.substring(0, 3);
  1504 + }
  1505 +
1414 1506 // Look for a class like linenums or linenums:<n> where <n> is the
1415 1507 // 1-indexed number of the first line.
1416 1508 var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
1417 1509 lineNums = lineNums
1418   - ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
1419   - : false;
1420   - if (lineNums) { numberLines(cs, lineNums); }
  1510 + ? lineNums[1] && lineNums[1].length ? +lineNums[1] : true
  1511 + : false;
  1512 + if (lineNums) { numberLines(cs, lineNums, preformatted); }
1421 1513
1422 1514 // do the pretty printing
1423 1515 prettyPrintingJob = {
1424 1516 langExtension: langExtension,
1425 1517 sourceNode: cs,
1426   - numberLines: lineNums
  1518 + numberLines: lineNums,
  1519 + pre: preformatted
1427 1520 };
1428 1521 applyDecorator(prettyPrintingJob);
1429 1522 }
@@ -1440,26 +1533,11 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1440 1533 doWork();
1441 1534 }
1442 1535
1443   - /**
1444   - * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
1445   - * {@code class=prettyprint} and prettify them.
1446   - *
1447   - * @param {Function?} opt_whenDone if specified, called when the last entry
1448   - * has been finished.
1449   - */
1450   - window['prettyPrintOne'] = prettyPrintOne;
1451   - /**
1452   - * Pretty print a chunk of code.
1453   - *
1454   - * @param {string} sourceCodeHtml code as html
1455   - * @return {string} code as html, but prettier
1456   - */
1457   - window['prettyPrint'] = prettyPrint;
1458   - /**
1459   - * Contains functions for creating and registering new language handlers.
1460   - * @type {Object}
1461   - */
1462   - window['PR'] = {
  1536 + /**
  1537 + * Contains functions for creating and registering new language handlers.
  1538 + * @type {Object}
  1539 + */
  1540 + var PR = win['PR'] = {
1463 1541 'createSimpleLexer': createSimpleLexer,
1464 1542 'registerLangHandler': registerLangHandler,
1465 1543 'sourceDecorator': sourceDecorator,
@@ -1475,12 +1553,34 @@ var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&
1475 1553 'PR_SOURCE': PR_SOURCE,
1476 1554 'PR_STRING': PR_STRING,
1477 1555 'PR_TAG': PR_TAG,
1478   - 'PR_TYPE': PR_TYPE
  1556 + 'PR_TYPE': PR_TYPE,
  1557 + 'prettyPrintOne': win['prettyPrintOne'] = prettyPrintOne,
  1558 + 'prettyPrint': win['prettyPrint'] = prettyPrint
1479 1559 };
  1560 +
  1561 + // Make PR available via the Asynchronous Module Definition (AMD) API.
  1562 + // Per https://github.com/amdjs/amdjs-api/wiki/AMD:
  1563 + // The Asynchronous Module Definition (AMD) API specifies a
  1564 + // mechanism for defining modules such that the module and its
  1565 + // dependencies can be asynchronously loaded.
  1566 + // ...
  1567 + // To allow a clear indicator that a global define function (as
  1568 + // needed for script src browser loading) conforms to the AMD API,
  1569 + // any global define function SHOULD have a property called "amd"
  1570 + // whose value is an object. This helps avoid conflict with any
  1571 + // other existing JavaScript code that could have defined a define()
  1572 + // function that does not conform to the AMD API.
  1573 + if (typeof define === "function" && define['amd']) {
  1574 + define("google-code-prettify", [], function () {
  1575 + return PR;
  1576 + });
  1577 + }
1480 1578 })();
1481 1579
1482   -// Contributed by Ryan Grove <ryan@wonko.com>
1483 1580
  1581 +// ***** Customization begin
  1582 +
  1583 +// Contributed by Ryan Grove <ryan@wonko.com>
1484 1584 /**
1485 1585 * @fileoverview
1486 1586 * Registers a language handler for Handlebars.
@@ -1605,113 +1705,6 @@ PR['registerLangHandler'](
1605 1705 [PR['PR_STRING'], /^[^\)\"\']+/]
1606 1706 ]),
1607 1707 ['css-str']);
1608   -?)(?:\?>|$)/],
1609   - ['lang-', /^<%([\s\S]+?)(?:%>|$)/],
1610   - ['lang-', /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
1611   -
1612   - // Unescaped Handlebars template in JavaScript.
1613   - ['lang-handlebars', /^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
1614   -
1615   - // Unescaped content in javascript. (Or possibly vbscript).
1616   - ['lang-js', /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
1617   -
1618   - // Contains unescaped stylesheet content
1619   - ['lang-css', /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
1620   - ['lang-in.tag', /^(<\/?[a-z][^<>]*>)/i],
1621   -
1622   - // -- Handlebars ---------------------------------------------------------
1623   - // Tag (escaped).
1624   - [PR['PR_DECLARATION'], /^{{[#^>/]?\s*[\w.][^}]*}}/],
1625   -
1626   - // Tag (unescaped).
1627   - [PR['PR_DECLARATION'], /^{{&?\s*[\w.][^}]*}}/],
1628   -
1629   - // Tag (unescaped).
1630   - [PR['PR_DECLARATION'], /^{{{>?\s*[\w.][^}]*}}}/],
1631