diff options
Diffstat (limited to 'documentation-highlighter/highlight.min.js')
-rw-r--r-- | documentation-highlighter/highlight.min.js | 400 |
1 files changed, 400 insertions, 0 deletions
diff --git a/documentation-highlighter/highlight.min.js b/documentation-highlighter/highlight.min.js new file mode 100644 index 0000000..550f2b3 --- /dev/null +++ b/documentation-highlighter/highlight.min.js | |||
@@ -0,0 +1,400 @@ | |||
1 | /*! | ||
2 | Highlight.js v11.4.0 (git: 2d0e7c1094) | ||
3 | (c) 2006-2022 Ivan Sagalaev and other contributors | ||
4 | License: BSD-3-Clause | ||
5 | */ | ||
6 | var hljs=function(){"use strict";var e={exports:{}};function t(e){ | ||
7 | return e instanceof Map?e.clear=e.delete=e.set=()=>{ | ||
8 | throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ | ||
9 | throw Error("set is read-only") | ||
10 | }),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((n=>{var i=e[n] | ||
11 | ;"object"!=typeof i||Object.isFrozen(i)||t(i)})),e} | ||
12 | e.exports=t,e.exports.default=t;var n=e.exports;class i{constructor(e){ | ||
13 | void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} | ||
14 | ignoreMatch(){this.isMatchIgnored=!0}}function r(e){ | ||
15 | return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'") | ||
16 | }function s(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t] | ||
17 | ;return t.forEach((e=>{for(const t in e)n[t]=e[t]})),n}const o=e=>!!e.kind | ||
18 | ;class a{constructor(e,t){ | ||
19 | this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){ | ||
20 | this.buffer+=r(e)}openNode(e){if(!o(e))return;let t=e.kind | ||
21 | ;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){ | ||
22 | const n=e.split(".") | ||
23 | ;return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ") | ||
24 | }return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){ | ||
25 | o(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){ | ||
26 | this.buffer+=`<span class="${e}">`}}class c{constructor(){this.rootNode={ | ||
27 | children:[]},this.stack=[this.rootNode]}get top(){ | ||
28 | return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ | ||
29 | this.top.children.push(e)}openNode(e){const t={kind:e,children:[]} | ||
30 | ;this.add(t),this.stack.push(t)}closeNode(){ | ||
31 | if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ | ||
32 | for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} | ||
33 | walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){ | ||
34 | return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t), | ||
35 | t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){ | ||
36 | "string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ | ||
37 | c._collapse(e)})))}}class l extends c{constructor(e){super(),this.options=e} | ||
38 | addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())} | ||
39 | addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root | ||
40 | ;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){ | ||
41 | return new a(this,this.options).value()}finalize(){return!0}}function g(e){ | ||
42 | return e?"string"==typeof e?e:e.source:null}function d(e){return f("(?=",e,")")} | ||
43 | function u(e){return f("(?:",e,")*")}function h(e){return f("(?:",e,")?")} | ||
44 | function f(...e){return e.map((e=>g(e))).join("")}function p(...e){const t=(e=>{ | ||
45 | const t=e[e.length-1] | ||
46 | ;return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{} | ||
47 | })(e);return"("+(t.capture?"":"?:")+e.map((e=>g(e))).join("|")+")"} | ||
48 | function b(e){return RegExp(e.toString()+"|").exec("").length-1} | ||
49 | const m=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ | ||
50 | ;function E(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n | ||
51 | ;let i=g(e),r="";for(;i.length>0;){const e=m.exec(i);if(!e){r+=i;break} | ||
52 | r+=i.substring(0,e.index), | ||
53 | i=i.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0], | ||
54 | "("===e[0]&&n++)}return r})).map((e=>`(${e})`)).join(t)} | ||
55 | const x="[a-zA-Z]\\w*",w="[a-zA-Z_]\\w*",y="\\b\\d+(\\.\\d+)?",_="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",k={ | ||
56 | begin:"\\\\[\\s\\S]",relevance:0},O={scope:"string",begin:"'",end:"'", | ||
57 | illegal:"\\n",contains:[k]},N={scope:"string",begin:'"',end:'"',illegal:"\\n", | ||
58 | contains:[k]},M=(e,t,n={})=>{const i=s({scope:"comment",begin:e,end:t, | ||
59 | contains:[]},n);i.contains.push({scope:"doctag", | ||
60 | begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", | ||
61 | end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) | ||
62 | ;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) | ||
63 | ;return i.contains.push({begin:f(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i | ||
64 | },S=M("//","$"),R=M("/\\*","\\*/"),j=M("#","$");var A=Object.freeze({ | ||
65 | __proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:x,UNDERSCORE_IDENT_RE:w, | ||
66 | NUMBER_RE:y,C_NUMBER_RE:_,BINARY_NUMBER_RE:v, | ||
67 | RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", | ||
68 | SHEBANG:(e={})=>{const t=/^#![ ]*\// | ||
69 | ;return e.binary&&(e.begin=f(t,/.*\b/,e.binary,/\b.*/)),s({scope:"meta",begin:t, | ||
70 | end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)}, | ||
71 | BACKSLASH_ESCAPE:k,APOS_STRING_MODE:O,QUOTE_STRING_MODE:N,PHRASAL_WORDS_MODE:{ | ||
72 | begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ | ||
73 | },COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:R,HASH_COMMENT_MODE:j, | ||
74 | NUMBER_MODE:{scope:"number",begin:y,relevance:0},C_NUMBER_MODE:{scope:"number", | ||
75 | begin:_,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:v,relevance:0}, | ||
76 | REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, | ||
77 | end:/\/[gimuy]*/,illegal:/\n/,contains:[k,{begin:/\[/,end:/\]/,relevance:0, | ||
78 | contains:[k]}]}]},TITLE_MODE:{scope:"title",begin:x,relevance:0}, | ||
79 | UNDERSCORE_TITLE_MODE:{scope:"title",begin:w,relevance:0},METHOD_GUARD:{ | ||
80 | begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ | ||
81 | "on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{ | ||
82 | t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function I(e,t){ | ||
83 | "."===e.input[e.index-1]&&t.ignoreMatch()}function T(e,t){ | ||
84 | void 0!==e.className&&(e.scope=e.className,delete e.className)}function L(e,t){ | ||
85 | t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", | ||
86 | e.__beforeBegin=I,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, | ||
87 | void 0===e.relevance&&(e.relevance=0))}function B(e,t){ | ||
88 | Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function D(e,t){ | ||
89 | if(e.match){ | ||
90 | if(e.begin||e.end)throw Error("begin & end are not supported with match") | ||
91 | ;e.begin=e.match,delete e.match}}function H(e,t){ | ||
92 | void 0===e.relevance&&(e.relevance=1)}const P=(e,t)=>{if(!e.beforeMatch)return | ||
93 | ;if(e.starts)throw Error("beforeMatch cannot be used with starts") | ||
94 | ;const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t] | ||
95 | })),e.keywords=n.keywords,e.begin=f(n.beforeMatch,d(n.begin)),e.starts={ | ||
96 | relevance:0,contains:[Object.assign(n,{endsParent:!0})] | ||
97 | },e.relevance=0,delete n.beforeMatch | ||
98 | },C=["of","and","for","in","not","or","if","then","parent","list","value"] | ||
99 | ;function $(e,t,n="keyword"){const i=Object.create(null) | ||
100 | ;return"string"==typeof e?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach((n=>{ | ||
101 | Object.assign(i,$(e[n],t,n))})),i;function r(e,n){ | ||
102 | t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((t=>{const n=t.split("|") | ||
103 | ;i[n[0]]=[e,U(n[0],n[1])]}))}}function U(e,t){ | ||
104 | return t?Number(t):(e=>C.includes(e.toLowerCase()))(e)?0:1}const z={},K=e=>{ | ||
105 | console.error(e)},W=(e,...t)=>{console.log("WARN: "+e,...t)},X=(e,t)=>{ | ||
106 | z[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),z[`${e}/${t}`]=!0) | ||
107 | },G=Error();function Z(e,t,{key:n}){let i=0;const r=e[n],s={},o={} | ||
108 | ;for(let e=1;e<=t.length;e++)o[e+i]=r[e],s[e+i]=!0,i+=b(t[e-1]) | ||
109 | ;e[n]=o,e[n]._emit=s,e[n]._multi=!0}function F(e){(e=>{ | ||
110 | e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, | ||
111 | delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ | ||
112 | _wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope | ||
113 | }),(e=>{if(Array.isArray(e.begin)){ | ||
114 | if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), | ||
115 | G | ||
116 | ;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), | ||
117 | G;Z(e,e.begin,{key:"beginScope"}),e.begin=E(e.begin,{joinWith:""})}})(e),(e=>{ | ||
118 | if(Array.isArray(e.end)){ | ||
119 | if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), | ||
120 | G | ||
121 | ;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), | ||
122 | G;Z(e,e.end,{key:"endScope"}),e.end=E(e.end,{joinWith:""})}})(e)}function V(e){ | ||
123 | function t(t,n){ | ||
124 | return RegExp(g(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":"")) | ||
125 | }class n{constructor(){ | ||
126 | this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} | ||
127 | addRule(e,t){ | ||
128 | t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]), | ||
129 | this.matchAt+=b(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) | ||
130 | ;const e=this.regexes.map((e=>e[1]));this.matcherRe=t(E(e,{joinWith:"|" | ||
131 | }),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex | ||
132 | ;const t=this.matcherRe.exec(e);if(!t)return null | ||
133 | ;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),i=this.matchIndexes[n] | ||
134 | ;return t.splice(0,n),Object.assign(t,i)}}class i{constructor(){ | ||
135 | this.rules=[],this.multiRegexes=[], | ||
136 | this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ | ||
137 | if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n | ||
138 | ;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))), | ||
139 | t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){ | ||
140 | return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){ | ||
141 | this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){ | ||
142 | const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex | ||
143 | ;let n=t.exec(e) | ||
144 | ;if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{ | ||
145 | const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)} | ||
146 | return n&&(this.regexIndex+=n.position+1, | ||
147 | this.regexIndex===this.count&&this.considerAll()),n}} | ||
148 | if(e.compilerExtensions||(e.compilerExtensions=[]), | ||
149 | e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") | ||
150 | ;return e.classNameAliases=s(e.classNameAliases||{}),function n(r,o){const a=r | ||
151 | ;if(r.isCompiled)return a | ||
152 | ;[T,D,F,P].forEach((e=>e(r,o))),e.compilerExtensions.forEach((e=>e(r,o))), | ||
153 | r.__beforeBegin=null,[L,B,H].forEach((e=>e(r,o))),r.isCompiled=!0;let c=null | ||
154 | ;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), | ||
155 | c=r.keywords.$pattern, | ||
156 | delete r.keywords.$pattern),c=c||/\w+/,r.keywords&&(r.keywords=$(r.keywords,e.case_insensitive)), | ||
157 | a.keywordPatternRe=t(c,!0), | ||
158 | o&&(r.begin||(r.begin=/\B|\b/),a.beginRe=t(a.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), | ||
159 | r.end&&(a.endRe=t(a.end)), | ||
160 | a.terminatorEnd=g(a.end)||"",r.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)), | ||
161 | r.illegal&&(a.illegalRe=t(r.illegal)), | ||
162 | r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>s(e,{ | ||
163 | variants:null},t)))),e.cachedVariants?e.cachedVariants:q(e)?s(e,{ | ||
164 | starts:e.starts?s(e.starts):null | ||
165 | }):Object.isFrozen(e)?s(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{n(e,a) | ||
166 | })),r.starts&&n(r.starts,o),a.matcher=(e=>{const t=new i | ||
167 | ;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin" | ||
168 | }))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end" | ||
169 | }),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(a),a}(e)}function q(e){ | ||
170 | return!!e&&(e.endsWithParent||q(e.starts))}class J extends Error{ | ||
171 | constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}} | ||
172 | const Y=r,Q=s,ee=Symbol("nomatch");var te=(e=>{ | ||
173 | const t=Object.create(null),r=Object.create(null),s=[];let o=!0 | ||
174 | ;const a="Could not find the language '{}', did you forget to load/include a language module?",c={ | ||
175 | disableAutodetect:!0,name:"Plain text",contains:[]};let g={ | ||
176 | ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, | ||
177 | languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", | ||
178 | cssSelector:"pre code",languages:null,__emitter:l};function b(e){ | ||
179 | return g.noHighlightRe.test(e)}function m(e,t,n){let i="",r="" | ||
180 | ;"object"==typeof t?(i=e, | ||
181 | n=t.ignoreIllegals,r=t.language):(X("10.7.0","highlight(lang, code, ...args) has been deprecated."), | ||
182 | X("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), | ||
183 | r=e,i=t),void 0===n&&(n=!0);const s={code:i,language:r};N("before:highlight",s) | ||
184 | ;const o=s.result?s.result:E(s.language,s.code,n) | ||
185 | ;return o.code=s.code,N("after:highlight",o),o}function E(e,n,r,s){ | ||
186 | const c=Object.create(null);function l(){if(!O.keywords)return void M.addText(S) | ||
187 | ;let e=0;O.keywordPatternRe.lastIndex=0;let t=O.keywordPatternRe.exec(S),n="" | ||
188 | ;for(;t;){n+=S.substring(e,t.index) | ||
189 | ;const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(i=r,O.keywords[i]);if(s){ | ||
190 | const[e,i]=s | ||
191 | ;if(M.addText(n),n="",c[r]=(c[r]||0)+1,c[r]<=7&&(R+=i),e.startsWith("_"))n+=t[0];else{ | ||
192 | const n=y.classNameAliases[e]||e;M.addKeyword(t[0],n)}}else n+=t[0] | ||
193 | ;e=O.keywordPatternRe.lastIndex,t=O.keywordPatternRe.exec(S)}var i | ||
194 | ;n+=S.substr(e),M.addText(n)}function d(){null!=O.subLanguage?(()=>{ | ||
195 | if(""===S)return;let e=null;if("string"==typeof O.subLanguage){ | ||
196 | if(!t[O.subLanguage])return void M.addText(S) | ||
197 | ;e=E(O.subLanguage,S,!0,N[O.subLanguage]),N[O.subLanguage]=e._top | ||
198 | }else e=x(S,O.subLanguage.length?O.subLanguage:null) | ||
199 | ;O.relevance>0&&(R+=e.relevance),M.addSublanguage(e._emitter,e.language) | ||
200 | })():l(),S=""}function u(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++ | ||
201 | ;continue}const i=y.classNameAliases[e[n]]||e[n],r=t[n] | ||
202 | ;i?M.addKeyword(r,i):(S=r,l(),S=""),n++}}function h(e,t){ | ||
203 | return e.scope&&"string"==typeof e.scope&&M.openNode(y.classNameAliases[e.scope]||e.scope), | ||
204 | e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), | ||
205 | S=""):e.beginScope._multi&&(u(e.beginScope,t),S="")),O=Object.create(e,{parent:{ | ||
206 | value:O}}),O}function f(e,t,n){let r=((e,t)=>{const n=e&&e.exec(t) | ||
207 | ;return n&&0===n.index})(e.endRe,n);if(r){if(e["on:end"]){const n=new i(e) | ||
208 | ;e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){ | ||
209 | for(;e.endsParent&&e.parent;)e=e.parent;return e}} | ||
210 | if(e.endsWithParent)return f(e.parent,t,n)}function p(e){ | ||
211 | return 0===O.matcher.regexIndex?(S+=e[0],1):(I=!0,0)}function b(e){ | ||
212 | const t=e[0],i=n.substr(e.index),r=f(O,e,i);if(!r)return ee;const s=O | ||
213 | ;O.endScope&&O.endScope._wrap?(d(), | ||
214 | M.addKeyword(t,O.endScope._wrap)):O.endScope&&O.endScope._multi?(d(), | ||
215 | u(O.endScope,e)):s.skip?S+=t:(s.returnEnd||s.excludeEnd||(S+=t), | ||
216 | d(),s.excludeEnd&&(S=t));do{ | ||
217 | O.scope&&M.closeNode(),O.skip||O.subLanguage||(R+=O.relevance),O=O.parent | ||
218 | }while(O!==r.parent);return r.starts&&h(r.starts,e),s.returnEnd?0:t.length} | ||
219 | let m={};function w(t,s){const a=s&&s[0];if(S+=t,null==a)return d(),0 | ||
220 | ;if("begin"===m.type&&"end"===s.type&&m.index===s.index&&""===a){ | ||
221 | if(S+=n.slice(s.index,s.index+1),!o){const t=Error(`0 width match regex (${e})`) | ||
222 | ;throw t.languageName=e,t.badRule=m.rule,t}return 1} | ||
223 | if(m=s,"begin"===s.type)return(e=>{ | ||
224 | const t=e[0],n=e.rule,r=new i(n),s=[n.__beforeBegin,n["on:begin"]] | ||
225 | ;for(const n of s)if(n&&(n(e,r),r.isMatchIgnored))return p(t) | ||
226 | ;return n.skip?S+=t:(n.excludeBegin&&(S+=t), | ||
227 | d(),n.returnBegin||n.excludeBegin||(S=t)),h(n,e),n.returnBegin?0:t.length})(s) | ||
228 | ;if("illegal"===s.type&&!r){ | ||
229 | const e=Error('Illegal lexeme "'+a+'" for mode "'+(O.scope||"<unnamed>")+'"') | ||
230 | ;throw e.mode=O,e}if("end"===s.type){const e=b(s);if(e!==ee)return e} | ||
231 | if("illegal"===s.type&&""===a)return 1 | ||
232 | ;if(A>1e5&&A>3*s.index)throw Error("potential infinite loop, way more iterations than matches") | ||
233 | ;return S+=a,a.length}const y=v(e) | ||
234 | ;if(!y)throw K(a.replace("{}",e)),Error('Unknown language: "'+e+'"') | ||
235 | ;const _=V(y);let k="",O=s||_;const N={},M=new g.__emitter(g);(()=>{const e=[] | ||
236 | ;for(let t=O;t!==y;t=t.parent)t.scope&&e.unshift(t.scope) | ||
237 | ;e.forEach((e=>M.openNode(e)))})();let S="",R=0,j=0,A=0,I=!1;try{ | ||
238 | for(O.matcher.considerAll();;){ | ||
239 | A++,I?I=!1:O.matcher.considerAll(),O.matcher.lastIndex=j | ||
240 | ;const e=O.matcher.exec(n);if(!e)break;const t=w(n.substring(j,e.index),e) | ||
241 | ;j=e.index+t}return w(n.substr(j)),M.closeAllNodes(),M.finalize(),k=M.toHTML(),{ | ||
242 | language:e,value:k,relevance:R,illegal:!1,_emitter:M,_top:O}}catch(t){ | ||
243 | if(t.message&&t.message.includes("Illegal"))return{language:e,value:Y(n), | ||
244 | illegal:!0,relevance:0,_illegalBy:{message:t.message,index:j, | ||
245 | context:n.slice(j-100,j+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{ | ||
246 | language:e,value:Y(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:O} | ||
247 | ;throw t}}function x(e,n){n=n||g.languages||Object.keys(t);const i=(e=>{ | ||
248 | const t={value:Y(e),illegal:!1,relevance:0,_top:c,_emitter:new g.__emitter(g)} | ||
249 | ;return t._emitter.addText(e),t})(e),r=n.filter(v).filter(O).map((t=>E(t,e,!1))) | ||
250 | ;r.unshift(i);const s=r.sort(((e,t)=>{ | ||
251 | if(e.relevance!==t.relevance)return t.relevance-e.relevance | ||
252 | ;if(e.language&&t.language){if(v(e.language).supersetOf===t.language)return 1 | ||
253 | ;if(v(t.language).supersetOf===e.language)return-1}return 0})),[o,a]=s,l=o | ||
254 | ;return l.secondBest=a,l}function w(e){let t=null;const n=(e=>{ | ||
255 | let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"" | ||
256 | ;const n=g.languageDetectRe.exec(t);if(n){const t=v(n[1]) | ||
257 | ;return t||(W(a.replace("{}",n[1])), | ||
258 | W("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"} | ||
259 | return t.split(/\s+/).find((e=>b(e)||v(e)))})(e);if(b(n))return | ||
260 | ;if(N("before:highlightElement",{el:e,language:n | ||
261 | }),e.children.length>0&&(g.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), | ||
262 | console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), | ||
263 | console.warn("The element with unescaped HTML:"), | ||
264 | console.warn(e)),g.throwUnescapedHTML))throw new J("One of your code blocks includes unescaped HTML.",e.innerHTML) | ||
265 | ;t=e;const i=t.textContent,s=n?m(i,{language:n,ignoreIllegals:!0}):x(i) | ||
266 | ;e.innerHTML=s.value,((e,t,n)=>{const i=t&&r[t]||n | ||
267 | ;e.classList.add("hljs"),e.classList.add("language-"+i) | ||
268 | })(e,n,s.language),e.result={language:s.language,re:s.relevance, | ||
269 | relevance:s.relevance},s.secondBest&&(e.secondBest={ | ||
270 | language:s.secondBest.language,relevance:s.secondBest.relevance | ||
271 | }),N("after:highlightElement",{el:e,result:s,text:i})}let y=!1;function _(){ | ||
272 | "loading"!==document.readyState?document.querySelectorAll(g.cssSelector).forEach(w):y=!0 | ||
273 | }function v(e){return e=(e||"").toLowerCase(),t[e]||t[r[e]]} | ||
274 | function k(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ | ||
275 | r[e.toLowerCase()]=t}))}function O(e){const t=v(e) | ||
276 | ;return t&&!t.disableAutodetect}function N(e,t){const n=e;s.forEach((e=>{ | ||
277 | e[n]&&e[n](t)}))} | ||
278 | "undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ | ||
279 | y&&_()}),!1),Object.assign(e,{highlight:m,highlightAuto:x,highlightAll:_, | ||
280 | highlightElement:w, | ||
281 | highlightBlock:e=>(X("10.7.0","highlightBlock will be removed entirely in v12.0"), | ||
282 | X("10.7.0","Please use highlightElement now."),w(e)),configure:e=>{g=Q(g,e)}, | ||
283 | initHighlighting:()=>{ | ||
284 | _(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, | ||
285 | initHighlightingOnLoad:()=>{ | ||
286 | _(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") | ||
287 | },registerLanguage:(n,i)=>{let r=null;try{r=i(e)}catch(e){ | ||
288 | if(K("Language definition for '{}' could not be registered.".replace("{}",n)), | ||
289 | !o)throw e;K(e),r=c} | ||
290 | r.name||(r.name=n),t[n]=r,r.rawDefinition=i.bind(null,e),r.aliases&&k(r.aliases,{ | ||
291 | languageName:n})},unregisterLanguage:e=>{delete t[e] | ||
292 | ;for(const t of Object.keys(r))r[t]===e&&delete r[t]}, | ||
293 | listLanguages:()=>Object.keys(t),getLanguage:v,registerAliases:k, | ||
294 | autoDetection:O,inherit:Q,addPlugin:e=>{(e=>{ | ||
295 | e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{ | ||
296 | e["before:highlightBlock"](Object.assign({block:t.el},t)) | ||
297 | }),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{ | ||
298 | e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),s.push(e)} | ||
299 | }),e.debugMode=()=>{o=!1},e.safeMode=()=>{o=!0 | ||
300 | },e.versionString="11.4.0",e.regex={concat:f,lookahead:d,either:p,optional:h, | ||
301 | anyNumberOfTimes:u};for(const e in A)"object"==typeof A[e]&&n(A[e]) | ||
302 | ;return Object.assign(e,A),e})({});return te}() | ||
303 | ;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs);/*! `python` grammar compiled for Highlight.js 11.4.0 */ | ||
304 | (()=>{var e=(()=>{"use strict";return e=>{ | ||
305 | const n=e.regex,a=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],s={ | ||
306 | $pattern:/[A-Za-z]\w+|__\w+__/,keyword:i, | ||
307 | built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], | ||
308 | literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], | ||
309 | type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] | ||
310 | },t={className:"meta",begin:/^(>>>|\.\.\.) /},r={className:"subst",begin:/\{/, | ||
311 | end:/\}/,keywords:s,illegal:/#/},l={begin:/\{\{/,relevance:0},b={ | ||
312 | className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ | ||
313 | begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, | ||
314 | contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ | ||
315 | begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, | ||
316 | contains:[e.BACKSLASH_ESCAPE,t],relevance:10},{ | ||
317 | begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, | ||
318 | contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, | ||
319 | end:/"""/,contains:[e.BACKSLASH_ESCAPE,t,l,r]},{begin:/([uU]|[rR])'/,end:/'/, | ||
320 | relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ | ||
321 | begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, | ||
322 | end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, | ||
323 | contains:[e.BACKSLASH_ESCAPE,l,r]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, | ||
324 | contains:[e.BACKSLASH_ESCAPE,l,r]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] | ||
325 | },o="[0-9](_?[0-9])*",c=`(\\b(${o}))?\\.(${o})|\\b(${o})\\.`,d="\\b|"+i.join("|"),g={ | ||
326 | className:"number",relevance:0,variants:[{ | ||
327 | begin:`(\\b(${o})|(${c}))[eE][+-]?(${o})[jJ]?(?=${d})`},{begin:`(${c})[jJ]?`},{ | ||
328 | begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{ | ||
329 | begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})` | ||
330 | },{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${o})[jJ](?=${d})` | ||
331 | }]},p={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:s, | ||
332 | contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ | ||
333 | className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, | ||
334 | end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s, | ||
335 | contains:["self",t,g,b,e.HASH_COMMENT_MODE]}]};return r.contains=[b,g,t],{ | ||
336 | name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:s, | ||
337 | illegal:/(<\/|->|\?)|=>/,contains:[t,g,{begin:/\bself\b/},{beginKeywords:"if", | ||
338 | relevance:0},b,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{ | ||
339 | 1:"keyword",3:"title.function"},contains:[m]},{variants:[{ | ||
340 | match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}], | ||
341 | scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ | ||
342 | className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,m,b]}]}}})() | ||
343 | ;hljs.registerLanguage("python",e)})();/*! `bash` grammar compiled for Highlight.js 11.4.0 */ | ||
344 | (()=>{var e=(()=>{"use strict";return e=>{const s=e.regex,t={},n={begin:/\$\{/, | ||
345 | end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{ | ||
346 | className:"variable",variants:[{ | ||
347 | begin:s.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const a={ | ||
348 | className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={ | ||
349 | begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, | ||
350 | end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/, | ||
351 | contains:[e.BACKSLASH_ESCAPE,t,a]};a.contains.push(c);const o={begin:/\$\(\(/, | ||
352 | end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] | ||
353 | },r=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 | ||
354 | }),l={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, | ||
355 | contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ | ||
356 | name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/, | ||
357 | keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], | ||
358 | literal:["true","false"], | ||
359 | built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] | ||
360 | },contains:[r,e.SHEBANG(),l,o,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},c,{ | ||
361 | className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}})() | ||
362 | ;hljs.registerLanguage("bash",e)})();/*! `nix` grammar compiled for Highlight.js 11.4.0 */ | ||
363 | (()=>{var e=(()=>{"use strict";return e=>{const n={ | ||
364 | keyword:["rec","with","let","in","inherit","assert","if","else","then"], | ||
365 | literal:["true","false","or","and","null"], | ||
366 | built_in:["import","abort","baseNameOf","dirOf","isNull","builtins","map","removeAttrs","throw","toString","derivation"] | ||
367 | },i={className:"subst",begin:/\$\{/,end:/\}/,keywords:n},s={className:"string", | ||
368 | contains:[i],variants:[{begin:"''",end:"''"},{begin:'"',end:'"'}] | ||
369 | },t=[e.NUMBER_MODE,e.HASH_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s,{ | ||
370 | begin:/[a-zA-Z0-9-_]+(\s*=)/,returnBegin:!0,relevance:0,contains:[{ | ||
371 | className:"attr",begin:/\S+/}]}];return i.contains=t,{name:"Nix", | ||
372 | aliases:["nixos"],keywords:n,contains:t}}})();hljs.registerLanguage("nix",e) | ||
373 | })();/*! `makefile` grammar compiled for Highlight.js 11.4.0 */ | ||
374 | (()=>{var e=(()=>{"use strict";return e=>{const i={className:"variable", | ||
375 | variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", | ||
376 | contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string", | ||
377 | begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i]},n={className:"variable", | ||
378 | begin:/\$\([\w-]+\s/,end:/\)/,keywords:{ | ||
379 | built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value" | ||
380 | },contains:[i]},s={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},r={ | ||
381 | className:"section",begin:/^[^\s]+:/,end:/$/,contains:[i]};return{ | ||
382 | name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/, | ||
383 | keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath" | ||
384 | },contains:[e.HASH_COMMENT_MODE,i,a,n,s,{className:"meta",begin:/^\.PHONY:/, | ||
385 | end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},r]}}})() | ||
386 | ;hljs.registerLanguage("makefile",e)})();/*! `ini` grammar compiled for Highlight.js 11.4.0 */ | ||
387 | (()=>{var e=(()=>{"use strict";return e=>{const n=e.regex,a={className:"number", | ||
388 | relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}] | ||
389 | },s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={ | ||
390 | className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/ | ||
391 | }]},t={className:"literal",begin:/\bon|off|true|false|yes|no\b/},r={ | ||
392 | className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''", | ||
393 | end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"' | ||
394 | },{begin:"'",end:"'"}]},l={begin:/\[/,end:/\]/,contains:[s,t,i,r,a,"self"], | ||
395 | relevance:0},c=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{ | ||
396 | name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, | ||
397 | contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{ | ||
398 | begin:n.concat(c,"(\\s*\\.\\s*",c,")*",n.lookahead(/\s*=\s*[^#\s]/)), | ||
399 | className:"attr",starts:{end:/$/,contains:[s,l,t,i,r,a]}}]}}})() | ||
400 | ;hljs.registerLanguage("ini",e)})(); \ No newline at end of file | ||