diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index c2cab65..8a91b2a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,9 @@ +### 0.2.0+7538a7f (Released 2022-6-20) +* Additions: + * latest commit #7538a7f + * [[#a54f783](https://github.com/Freymaurer/Nfdi4Plants.Fornax/commit/a54f783ff3193195bde18f2d16dc4cfd195199ab)] add nfdi-code parsing + * [[#7538a7f](https://github.com/Freymaurer/Nfdi4Plants.Fornax/commit/7538a7f977e5f2643b3ab69f43038a8034599539)] Add unit tests :white_check_mark: + ### 0.1.0+7fe6e3c (Released 2022-6-15) * Additions: * latest commit #7fe6e3c diff --git a/client/docs/metadata.md b/client/docs/metadata.md index 7ef71ff..2dffa6b 100644 --- a/client/docs/metadata.md +++ b/client/docs/metadata.md @@ -28,6 +28,20 @@ for f in *.md; do pandoc -s -o "${f%.md}.docx" "$f"; done ## What is metadata? +``` +// Code testing no language + +let x = 20 +``` + +```fsharp +// Code testing with language + +let x = 20 +``` + +Code testing with inline `code` example! + Metadata is "data that provides information about other data"[^1][Merriam]. In order to put some (plant) life into this web dictionary explanation, let us explore metadata with a plant biology example: > Viola investigates the effect of the plant circadian clock on sugar metabolism in *W. mirabilis*. For her PhD project, which is part of an EU-funded consortium in Prof. Beetroot's lab, she acquires seeds from a South-African botanical society. Viola grows the plants under different light regimes, harvests leaves from a two-day time series experiment, extracts polar metabolites as well as RNA and submits the samples to nearby core facilities for metabolomics and transcriptomics measurements, respectively. After a few weeks of iterative consultation with the facilities' heads as well as technicians and computational biologists involved, Viola receives back a wealth of raw and processed data. From the data she produces figures and wraps everything up to publish the results in the *Journal of Wonderful Plant Sciences*. diff --git a/client/js/bundle.js b/client/js/bundle.js index 5dc34e0..617e1c6 100644 --- a/client/js/bundle.js +++ b/client/js/bundle.js @@ -66,7 +66,7 @@ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e */class e extends i{constructor(i){if(super(i),this.it=w,i.type!==t.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(r){if(r===w||null==r)return this.ft=void 0,this.it=r;if(r===b)return r;if("string"!=typeof r)throw Error(this.constructor.directiveName+"() called with a non-string value");if(r===this.it)return this.ft;this.it=r;const s=[r];return s.raw=s,this.ft={_$litType$:this.constructor.resultType,strings:s,values:[]}}}e.directiveName="unsafeHTML",e.resultType=1;const o=e$1(e); const nfdiMint = r$2`#1FC2A7`; -const nfdiMintDarker20 = r$2`#199b86`; +const nfdiMintDarker20$1 = r$2`#199b86`; const nfdiLightblue = r$2`#4FB3D9`; const nfdiDarkblue = r$2`#2D3E50`; const nfdiDarkblueLighter20 = r$2`#576573`; @@ -1430,7 +1430,7 @@ a.box:active { color: #fff; } .button.is-primary:hover, .button.is-primary.is-hovered { - background-color: ${nfdiMintDarker20}; + background-color: ${nfdiMintDarker20$1}; border-color: transparent; color: #fff; } @@ -3234,7 +3234,7 @@ a.tag:hover { max-width: 100%; } -.number { +/* .number { align-items: center; background-color: whitesmoke; border-radius: 290486px; @@ -3247,7 +3247,7 @@ a.tag:hover { padding: 0.25rem 0.5rem; text-align: center; vertical-align: top; -} +} */ /* Bulma Form */ .select select, .textarea, .input { @@ -3727,7 +3727,7 @@ a.tag:hover { color: #fff; } .file.is-primary:hover .file-cta, .file.is-primary.is-hovered .file-cta { - background-color: ${nfdiMintDarker20}; + background-color: ${nfdiMintDarker20$1}; border-color: transparent; color: #fff; } @@ -11058,7 +11058,7 @@ let Footer = class extends s$1 {
  • - + Knowledge Base
  • @@ -11415,7 +11415,7 @@ let Body = class extends s$1 {
    ${this.hasSidebar ? sidebar : $``} -
    +
    @@ -11435,6 +11435,11 @@ Body.styles = [ border-color: var(--element-text-color, ${nfdiBlack}) } + /* https://stackoverflow.com/questions/36230944/prevent-flex-items-from-overflowing-a-container */ + .content-column { + min-width: 0; + } + @media screen and (min-width: 1216px) { .container:not(.is-max-desktop) { max-width: 1152px !important; @@ -11539,8 +11544,8 @@ function toInDOMHref(href) { return "#"; } } -const removeSpecialCharRegex = /[^a-zA-Z0-9\s]/g; -function createInPageLinkText(innerHtml) { +const removeSpecialCharRegex = /[^a-zA-Z0-9\s\-]/g; +function createInPageId(innerHtml) { const lightDOMText = innerHtml.trim(); return lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); } @@ -11553,7 +11558,7 @@ let H1 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = createInPageLinkText(lightDOMText); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11581,7 +11586,7 @@ let H2 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11609,7 +11614,7 @@ let H3 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11637,7 +11642,7 @@ let H4 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11665,7 +11670,7 @@ let H5 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11693,7 +11698,7 @@ let H6 = class extends s$1 { setTimeout(() => { let lightDOMText = this.innerHTML.trim(); this.text = lightDOMText; - let id = lightDOMText.toLowerCase().replace(removeSpecialCharRegex, "").replace(/\s/g, "-"); + let id = createInPageId(lightDOMText); this.id = id; this.textId = id; }); @@ -11890,6 +11895,1960 @@ function isLight(color) { return false; } } +let cssString0 = ` +code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.token.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} +`; +const prismTokenString = "#690"; +const prismTokenClassName = "#dd4a68"; +const prismTokenPunctuation = "#999"; +const prismTokenImportant = "#e90"; +const nfdiRedDarker30 = "#871528"; +const nfdiMintDarker20 = "#199b86"; +const nfdiYellowDarker20 = "#cc9a00"; +let cssString = cssString0.replace(prismTokenString, nfdiRedDarker30).replace(prismTokenClassName, nfdiMintDarker20).replace(prismTokenPunctuation, nfdiYellowDarker20).replace(prismTokenImportant, nfdiYellowDarker20); +const prismStyles = r$2`${o$5(cssString)}`; +var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; +var prism = { exports: {} }; +(function(module) { + var _self = typeof window !== "undefined" ? window : typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope ? self : {}; + /** + * Prism: Lightweight, robust, elegant syntax highlighting + * + * @license MIT + * @author Lea Verou + * @namespace + * @public + */ + var Prism2 = function(_self2) { + var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i; + var uniqueId = 0; + var plainTextGrammar = {}; + var _ = { + manual: _self2.Prism && _self2.Prism.manual, + disableWorkerMessageHandler: _self2.Prism && _self2.Prism.disableWorkerMessageHandler, + util: { + encode: function encode(tokens) { + if (tokens instanceof Token) { + return new Token(tokens.type, encode(tokens.content), tokens.alias); + } else if (Array.isArray(tokens)) { + return tokens.map(encode); + } else { + return tokens.replace(/&/g, "&").replace(/" + env.content + ""; + }; + function matchPattern(pattern, pos, text, lookbehind) { + pattern.lastIndex = pos; + var match = pattern.exec(text); + if (match && lookbehind && match[1]) { + var lookbehindLength = match[1].length; + match.index += lookbehindLength; + match[0] = match[0].slice(lookbehindLength); + } + return match; + } + function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { + for (var token in grammar) { + if (!grammar.hasOwnProperty(token) || !grammar[token]) { + continue; + } + var patterns = grammar[token]; + patterns = Array.isArray(patterns) ? patterns : [patterns]; + for (var j = 0; j < patterns.length; ++j) { + if (rematch && rematch.cause == token + "," + j) { + return; + } + var patternObj = patterns[j]; + var inside = patternObj.inside; + var lookbehind = !!patternObj.lookbehind; + var greedy = !!patternObj.greedy; + var alias = patternObj.alias; + if (greedy && !patternObj.pattern.global) { + var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0]; + patternObj.pattern = RegExp(patternObj.pattern.source, flags + "g"); + } + var pattern = patternObj.pattern || patternObj; + for (var currentNode = startNode.next, pos = startPos; currentNode !== tokenList.tail; pos += currentNode.value.length, currentNode = currentNode.next) { + if (rematch && pos >= rematch.reach) { + break; + } + var str = currentNode.value; + if (tokenList.length > text.length) { + return; + } + if (str instanceof Token) { + continue; + } + var removeCount = 1; + var match; + if (greedy) { + match = matchPattern(pattern, pos, text, lookbehind); + if (!match || match.index >= text.length) { + break; + } + var from = match.index; + var to = match.index + match[0].length; + var p = pos; + p += currentNode.value.length; + while (from >= p) { + currentNode = currentNode.next; + p += currentNode.value.length; + } + p -= currentNode.value.length; + pos = p; + if (currentNode.value instanceof Token) { + continue; + } + for (var k = currentNode; k !== tokenList.tail && (p < to || typeof k.value === "string"); k = k.next) { + removeCount++; + p += k.value.length; + } + removeCount--; + str = text.slice(pos, p); + match.index -= pos; + } else { + match = matchPattern(pattern, 0, str, lookbehind); + if (!match) { + continue; + } + } + var from = match.index; + var matchStr = match[0]; + var before = str.slice(0, from); + var after = str.slice(from + matchStr.length); + var reach = pos + str.length; + if (rematch && reach > rematch.reach) { + rematch.reach = reach; + } + var removeFrom = currentNode.prev; + if (before) { + removeFrom = addAfter(tokenList, removeFrom, before); + pos += before.length; + } + removeRange(tokenList, removeFrom, removeCount); + var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr); + currentNode = addAfter(tokenList, removeFrom, wrapped); + if (after) { + addAfter(tokenList, currentNode, after); + } + if (removeCount > 1) { + var nestedRematch = { + cause: token + "," + j, + reach + }; + matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch); + if (rematch && nestedRematch.reach > rematch.reach) { + rematch.reach = nestedRematch.reach; + } + } + } + } + } + } + function LinkedList() { + var head = { value: null, prev: null, next: null }; + var tail = { value: null, prev: head, next: null }; + head.next = tail; + this.head = head; + this.tail = tail; + this.length = 0; + } + function addAfter(list, node, value) { + var next = node.next; + var newNode = { value, prev: node, next }; + node.next = newNode; + next.prev = newNode; + list.length++; + return newNode; + } + function removeRange(list, node, count) { + var next = node.next; + for (var i = 0; i < count && next !== list.tail; i++) { + next = next.next; + } + node.next = next; + next.prev = node; + list.length -= i; + } + function toArray(list) { + var array = []; + var node = list.head.next; + while (node !== list.tail) { + array.push(node.value); + node = node.next; + } + return array; + } + if (!_self2.document) { + if (!_self2.addEventListener) { + return _; + } + if (!_.disableWorkerMessageHandler) { + _self2.addEventListener("message", function(evt) { + var message = JSON.parse(evt.data); + var lang2 = message.language; + var code = message.code; + var immediateClose = message.immediateClose; + _self2.postMessage(_.highlight(code, _.languages[lang2], lang2)); + if (immediateClose) { + _self2.close(); + } + }, false); + } + return _; + } + var script = _.util.currentScript(); + if (script) { + _.filename = script.src; + if (script.hasAttribute("data-manual")) { + _.manual = true; + } + } + function highlightAutomaticallyCallback() { + if (!_.manual) { + _.highlightAll(); + } + } + if (!_.manual) { + var readyState = document.readyState; + if (readyState === "loading" || readyState === "interactive" && script && script.defer) { + document.addEventListener("DOMContentLoaded", highlightAutomaticallyCallback); + } else { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(highlightAutomaticallyCallback); + } else { + window.setTimeout(highlightAutomaticallyCallback, 16); + } + } + } + return _; + }(_self); + if (module.exports) { + module.exports = Prism2; + } + if (typeof commonjsGlobal !== "undefined") { + commonjsGlobal.Prism = Prism2; + } + Prism2.languages.markup = { + "comment": { + pattern: //, + greedy: true + }, + "prolog": { + pattern: /<\?[\s\S]+?\?>/, + greedy: true + }, + "doctype": { + pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i, + greedy: true, + inside: { + "internal-subset": { + pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, + lookbehind: true, + greedy: true, + inside: null + }, + "string": { + pattern: /"[^"]*"|'[^']*'/, + greedy: true + }, + "punctuation": /^$|[[\]]/, + "doctype-tag": /^DOCTYPE/i, + "name": /[^\s<>'"]+/ + } + }, + "cdata": { + pattern: //i, + greedy: true + }, + "tag": { + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, + greedy: true, + inside: { + "tag": { + pattern: /^<\/?[^\s>\/]+/, + inside: { + "punctuation": /^<\/?/, + "namespace": /^[^\s>\/:]+:/ + } + }, + "special-attr": [], + "attr-value": { + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, + inside: { + "punctuation": [ + { + pattern: /^=/, + alias: "attr-equals" + }, + /"|'/ + ] + } + }, + "punctuation": /\/?>/, + "attr-name": { + pattern: /[^\s>\/]+/, + inside: { + "namespace": /^[^\s>\/:]+:/ + } + } + } + }, + "entity": [ + { + pattern: /&[\da-z]{1,8};/i, + alias: "named-entity" + }, + /&#x?[\da-f]{1,8};/i + ] + }; + Prism2.languages.markup["tag"].inside["attr-value"].inside["entity"] = Prism2.languages.markup["entity"]; + Prism2.languages.markup["doctype"].inside["internal-subset"].inside = Prism2.languages.markup; + Prism2.hooks.add("wrap", function(env) { + if (env.type === "entity") { + env.attributes["title"] = env.content.replace(/&/, "&"); + } + }); + Object.defineProperty(Prism2.languages.markup.tag, "addInlined", { + value: function addInlined(tagName, lang) { + var includedCdataInside = {}; + includedCdataInside["language-" + lang] = { + pattern: /(^$)/i, + lookbehind: true, + inside: Prism2.languages[lang] + }; + includedCdataInside["cdata"] = /^$/i; + var inside = { + "included-cdata": { + pattern: //i, + inside: includedCdataInside + } + }; + inside["language-" + lang] = { + pattern: /[\s\S]+/, + inside: Prism2.languages[lang] + }; + var def = {}; + def[tagName] = { + pattern: RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g, function() { + return tagName; + }), "i"), + lookbehind: true, + greedy: true, + inside + }; + Prism2.languages.insertBefore("markup", "cdata", def); + } + }); + Object.defineProperty(Prism2.languages.markup.tag, "addAttribute", { + value: function(attrName, lang) { + Prism2.languages.markup.tag.inside["special-attr"].push({ + pattern: RegExp(/(^|["'\s])/.source + "(?:" + attrName + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, "i"), + lookbehind: true, + inside: { + "attr-name": /^[^\s=]+/, + "attr-value": { + pattern: /=[\s\S]+/, + inside: { + "value": { + pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, + lookbehind: true, + alias: [lang, "language-" + lang], + inside: Prism2.languages[lang] + }, + "punctuation": [ + { + pattern: /^=/, + alias: "attr-equals" + }, + /"|'/ + ] + } + } + } + }); + } + }); + Prism2.languages.html = Prism2.languages.markup; + Prism2.languages.mathml = Prism2.languages.markup; + Prism2.languages.svg = Prism2.languages.markup; + Prism2.languages.xml = Prism2.languages.extend("markup", {}); + Prism2.languages.ssml = Prism2.languages.xml; + Prism2.languages.atom = Prism2.languages.xml; + Prism2.languages.rss = Prism2.languages.xml; + (function(Prism3) { + var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/; + Prism3.languages.css = { + "comment": /\/\*[\s\S]*?\*\//, + "atrule": { + pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/, + inside: { + "rule": /^@[\w-]+/, + "selector-function-argument": { + pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/, + lookbehind: true, + alias: "selector" + }, + "keyword": { + pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/, + lookbehind: true + } + } + }, + "url": { + pattern: RegExp("\\burl\\((?:" + string.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"), + greedy: true, + inside: { + "function": /^url/i, + "punctuation": /^\(|\)$/, + "string": { + pattern: RegExp("^" + string.source + "$"), + alias: "url" + } + } + }, + "selector": { + pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + string.source + ")*(?=\\s*\\{)"), + lookbehind: true + }, + "string": { + pattern: string, + greedy: true + }, + "property": { + pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i, + lookbehind: true + }, + "important": /!important\b/i, + "function": { + pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i, + lookbehind: true + }, + "punctuation": /[(){};:,]/ + }; + Prism3.languages.css["atrule"].inside.rest = Prism3.languages.css; + var markup = Prism3.languages.markup; + if (markup) { + markup.tag.addInlined("style", "css"); + markup.tag.addAttribute("style", "css"); + } + })(Prism2); + Prism2.languages.clike = { + "comment": [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true, + greedy: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + "string": { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + "class-name": { + pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { + "punctuation": /[.\\]/ + } + }, + "keyword": /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/, + "boolean": /\b(?:false|true)\b/, + "function": /\b\w+(?=\()/, + "number": /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + "operator": /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + "punctuation": /[{}[\];(),.:]/ + }; + Prism2.languages.javascript = Prism2.languages.extend("clike", { + "class-name": [ + Prism2.languages.clike["class-name"], + { + pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/, + lookbehind: true + } + ], + "keyword": [ + { + pattern: /((?:^|\})\s*)catch\b/, + lookbehind: true + }, + { + pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + lookbehind: true + } + ], + "function": /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, + "number": { + pattern: RegExp(/(^|[^\w$])/.source + "(?:" + (/NaN|Infinity/.source + "|" + /0[bB][01]+(?:_[01]+)*n?/.source + "|" + /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + /\d+(?:_\d+)*n/.source + "|" + /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source), + lookbehind: true + }, + "operator": /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ + }); + Prism2.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/; + Prism2.languages.insertBefore("javascript", "keyword", { + "regex": { + pattern: RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source), + lookbehind: true, + greedy: true, + inside: { + "regex-source": { + pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/, + lookbehind: true, + alias: "language-regex", + inside: Prism2.languages.regex + }, + "regex-delimiter": /^\/|\/$/, + "regex-flags": /^[a-z]+$/ + } + }, + "function-variable": { + pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + alias: "function" + }, + "parameter": [ + { + pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, + lookbehind: true, + inside: Prism2.languages.javascript + }, + { + pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, + lookbehind: true, + inside: Prism2.languages.javascript + }, + { + pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, + lookbehind: true, + inside: Prism2.languages.javascript + }, + { + pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, + lookbehind: true, + inside: Prism2.languages.javascript + } + ], + "constant": /\b[A-Z](?:[A-Z_]|\dx?)*\b/ + }); + Prism2.languages.insertBefore("javascript", "string", { + "hashbang": { + pattern: /^#!.*/, + greedy: true, + alias: "comment" + }, + "template-string": { + pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/, + greedy: true, + inside: { + "template-punctuation": { + pattern: /^`|`$/, + alias: "string" + }, + "interpolation": { + pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/, + lookbehind: true, + inside: { + "interpolation-punctuation": { + pattern: /^\$\{|\}$/, + alias: "punctuation" + }, + rest: Prism2.languages.javascript + } + }, + "string": /[\s\S]+/ + } + }, + "string-property": { + pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m, + lookbehind: true, + greedy: true, + alias: "property" + } + }); + Prism2.languages.insertBefore("javascript", "operator", { + "literal-property": { + pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m, + lookbehind: true, + alias: "property" + } + }); + if (Prism2.languages.markup) { + Prism2.languages.markup.tag.addInlined("script", "javascript"); + Prism2.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source, "javascript"); + } + Prism2.languages.js = Prism2.languages.javascript; + (function() { + if (typeof Prism2 === "undefined" || typeof document === "undefined") { + return; + } + if (!Element.prototype.matches) { + Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + } + var LOADING_MESSAGE = "Loading\u2026"; + var FAILURE_MESSAGE = function(status, message) { + return "\u2716 Error " + status + " while fetching file: " + message; + }; + var FAILURE_EMPTY_MESSAGE = "\u2716 Error: File does not exist or is empty"; + var EXTENSIONS = { + "js": "javascript", + "py": "python", + "rb": "ruby", + "ps1": "powershell", + "psm1": "powershell", + "sh": "bash", + "bat": "batch", + "h": "c", + "tex": "latex" + }; + var STATUS_ATTR = "data-src-status"; + var STATUS_LOADING = "loading"; + var STATUS_LOADED = "loaded"; + var STATUS_FAILED = "failed"; + var SELECTOR = "pre[data-src]:not([" + STATUS_ATTR + '="' + STATUS_LOADED + '"]):not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])'; + function loadFile(src, success, error) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", src, true); + xhr.onreadystatechange = function() { + if (xhr.readyState == 4) { + if (xhr.status < 400 && xhr.responseText) { + success(xhr.responseText); + } else { + if (xhr.status >= 400) { + error(FAILURE_MESSAGE(xhr.status, xhr.statusText)); + } else { + error(FAILURE_EMPTY_MESSAGE); + } + } + } + }; + xhr.send(null); + } + function parseRange(range) { + var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || ""); + if (m) { + var start = Number(m[1]); + var comma = m[2]; + var end = m[3]; + if (!comma) { + return [start, start]; + } + if (!end) { + return [start, void 0]; + } + return [start, Number(end)]; + } + return void 0; + } + Prism2.hooks.add("before-highlightall", function(env) { + env.selector += ", " + SELECTOR; + }); + Prism2.hooks.add("before-sanity-check", function(env) { + var pre = env.element; + if (pre.matches(SELECTOR)) { + env.code = ""; + pre.setAttribute(STATUS_ATTR, STATUS_LOADING); + var code = pre.appendChild(document.createElement("CODE")); + code.textContent = LOADING_MESSAGE; + var src = pre.getAttribute("data-src"); + var language = env.language; + if (language === "none") { + var extension = (/\.(\w+)$/.exec(src) || [, "none"])[1]; + language = EXTENSIONS[extension] || extension; + } + Prism2.util.setLanguage(code, language); + Prism2.util.setLanguage(pre, language); + var autoloader = Prism2.plugins.autoloader; + if (autoloader) { + autoloader.loadLanguages(language); + } + loadFile(src, function(text) { + pre.setAttribute(STATUS_ATTR, STATUS_LOADED); + var range = parseRange(pre.getAttribute("data-range")); + if (range) { + var lines = text.split(/\r\n?|\n/g); + var start = range[0]; + var end = range[1] == null ? lines.length : range[1]; + if (start < 0) { + start += lines.length; + } + start = Math.max(0, Math.min(start - 1, lines.length)); + if (end < 0) { + end += lines.length; + } + end = Math.max(0, Math.min(end, lines.length)); + text = lines.slice(start, end).join("\n"); + if (!pre.hasAttribute("data-start")) { + pre.setAttribute("data-start", String(start + 1)); + } + } + code.textContent = text; + Prism2.highlightElement(code); + }, function(error) { + pre.setAttribute(STATUS_ATTR, STATUS_FAILED); + code.textContent = error; + }); + } + }); + Prism2.plugins.fileHighlight = { + highlight: function highlight(container) { + var elements = (container || document).querySelectorAll(SELECTOR); + for (var i = 0, element; element = elements[i++]; ) { + Prism2.highlightElement(element); + } + } + }; + var logged = false; + Prism2.fileHighlight = function() { + if (!logged) { + console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."); + logged = true; + } + Prism2.plugins.fileHighlight.highlight.apply(this, arguments); + }; + })(); +})(prism); +(function(Prism2) { + Prism2.languages.typescript = Prism2.languages.extend("javascript", { + "class-name": { + pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/, + lookbehind: true, + greedy: true, + inside: null + }, + "builtin": /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/ + }); + Prism2.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/, /\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/, /\btype\b(?=\s*(?:[\{*]|$))/); + delete Prism2.languages.typescript["parameter"]; + delete Prism2.languages.typescript["literal-property"]; + var typeInside = Prism2.languages.extend("typescript", {}); + delete typeInside["class-name"]; + Prism2.languages.typescript["class-name"].inside = typeInside; + Prism2.languages.insertBefore("typescript", "function", { + "decorator": { + pattern: /@[$\w\xA0-\uFFFF]+/, + inside: { + "at": { + pattern: /^@/, + alias: "operator" + }, + "function": /^[\s\S]+/ + } + }, + "generic-function": { + pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/, + greedy: true, + inside: { + "function": /^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/, + "generic": { + pattern: /<[\s\S]+/, + alias: "class-name", + inside: typeInside + } + } + } + }); + Prism2.languages.ts = Prism2.languages.typescript; +})(Prism); +Prism.languages.fsharp = Prism.languages.extend("clike", { + "comment": [ + { + pattern: /(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/, + lookbehind: true, + greedy: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + "string": { + pattern: /(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/, + greedy: true + }, + "class-name": { + pattern: /(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/, + lookbehind: true, + inside: { + "operator": /->|\*/, + "punctuation": /\./ + } + }, + "keyword": /\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/, + "number": [ + /\b0x[\da-fA-F]+(?:LF|lf|un)?\b/, + /\b0b[01]+(?:uy|y)?\b/, + /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i, + /\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/ + ], + "operator": /([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/ +}); +Prism.languages.insertBefore("fsharp", "keyword", { + "preprocessor": { + pattern: /(^[\t ]*)#.*/m, + lookbehind: true, + alias: "property", + inside: { + "directive": { + pattern: /(^#)\b(?:else|endif|if|light|line|nowarn)\b/, + lookbehind: true, + alias: "keyword" + } + } + } +}); +Prism.languages.insertBefore("fsharp", "punctuation", { + "computation-expression": { + pattern: /\b[_a-z]\w*(?=\s*\{)/i, + alias: "keyword" + } +}); +Prism.languages.insertBefore("fsharp", "string", { + "annotation": { + pattern: /\[<.+?>\]/, + greedy: true, + inside: { + "punctuation": /^\[<|>\]$/, + "class-name": { + pattern: /^\w+$|(^|;\s*)[A-Z]\w*(?=\()/, + lookbehind: true + }, + "annotation-content": { + pattern: /[\s\S]+/, + inside: Prism.languages.fsharp + } + } + }, + "char": { + pattern: /'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/, + greedy: true + } +}); +(function(Prism2) { + var envVars = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b"; + var commandAfterHeredoc = { + pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, + lookbehind: true, + alias: "punctuation", + inside: null + }; + var insideString = { + "bash": commandAfterHeredoc, + "environment": { + pattern: RegExp("\\$" + envVars), + alias: "constant" + }, + "variable": [ + { + pattern: /\$?\(\([\s\S]+?\)\)/, + greedy: true, + inside: { + "variable": [ + { + pattern: /(^\$\(\([\s\S]+)\)\)/, + lookbehind: true + }, + /^\$\(\(/ + ], + "number": /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, + "operator": /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, + "punctuation": /\(\(?|\)\)?|,|;/ + } + }, + { + pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, + greedy: true, + inside: { + "variable": /^\$\(|^`|\)$|`$/ + } + }, + { + pattern: /\$\{[^}]+\}/, + greedy: true, + inside: { + "operator": /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, + "punctuation": /[\[\]]/, + "environment": { + pattern: RegExp("(\\{)" + envVars), + lookbehind: true, + alias: "constant" + } + } + }, + /\$(?:\w+|[#?*!@$])/ + ], + "entity": /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/ + }; + Prism2.languages.bash = { + "shebang": { + pattern: /^#!\s*\/.*/, + alias: "important" + }, + "comment": { + pattern: /(^|[^"{\\$])#.*/, + lookbehind: true + }, + "function-name": [ + { + pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, + lookbehind: true, + alias: "function" + }, + { + pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, + alias: "function" + } + ], + "for-or-select": { + pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, + alias: "variable", + lookbehind: true + }, + "assign-left": { + pattern: /(^|[\s;|&]|[<>]\()\w+(?=\+?=)/, + inside: { + "environment": { + pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + envVars), + lookbehind: true, + alias: "constant" + } + }, + alias: "variable", + lookbehind: true + }, + "string": [ + { + pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, + lookbehind: true, + greedy: true, + inside: insideString + }, + { + pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, + lookbehind: true, + greedy: true, + inside: { + "bash": commandAfterHeredoc + } + }, + { + pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, + lookbehind: true, + greedy: true, + inside: insideString + }, + { + pattern: /(^|[^$\\])'[^']*'/, + lookbehind: true, + greedy: true + }, + { + pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, + greedy: true, + inside: { + "entity": insideString.entity + } + } + ], + "environment": { + pattern: RegExp("\\$?" + envVars), + alias: "constant" + }, + "variable": insideString.variable, + "function": { + pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, + lookbehind: true + }, + "keyword": { + pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, + lookbehind: true + }, + "builtin": { + pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, + lookbehind: true, + alias: "class-name" + }, + "boolean": { + pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, + lookbehind: true + }, + "file-descriptor": { + pattern: /\B&\d\b/, + alias: "important" + }, + "operator": { + pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, + inside: { + "file-descriptor": { + pattern: /^\d/, + alias: "important" + } + } + }, + "punctuation": /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, + "number": { + pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, + lookbehind: true + } + }; + commandAfterHeredoc.inside = Prism2.languages.bash; + var toBeCopied = [ + "comment", + "function-name", + "for-or-select", + "assign-left", + "string", + "environment", + "function", + "keyword", + "builtin", + "boolean", + "file-descriptor", + "operator", + "punctuation", + "number" + ]; + var inside = insideString.variable[1].inside; + for (var i = 0; i < toBeCopied.length; i++) { + inside[toBeCopied[i]] = Prism2.languages.bash[toBeCopied[i]]; + } + Prism2.languages.shell = Prism2.languages.bash; +})(Prism); +(function(Prism2) { + var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source; + function createInline(pattern) { + pattern = pattern.replace(//g, function() { + return inner; + }); + return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + "(?:" + pattern + ")"); + } + var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source; + var tableRow = /\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g, function() { + return tableCell; + }); + var tableLine = /\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source; + Prism2.languages.markdown = Prism2.languages.extend("markup", {}); + Prism2.languages.insertBefore("markdown", "prolog", { + "front-matter-block": { + pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/, + lookbehind: true, + greedy: true, + inside: { + "punctuation": /^---|---$/, + "front-matter": { + pattern: /\S+(?:\s+\S+)*/, + alias: ["yaml", "language-yaml"], + inside: Prism2.languages.yaml + } + } + }, + "blockquote": { + pattern: /^>(?:[\t ]*>)*/m, + alias: "punctuation" + }, + "table": { + pattern: RegExp("^" + tableRow + tableLine + "(?:" + tableRow + ")*", "m"), + inside: { + "table-data-rows": { + pattern: RegExp("^(" + tableRow + tableLine + ")(?:" + tableRow + ")*$"), + lookbehind: true, + inside: { + "table-data": { + pattern: RegExp(tableCell), + inside: Prism2.languages.markdown + }, + "punctuation": /\|/ + } + }, + "table-line": { + pattern: RegExp("^(" + tableRow + ")" + tableLine + "$"), + lookbehind: true, + inside: { + "punctuation": /\||:?-{3,}:?/ + } + }, + "table-header-row": { + pattern: RegExp("^" + tableRow + "$"), + inside: { + "table-header": { + pattern: RegExp(tableCell), + alias: "important", + inside: Prism2.languages.markdown + }, + "punctuation": /\|/ + } + } + } + }, + "code": [ + { + pattern: /((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/, + lookbehind: true, + alias: "keyword" + }, + { + pattern: /^```[\s\S]*?^```$/m, + greedy: true, + inside: { + "code-block": { + pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m, + lookbehind: true + }, + "code-language": { + pattern: /^(```).+/, + lookbehind: true + }, + "punctuation": /```/ + } + } + ], + "title": [ + { + pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m, + alias: "important", + inside: { + punctuation: /==+$|--+$/ + } + }, + { + pattern: /(^\s*)#.+/m, + lookbehind: true, + alias: "important", + inside: { + punctuation: /^#+|#+$/ + } + } + ], + "hr": { + pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m, + lookbehind: true, + alias: "punctuation" + }, + "list": { + pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m, + lookbehind: true, + alias: "punctuation" + }, + "url-reference": { + pattern: /!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/, + inside: { + "variable": { + pattern: /^(!?\[)[^\]]+/, + lookbehind: true + }, + "string": /(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/, + "punctuation": /^[\[\]!:]|[<>]/ + }, + alias: "url" + }, + "bold": { + pattern: createInline(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source), + lookbehind: true, + greedy: true, + inside: { + "content": { + pattern: /(^..)[\s\S]+(?=..$)/, + lookbehind: true, + inside: {} + }, + "punctuation": /\*\*|__/ + } + }, + "italic": { + pattern: createInline(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source), + lookbehind: true, + greedy: true, + inside: { + "content": { + pattern: /(^.)[\s\S]+(?=.$)/, + lookbehind: true, + inside: {} + }, + "punctuation": /[*_]/ + } + }, + "strike": { + pattern: createInline(/(~~?)(?:(?!~))+\2/.source), + lookbehind: true, + greedy: true, + inside: { + "content": { + pattern: /(^~~?)[\s\S]+(?=\1$)/, + lookbehind: true, + inside: {} + }, + "punctuation": /~~?/ + } + }, + "code-snippet": { + pattern: /(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/, + lookbehind: true, + greedy: true, + alias: ["code", "keyword"] + }, + "url": { + pattern: createInline(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source), + lookbehind: true, + greedy: true, + inside: { + "operator": /^!/, + "content": { + pattern: /(^\[)[^\]]+(?=\])/, + lookbehind: true, + inside: {} + }, + "variable": { + pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/, + lookbehind: true + }, + "url": { + pattern: /(^\]\()[^\s)]+/, + lookbehind: true + }, + "string": { + pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/, + lookbehind: true + } + } + } + }); + ["url", "bold", "italic", "strike"].forEach(function(token) { + ["url", "bold", "italic", "strike", "code-snippet"].forEach(function(inside) { + if (token !== inside) { + Prism2.languages.markdown[token].inside.content.inside[inside] = Prism2.languages.markdown[inside]; + } + }); + }); + Prism2.hooks.add("after-tokenize", function(env) { + if (env.language !== "markdown" && env.language !== "md") { + return; + } + function walkTokens(tokens) { + if (!tokens || typeof tokens === "string") { + return; + } + for (var i = 0, l = tokens.length; i < l; i++) { + var token = tokens[i]; + if (token.type !== "code") { + walkTokens(token.content); + continue; + } + var codeLang = token.content[1]; + var codeBlock = token.content[3]; + if (codeLang && codeBlock && codeLang.type === "code-language" && codeBlock.type === "code-block" && typeof codeLang.content === "string") { + var lang = codeLang.content.replace(/\b#/g, "sharp").replace(/\b\+\+/g, "pp"); + lang = (/[a-z][\w-]*/i.exec(lang) || [""])[0].toLowerCase(); + var alias = "language-" + lang; + if (!codeBlock.alias) { + codeBlock.alias = [alias]; + } else if (typeof codeBlock.alias === "string") { + codeBlock.alias = [codeBlock.alias, alias]; + } else { + codeBlock.alias.push(alias); + } + } + } + } + walkTokens(env.tokens); + }); + Prism2.hooks.add("wrap", function(env) { + if (env.type !== "code-block") { + return; + } + var codeLang = ""; + for (var i = 0, l = env.classes.length; i < l; i++) { + var cls = env.classes[i]; + var match = /language-(.+)/.exec(cls); + if (match) { + codeLang = match[1]; + break; + } + } + var grammar = Prism2.languages[codeLang]; + if (!grammar) { + if (codeLang && codeLang !== "none" && Prism2.plugins.autoloader) { + var id = "md-" + new Date().valueOf() + "-" + Math.floor(Math.random() * 1e16); + env.attributes["id"] = id; + Prism2.plugins.autoloader.loadLanguages(codeLang, function() { + var ele = document.getElementById(id); + if (ele) { + ele.innerHTML = Prism2.highlight(ele.textContent, Prism2.languages[codeLang], codeLang); + } + }); + } + } else { + env.content = Prism2.highlight(textContent(env.content), grammar, codeLang); + } + }); + var tagPattern = RegExp(Prism2.languages.markup.tag.pattern.source, "gi"); + var KNOWN_ENTITY_NAMES = { + "amp": "&", + "lt": "<", + "gt": ">", + "quot": '"' + }; + var fromCodePoint = String.fromCodePoint || String.fromCharCode; + function textContent(html2) { + var text = html2.replace(tagPattern, ""); + text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function(m, code) { + code = code.toLowerCase(); + if (code[0] === "#") { + var value; + if (code[1] === "x") { + value = parseInt(code.slice(2), 16); + } else { + value = Number(code.slice(1)); + } + return fromCodePoint(value); + } else { + var known = KNOWN_ENTITY_NAMES[code]; + if (known) { + return known; + } + return m; + } + }); + return text; + } + Prism2.languages.md = Prism2.languages.markdown; +})(Prism); +(function(Prism2) { + function replace(pattern, replacements) { + return pattern.replace(/<<(\d+)>>/g, function(m, index) { + return "(?:" + replacements[+index] + ")"; + }); + } + function re(pattern, replacements, flags) { + return RegExp(replace(pattern, replacements), flags || ""); + } + function nested(pattern, depthLog2) { + for (var i = 0; i < depthLog2; i++) { + pattern = pattern.replace(/<>/g, function() { + return "(?:" + pattern + ")"; + }); + } + return pattern.replace(/<>/g, "[^\\s\\S]"); + } + var keywordKinds = { + type: "bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void", + typeDeclaration: "class enum interface record struct", + contextual: "add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)", + other: "abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield" + }; + function keywordsToPattern(words) { + return "\\b(?:" + words.trim().replace(/ /g, "|") + ")\\b"; + } + var typeDeclarationKeywords = keywordsToPattern(keywordKinds.typeDeclaration); + var keywords = RegExp(keywordsToPattern(keywordKinds.type + " " + keywordKinds.typeDeclaration + " " + keywordKinds.contextual + " " + keywordKinds.other)); + var nonTypeKeywords = keywordsToPattern(keywordKinds.typeDeclaration + " " + keywordKinds.contextual + " " + keywordKinds.other); + var nonContextualKeywords = keywordsToPattern(keywordKinds.type + " " + keywordKinds.typeDeclaration + " " + keywordKinds.other); + var generic = nested(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source, 2); + var nestedRound = nested(/\((?:[^()]|<>)*\)/.source, 2); + var name = /@?\b[A-Za-z_]\w*\b/.source; + var genericName = replace(/<<0>>(?:\s*<<1>>)?/.source, [name, generic]); + var identifier = replace(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source, [nonTypeKeywords, genericName]); + var array = /\[\s*(?:,\s*)*\]/.source; + var typeExpressionWithoutTuple = replace(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [identifier, array]); + var tupleElement = replace(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [generic, nestedRound, array]); + var tuple = replace(/\(<<0>>+(?:,<<0>>+)+\)/.source, [tupleElement]); + var typeExpression = replace(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [tuple, identifier, array]); + var typeInside = { + "keyword": keywords, + "punctuation": /[<>()?,.:[\]]/ + }; + var character = /'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source; + var regularString = /"(?:\\.|[^\\"\r\n])*"/.source; + var verbatimString = /@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source; + Prism2.languages.csharp = Prism2.languages.extend("clike", { + "string": [ + { + pattern: re(/(^|[^$\\])<<0>>/.source, [verbatimString]), + lookbehind: true, + greedy: true + }, + { + pattern: re(/(^|[^@$\\])<<0>>/.source, [regularString]), + lookbehind: true, + greedy: true + } + ], + "class-name": [ + { + pattern: re(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [identifier]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [name, typeExpression]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\busing\s+)<<0>>(?=\s*=)/.source, [name]), + lookbehind: true + }, + { + pattern: re(/(\b<<0>>\s+)<<1>>/.source, [typeDeclarationKeywords, genericName]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\bcatch\s*\(\s*)<<0>>/.source, [identifier]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/(\bwhere\s+)<<0>>/.source, [name]), + lookbehind: true + }, + { + pattern: re(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [typeExpressionWithoutTuple]), + lookbehind: true, + inside: typeInside + }, + { + pattern: re(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [typeExpression, nonContextualKeywords, name]), + inside: typeInside + } + ], + "keyword": keywords, + "number": /(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i, + "operator": />>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/, + "punctuation": /\?\.?|::|[{}[\];(),.:]/ + }); + Prism2.languages.insertBefore("csharp", "number", { + "range": { + pattern: /\.\./, + alias: "operator" + } + }); + Prism2.languages.insertBefore("csharp", "punctuation", { + "named-parameter": { + pattern: re(/([(,]\s*)<<0>>(?=\s*:)/.source, [name]), + lookbehind: true, + alias: "punctuation" + } + }); + Prism2.languages.insertBefore("csharp", "class-name", { + "namespace": { + pattern: re(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source, [name]), + lookbehind: true, + inside: { + "punctuation": /\./ + } + }, + "type-expression": { + pattern: re(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [nestedRound]), + lookbehind: true, + alias: "class-name", + inside: typeInside + }, + "return-type": { + pattern: re(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [typeExpression, identifier]), + inside: typeInside, + alias: "class-name" + }, + "constructor-invocation": { + pattern: re(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [typeExpression]), + lookbehind: true, + inside: typeInside, + alias: "class-name" + }, + "generic-method": { + pattern: re(/<<0>>\s*<<1>>(?=\s*\()/.source, [name, generic]), + inside: { + "function": re(/^<<0>>/.source, [name]), + "generic": { + pattern: RegExp(generic), + alias: "class-name", + inside: typeInside + } + } + }, + "type-list": { + pattern: re(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [typeDeclarationKeywords, genericName, name, typeExpression, keywords.source, nestedRound, /\bnew\s*\(\s*\)/.source]), + lookbehind: true, + inside: { + "record-arguments": { + pattern: re(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source, [genericName, nestedRound]), + lookbehind: true, + greedy: true, + inside: Prism2.languages.csharp + }, + "keyword": keywords, + "class-name": { + pattern: RegExp(typeExpression), + greedy: true, + inside: typeInside + }, + "punctuation": /[,()]/ + } + }, + "preprocessor": { + pattern: /(^[\t ]*)#.*/m, + lookbehind: true, + alias: "property", + inside: { + "directive": { + pattern: /(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/, + lookbehind: true, + alias: "keyword" + } + } + } + }); + var regularStringOrCharacter = regularString + "|" + character; + var regularStringCharacterOrComment = replace(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source, [regularStringOrCharacter]); + var roundExpression = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); + var attrTarget = /\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source; + var attr = replace(/<<0>>(?:\s*\(<<1>>*\))?/.source, [identifier, roundExpression]); + Prism2.languages.insertBefore("csharp", "class-name", { + "attribute": { + pattern: re(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source, [attrTarget, attr]), + lookbehind: true, + greedy: true, + inside: { + "target": { + pattern: re(/^<<0>>(?=\s*:)/.source, [attrTarget]), + alias: "keyword" + }, + "attribute-arguments": { + pattern: re(/\(<<0>>*\)/.source, [roundExpression]), + inside: Prism2.languages.csharp + }, + "class-name": { + pattern: RegExp(identifier), + inside: { + "punctuation": /\./ + } + }, + "punctuation": /[:,]/ + } + } + }); + var formatString = /:[^}\r\n]+/.source; + var mInterpolationRound = nested(replace(/[^"'/()]|<<0>>|\(<>*\)/.source, [regularStringCharacterOrComment]), 2); + var mInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [mInterpolationRound, formatString]); + var sInterpolationRound = nested(replace(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source, [regularStringOrCharacter]), 2); + var sInterpolation = replace(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source, [sInterpolationRound, formatString]); + function createInterpolationInside(interpolation, interpolationRound) { + return { + "interpolation": { + pattern: re(/((?:^|[^{])(?:\{\{)*)<<0>>/.source, [interpolation]), + lookbehind: true, + inside: { + "format-string": { + pattern: re(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source, [interpolationRound, formatString]), + lookbehind: true, + inside: { + "punctuation": /^:/ + } + }, + "punctuation": /^\{|\}$/, + "expression": { + pattern: /[\s\S]+/, + alias: "language-csharp", + inside: Prism2.languages.csharp + } + } + }, + "string": /[\s\S]+/ + }; + } + Prism2.languages.insertBefore("csharp", "string", { + "interpolation-string": [ + { + pattern: re(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source, [mInterpolation]), + lookbehind: true, + greedy: true, + inside: createInterpolationInside(mInterpolation, mInterpolationRound) + }, + { + pattern: re(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source, [sInterpolation]), + lookbehind: true, + greedy: true, + inside: createInterpolationInside(sInterpolation, sInterpolationRound) + } + ], + "char": { + pattern: RegExp(character), + greedy: true + } + }); + Prism2.languages.dotnet = Prism2.languages.cs = Prism2.languages.csharp; +})(Prism); +Prism.languages.python = { + "comment": { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + greedy: true + }, + "string-interpolation": { + pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, + greedy: true, + inside: { + "interpolation": { + pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/, + lookbehind: true, + inside: { + "format-spec": { + pattern: /(:)[^:(){}]+(?=\}$)/, + lookbehind: true + }, + "conversion-option": { + pattern: /![sra](?=[:}]$)/, + alias: "punctuation" + }, + rest: null + } + }, + "string": /[\s\S]+/ + } + }, + "triple-quoted-string": { + pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i, + greedy: true, + alias: "string" + }, + "string": { + pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, + greedy: true + }, + "function": { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, + lookbehind: true + }, + "class-name": { + pattern: /(\bclass\s+)\w+/i, + lookbehind: true + }, + "decorator": { + pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m, + lookbehind: true, + alias: ["annotation", "punctuation"], + inside: { + "punctuation": /\./ + } + }, + "keyword": /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, + "builtin": /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, + "boolean": /\b(?:False|None|True)\b/, + "number": /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i, + "operator": /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + "punctuation": /[{}[\];(),.:]/ +}; +Prism.languages.python["string-interpolation"].inside["interpolation"].inside.rest = Prism.languages.python; +Prism.languages.py = Prism.languages.python; var __defProp$2 = Object.defineProperty; var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor; var __decorateClass$2 = (decorators, target, key, kind) => { @@ -11901,10 +13860,18 @@ var __decorateClass$2 = (decorators, target, key, kind) => { __defProp$2(target, key, result); return result; }; +function suggestedHighlight(code, language) { + if (prism.exports.languages[language]) { + return prism.exports.highlight(code, prism.exports.languages[language], language); + } else { + console.log("grammar not found"); + return prism.exports.util.encode(code).toString(); + } +} let Code = class extends s$1 { render() { return $` -
    +
    ${o(this.highlightedCode)}
    `; } fallbackCopyTextToClipboard(text) { @@ -11941,20 +13908,25 @@ let Code = class extends s$1 { const newC = isLight(customBGC) ? "black" : "white"; this.style.setProperty("--code-text-color", newC); } + const languageArr = this.className.match(/language-[a-z]+/); + const language = languageArr ? languageArr[0] : "language-"; let c = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("code"); + c == null ? void 0 : c.classList.add(language); if (c != void 0 && customBGC !== "") { const newC = isLight(customBGC) ? "black" : "white"; c.style.color = newC; } + this.highlightedCode = suggestedHighlight(this.innerHTML, language.replace("language-", "")); this.requestUpdate(); }); } }; Code.styles = [ bulmaStyles, + prismStyles, r$2` - pre { - background-color: var(--outside-background-color,#F8F8FF); + /* pre { + background-color: var(--outside-background-color,${nfdiWhite}); border: 1px solid #ddd; border-left: 3px solid var(--accent-text-color,${nfdiLightblue}); color: ${nfdiBlack}; @@ -11965,25 +13937,32 @@ Code.styles = [ margin-bottom: 1.6em; max-width: 100%; overflow: auto; - padding: 1em 1.5em; + padding: 1em 1.5em; display: block; word-wrap: break-word; position: relative - } + } */ .copybutton { position: absolute; right: 0; top: 0; - border-left: 1px solid var(--element-text-color,#F8F8FF) !important; - border-bottom: 1px solid var(--element-text-color,#F8F8FF) !important; + border-left: 1px solid var(--element-text-color,${nfdiWhite}) !important; + border-bottom: 1px solid var(--element-text-color,${nfdiWhite}) !important; } .copybutton:active { - box-shadow: -1 1 0 1px var(--element-text-color,#F8F8FF) !important; + box-shadow: -1 1 0 1px var(--element-text-color,${nfdiWhite}) !important; + } + + slot { + display: none } ` ]; +__decorateClass$2([ + e$3() +], Code.prototype, "highlightedCode", 2); Code = __decorateClass$2([ n$2("nfdi-code") ], Code); @@ -12203,7 +14182,7 @@ let SidebarElement = class extends s$1 { headers.filter(filterExistingNFDIHeaders).forEach((header0) => { const header = header0; const distanceTopHeader = header.offsetTop; - if (scrollY + 50 >= distanceTopHeader) { + if (scrollY + 200 >= distanceTopHeader) { current = "#" + header.id; } }); diff --git a/client/loaders/docsloader.fsx b/client/loaders/docsloader.fsx index 4ddbc04..840ddea 100644 --- a/client/loaders/docsloader.fsx +++ b/client/loaders/docsloader.fsx @@ -1,7 +1,7 @@ #r "../_lib/Fornax.Core.dll" #r "../_lib/Markdig.dll" // This can be used to access local .nupkg, thanks to the nuget.config file. -#r "nuget: Nfdi4Plants.Fornax, 0.1.0" +#r "nuget: Nfdi4Plants.Fornax, 0.2.0" open System.IO open Fornax.Nfdi4Plants diff --git a/package-lock.json b/package-lock.json index 8e8459c..c5c4a99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0", "license": "ISC", "dependencies": { - "@nfdi4plants/web-components": "^0.5.2", + "@nfdi4plants/web-components": "^0.5.6", "bulma": "^0.9.2" }, "devDependencies": { @@ -23,11 +23,12 @@ "integrity": "sha512-A2e18XzPMrIh35nhIdE4uoqRzoIpEU5vZYuQN4S3Ee1zkGdYC27DP12pewbw/RLgPHzaE4kx/YqxMzebOpm0dA==" }, "node_modules/@nfdi4plants/web-components": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nfdi4plants/web-components/-/web-components-0.5.2.tgz", - "integrity": "sha512-x/0UD7lxfJxWQLlKughEzHHa0j8vbBBHTt4Ligxy3lxjwZ+3E2wfmzJwjC9nZCcO3FlibDO3nbohF8SgjznriA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@nfdi4plants/web-components/-/web-components-0.5.6.tgz", + "integrity": "sha512-QXSuLdqiEBcErRPkJj3Np2sBry7Vc1t893D2sO83lQPDzDB4zI1NfC6jAKDcEbaUSIPKjmzNDHlBy77wNd7trQ==", "dependencies": { - "lit": "^2.0.2" + "lit": "^2.0.2", + "prismjs": "^1.28.0" } }, "node_modules/@rollup/plugin-node-resolve": { @@ -232,6 +233,14 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/prismjs": { + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz", + "integrity": "sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==", + "engines": { + "node": ">=6" + } + }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -284,11 +293,12 @@ "integrity": "sha512-A2e18XzPMrIh35nhIdE4uoqRzoIpEU5vZYuQN4S3Ee1zkGdYC27DP12pewbw/RLgPHzaE4kx/YqxMzebOpm0dA==" }, "@nfdi4plants/web-components": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/@nfdi4plants/web-components/-/web-components-0.5.2.tgz", - "integrity": "sha512-x/0UD7lxfJxWQLlKughEzHHa0j8vbBBHTt4Ligxy3lxjwZ+3E2wfmzJwjC9nZCcO3FlibDO3nbohF8SgjznriA==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/@nfdi4plants/web-components/-/web-components-0.5.6.tgz", + "integrity": "sha512-QXSuLdqiEBcErRPkJj3Np2sBry7Vc1t893D2sO83lQPDzDB4zI1NfC6jAKDcEbaUSIPKjmzNDHlBy77wNd7trQ==", "requires": { - "lit": "^2.0.2" + "lit": "^2.0.2", + "prismjs": "^1.28.0" } }, "@rollup/plugin-node-resolve": { @@ -450,6 +460,11 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, + "prismjs": { + "version": "1.28.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.28.0.tgz", + "integrity": "sha512-8aaXdYvl1F7iC7Xm1spqSaY/OJBpYW3v+KJ+F17iYxvdc8sfjW194COK5wVhMZX45tGteiBQgdvD/nhxcRwylw==" + }, "resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", diff --git a/package.json b/package.json index 8569a70..f9d9bac 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ }, "homepage": "https://github.com/Freymaurer/nfdi4plants-fornax-template#readme", "dependencies": { - "@nfdi4plants/web-components": "^0.5.2", + "@nfdi4plants/web-components": "^0.5.6", "bulma": "^0.9.2" }, "devDependencies": { diff --git a/rollup.config.js b/rollup.config.js index 906c01d..cefcd3a 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -2,9 +2,9 @@ import { nodeResolve } from '@rollup/plugin-node-resolve'; // https://rollupjs.org/guide/en/#configuration-files export default { - input: 'src/js/main.js', + input: 'client/js/main.js', output: { - file: 'src/js/bundle.js', + file: 'client/js/bundle.js', format: 'cjs' }, // https://github.com/rollup/plugins/tree/master/packages/node-resolve