diff --git a/astro.config.mts b/astro.config.mts
index 3d0a3be..3607002 100644
--- a/astro.config.mts
+++ b/astro.config.mts
@@ -1,221 +1,23 @@
-// @ts-check
-
import { defineConfig } from "astro/config"
import { SITE_URL } from "./src/consts"
import vue from "@astrojs/vue"
-import { visit } from "unist-util-visit"
import tailwind from "@astrojs/tailwind"
import react from "@astrojs/react"
-import md5 from "md5"
-import { type RehypePlugin } from "@astrojs/markdown-remark"
-import path from "path"
-import { convertImageToBase64URL } from "./src/utils/image"
-
-function pipeline() {
- return [
- () => tree => {
- visit(tree, "element", (node, index) => {
- if (node.tagName === "p" && node.children[0].tagName === "img") {
- node.tagName = "figure"
- let img = node.children[0]
- let sign = md5(img.properties.src)
- let data = img.properties.alt.split("|")
- let alt = data[0]
- let size = "big"
- if (data.length > 1) {
- size = data[1]
- }
- let classes = ["image component image-full-bleed body-copy-wide nr-scroll-animation nr-scroll-animation--on"]
- classes.push(`image-${size}`)
- node.properties.className = classes
- node.children = [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["component-content"],
- },
- children: [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["image-share-sheet"],
- },
- children: [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: [`image image-loaded image-asset image-${sign}`],
- id: `lht${sign}`,
- },
- children: [
- {
- type: "element",
- tagName: "picture",
- properties: {
- className: ["picture"],
- },
- children: [
- {
- type: "element",
- tagName: "img",
- properties: {
- src: img.properties.src,
- alt: alt,
- className: ["picture-image"],
- },
- },
- ],
- },
- ],
- },
- ],
- },
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["image-description"],
- },
- children: [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["image-caption"],
- },
- children: [
- {
- type: "text",
- value: alt,
- },
- ],
- },
- ],
- },
- ],
- },
- ]
- }
- })
- },
- () => tree => {
- tree.children.forEach(node => {
- if (node.type === "raw") {
- node.value = `
`
- // node.value = node.value.replace(/astro-code/g, 'astro-code')
- }
- })
- },
- () => tree => {
- for (let i = 0; i < tree.children.length; i++) {
- const node = tree.children[i]
- if (node.type === "element" && ["p", "h1", "h2", "h3", "h4", "h5", "h6", "table"].includes(node.tagName)) {
- let next = tree.children[i + 1]
- const nodes = [node]
- while (next && !["figure"].includes(next.tagName) && next.type != "raw") {
- nodes.push(next)
- next = tree.children[tree.children.indexOf(next) + 1]
- }
- if (nodes.length > 1) {
- // rename label
- nodes.forEach(node => {
- if (node.tagName === "p") {
- node.properties.className = ["page-body-copy"]
- node.tagName = "div"
- }
- if (["h1", "h2", "h3", "h4", "h5", "h6"].includes(node.tagName)) {
- node.properties.className = ["page-body-header"]
- }
- })
- tree.children.splice(i, nodes.length, {
- type: "element",
- tagName: "div",
- properties: {
- className: ["page-body text component"],
- },
- children: [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["component-content"],
- },
- children: nodes,
- },
- ],
- })
- }
- }
- }
- },
- () => tree => {
- const len = tree.children.length
- for (let index = 0; index < len; index++) {
- const node = tree.children[index]
- if (node.type === "element" && node.tagName === "figure") {
- tree.children.splice(index, 0, {
- type: "element",
- tagName: "div",
- properties: {
- className: ["tertiary-nav component"],
- },
- children: [
- {
- type: "element",
- tagName: "div",
- properties: {
- className: ["component-content"],
- },
- },
- ],
- })
- index++
- }
- }
- },
- ]
-}
-
-const handleLocalCoverPlugin: RehypePlugin = () => {
- return async (tree, file) => {
- const filePath = file.history[0]
- type AstroData = {
- frontmatter: {
- cover:
- | {
- url: string
- }
- | string
- | undefined
- }
- }
- const astroData = file.data.astro as AstroData
- if (!astroData.frontmatter.cover) {
- return
- }
- const coverUrl = typeof astroData.frontmatter.cover === "string" ? astroData.frontmatter.cover : astroData.frontmatter.cover.url
- if (coverUrl.includes("http")) {
- return
- }
- const url = path.resolve(path.dirname(filePath), coverUrl)
- const dataURL = await convertImageToBase64URL(url)
- if (typeof astroData.frontmatter.cover === "string") {
- astroData.frontmatter.cover = dataURL
- } else {
- astroData.frontmatter.cover.url = dataURL
- }
- }
-}
+import { handleLocalCoverPlugin } from "./src/plugins/cover"
+import { themePipeline } from "./src/plugins/theme"
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
markdown: {
- rehypePlugins: [handleLocalCoverPlugin, ...pipeline()],
- syntaxHighlight: "prism",
+ rehypePlugins: [handleLocalCoverPlugin, ...themePipeline],
+ syntaxHighlight: "shiki",
+ shikiConfig: {
+ themes: {
+ light: 'github-light',
+ dark: 'github-dark',
+ },
+ }
},
integrations: [
vue(),
diff --git a/cspell.json b/cspell.json
index c92ee68..a9dcc08 100644
--- a/cspell.json
+++ b/cspell.json
@@ -19,6 +19,7 @@
"openapi",
"Rehype",
"rehypePlugins",
+ "shiki",
"tseslint"
]
}
diff --git a/public/static/css/github-dark.min.css b/public/static/css/github-dark.min.css
deleted file mode 100644
index 03b6da8..0000000
--- a/public/static/css/github-dark.min.css
+++ /dev/null
@@ -1,10 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
- Theme: GitHub Dark
- Description: Dark theme as seen on github.com
- Author: github.com
- Maintainer: @Hirse
- Updated: 2021-05-15
-
- Outdated base version: https://github.com/primer/github-syntax-dark
- Current colors taken from GitHub's CSS
-*/.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#79c0ff}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-code,.hljs-comment,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}
\ No newline at end of file
diff --git a/public/static/css/github.min.css b/public/static/css/github.min.css
deleted file mode 100644
index 275239a..0000000
--- a/public/static/css/github.min.css
+++ /dev/null
@@ -1,10 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
- Theme: GitHub
- Description: Light theme as seen on github.com
- Author: github.com
- Maintainer: @Hirse
- Updated: 2021-05-15
-
- Outdated base version: https://github.com/primer/github-syntax-light
- Current colors taken from GitHub's CSS
-*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
\ No newline at end of file
diff --git a/public/static/css/googlecode.min.css b/public/static/css/googlecode.min.css
deleted file mode 100644
index 0140b89..0000000
--- a/public/static/css/googlecode.min.css
+++ /dev/null
@@ -1 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#fff;color:#000}.hljs-comment,.hljs-quote{color:#800}.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-title{color:#008}.hljs-template-variable,.hljs-variable{color:#660}.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string{color:#080}.hljs-bullet,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-symbol{color:#066}.hljs-attr,.hljs-built_in,.hljs-doctag,.hljs-params,.hljs-title,.hljs-type{color:#606}.hljs-attribute,.hljs-subst{color:#000}.hljs-formula{background-color:#eee;font-style:italic}.hljs-selector-class,.hljs-selector-id{color:#9b703f}.hljs-addition{background-color:#baeeba}.hljs-deletion{background-color:#ffc8bd}.hljs-doctag,.hljs-strong{font-weight:700}.hljs-emphasis{font-style:italic}
\ No newline at end of file
diff --git a/public/static/css/stackoverflow-dark.min.css b/public/static/css/stackoverflow-dark.min.css
deleted file mode 100644
index 33cea55..0000000
--- a/public/static/css/stackoverflow-dark.min.css
+++ /dev/null
@@ -1,13 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
- Theme: StackOverflow Dark
- Description: Dark theme as used on stackoverflow.com
- Author: stackoverflow.com
- Maintainer: @Hirse
- Website: https://github.com/StackExchange/Stacks
- License: MIT
- Updated: 2021-05-15
-
- Updated for @stackoverflow/stacks v0.64.0
- Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less
- Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less
-*/.hljs{color:#fff;background:#1c1b1b}.hljs-subst{color:#fff}.hljs-comment{color:#999}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#88aece}.hljs-attribute{color:#c59bc1}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#f08d49}.hljs-selector-class{color:#88aece}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#b5bd68}.hljs-meta,.hljs-selector-pseudo{color:#88aece}.hljs-built_in,.hljs-literal,.hljs-title{color:#f08d49}.hljs-bullet,.hljs-code{color:#ccc}.hljs-meta .hljs-string{color:#b5bd68}.hljs-deletion{color:#de7176}.hljs-addition{color:#76c490}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
\ No newline at end of file
diff --git a/public/static/css/stackoverflow-light.min.css b/public/static/css/stackoverflow-light.min.css
deleted file mode 100644
index c36d63d..0000000
--- a/public/static/css/stackoverflow-light.min.css
+++ /dev/null
@@ -1,13 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
- Theme: StackOverflow Light
- Description: Light theme as used on stackoverflow.com
- Author: stackoverflow.com
- Maintainer: @Hirse
- Website: https://github.com/StackExchange/Stacks
- License: MIT
- Updated: 2021-05-15
-
- Updated for @stackoverflow/stacks v0.64.0
- Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less
- Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less
-*/.hljs{color:#2f3337;background:#f6f6f6}.hljs-subst{color:#2f3337}.hljs-comment{color:#656e77}.hljs-attr,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-section,.hljs-selector-tag{color:#015692}.hljs-attribute{color:#803378}.hljs-name,.hljs-number,.hljs-quote,.hljs-selector-id,.hljs-template-tag,.hljs-type{color:#b75501}.hljs-selector-class{color:#015692}.hljs-link,.hljs-regexp,.hljs-selector-attr,.hljs-string,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#54790d}.hljs-meta,.hljs-selector-pseudo{color:#015692}.hljs-built_in,.hljs-literal,.hljs-title{color:#b75501}.hljs-bullet,.hljs-code{color:#535a60}.hljs-meta .hljs-string{color:#54790d}.hljs-deletion{color:#c02d2e}.hljs-addition{color:#2f6f44}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}
\ No newline at end of file
diff --git a/public/static/css/vs2015.min.css b/public/static/css/vs2015.min.css
deleted file mode 100644
index 7f6fe11..0000000
--- a/public/static/css/vs2015.min.css
+++ /dev/null
@@ -1 +0,0 @@
-pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#1e1e1e;color:#dcdcdc}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-symbol{color:#569cd6}.hljs-link{color:#569cd6;text-decoration:underline}.hljs-built_in,.hljs-type{color:#4ec9b0}.hljs-class,.hljs-number{color:#b8d7a3}.hljs-meta .hljs-string,.hljs-string{color:#d69d85}.hljs-regexp,.hljs-template-tag{color:#9a5334}.hljs-formula,.hljs-function,.hljs-params,.hljs-subst,.hljs-title{color:#dcdcdc}.hljs-comment,.hljs-quote{color:#57a64a;font-style:italic}.hljs-doctag{color:#608b4e}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-tag{color:#9b9b9b}.hljs-template-variable,.hljs-variable{color:#bd63c5}.hljs-attr,.hljs-attribute{color:#9cdcfe}.hljs-section{color:gold}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-bullet,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{color:#d7ba7d}.hljs-addition{background-color:#144212;display:inline-block;width:100%}.hljs-deletion{background-color:#600;display:inline-block;width:100%}
\ No newline at end of file
diff --git a/public/static/js/hljs.js b/public/static/js/hljs.js
deleted file mode 100644
index a0e583a..0000000
--- a/public/static/js/hljs.js
+++ /dev/null
@@ -1,1220 +0,0 @@
-/*
- Highlight.js 10.5.0 (af20048d)
- License: BSD-3-Clause
- Copyright (c) 2006-2020, Ivan Sagalaev
-*/
-var hljs = (function () {
- "use strict"; function e(t) {
- return t instanceof Map
- ? t.clear = t.delete = t.set = () => {
- throw Error("map is read-only")
- }
- : t instanceof Set && (t.add = t.clear = t.delete = () => {
- throw Error("set is read-only")
- }), Object.freeze(t), Object.getOwnPropertyNames(t).forEach(((n) => {
- var s = t[n]
- "object" != typeof s || Object.isFrozen(s) || e(s)
- })), t
- } var t = e, n = e; t.default = n
- class s {
- constructor(e) { void 0 === e.data && (e.data = {}), this.data = e.data }
- ignoreMatch() { this.ignore = !0 }
- } function r(e) {
- return e.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'")
- } function a(e, ...t) {
- const n = Object.create(null); for (const t in e)n[t] = e[t]
- return t.forEach(((e) => { for (const t in e)n[t] = e[t] })), n
- } const i = e => !!e.kind
- class o {
- constructor(e, t) {
- this.buffer = "", this.classPrefix = t.classPrefix, e.walk(this)
- }
-
- addText(e) {
- this.buffer += r(e)
- }
-
- openNode(e) {
- if (!i(e)) return; let t = e.kind
- e.sublanguage || (t = `${this.classPrefix}${t}`), this.span(t)
- }
-
- closeNode(e) {
- i(e) && (this.buffer += "")
- }
-
- value() { return this.buffer }span(e) {
- this.buffer += ``
- }
- } class l {
- constructor() {
- this.rootNode = {
- children: [] }, this.stack = [this.rootNode]
- }
-
- get top() {
- return this.stack[this.stack.length - 1]
- }
-
- get root() { return this.rootNode }add(e) {
- this.top.children.push(e)
- }
-
- openNode(e) {
- const t = { kind: e, children: [] }
- this.add(t), this.stack.push(t)
- }
-
- closeNode() {
- if (this.stack.length > 1) return this.stack.pop()
- }
-
- closeAllNodes() {
- for (;this.closeNode(););
- }
-
- toJSON() { return JSON.stringify(this.rootNode, null, 4) }
- walk(e) { return this.constructor._walk(e, this.rootNode) } static _walk(e, t) {
- return "string" == typeof t
- ? e.addText(t)
- : t.children && (e.openNode(t),
- t.children.forEach((t => this._walk(e, t))), e.closeNode(t)), e
- }
-
- static _collapse(e) {
- "string" != typeof e && e.children && (e.children.every((e => "string" == typeof e))
- ? e.children = [e.children.join("")]
- : e.children.forEach(((e) => {
- l._collapse(e)
- })))
- }
- } class c extends l {
- constructor(e) { super(), this.options = e }
- addKeyword(e, t) { "" !== e && (this.openNode(t), this.addText(e), this.closeNode()) }
- addText(e) { "" !== e && this.add(e) }addSublanguage(e, t) {
- const n = e.root
- n.kind = t, n.sublanguage = !0, this.add(n)
- }
-
- toHTML() {
- return new o(this, this.options).value()
- }
-
- finalize() { return !0 }
- } function u(e) {
- return e ? "string" == typeof e ? e : e.source : null
- }
- const g = "[a-zA-Z]\\w*", d = "[a-zA-Z_]\\w*", h = "\\b\\d+(\\.\\d+)?", f = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", p = "\\b(0b[01]+)", m = {
- begin: "\\\\[\\s\\S]", relevance: 0 }, b = { className: "string", begin: "'", end: "'",
- illegal: "\\n", contains: [m] }, x = { className: "string", begin: "\"", end: "\"",
- illegal: "\\n", contains: [m] }, E = {
- 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/,
- }, v = (e, t, n = {}) => {
- const s = a({ className: "comment", begin: e, end: t, contains: [] }, n)
- return s.contains.push(E), s.contains.push({ className: "doctag",
- begin: "(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):", relevance: 0 }), s
- }, N = v("//", "$"), w = v("/\\*", "\\*/"), R = v("#", "$"); var y = Object.freeze({
- __proto__: null, IDENT_RE: g, UNDERSCORE_IDENT_RE: d, NUMBER_RE: h, C_NUMBER_RE: f,
- BINARY_NUMBER_RE: p,
- RE_STARTERS_RE: "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",
- SHEBANG: (e = {}) => {
- const t = /^#![ ]*\//
- return e.binary && (e.begin = ((...e) => e.map((e => u(e))).join(""))(t, /.*\b/, e.binary, /\b.*/)),
- a({ "className": "meta", "begin": t, "end": /$/, "relevance": 0, "on:begin": (e, t) => {
- 0 !== e.index && t.ignoreMatch()
- } }, e)
- }, BACKSLASH_ESCAPE: m, APOS_STRING_MODE: b,
- QUOTE_STRING_MODE: x, PHRASAL_WORDS_MODE: E, COMMENT: v, C_LINE_COMMENT_MODE: N,
- C_BLOCK_COMMENT_MODE: w, HASH_COMMENT_MODE: R, NUMBER_MODE: { className: "number",
- begin: h, relevance: 0 }, C_NUMBER_MODE: { className: "number", begin: f, relevance: 0 },
- BINARY_NUMBER_MODE: { className: "number", begin: p, relevance: 0 }, CSS_NUMBER_MODE: {
- className: "number",
- begin: h + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
- relevance: 0 }, REGEXP_MODE: { begin: /(?=\/[^/\n]*\/)/, contains: [{ className: "regexp",
- begin: /\//, end: /\/[gimuy]*/, illegal: /\n/, contains: [m, { begin: /\[/, end: /\]/,
- relevance: 0, contains: [m] }] }] }, TITLE_MODE: { className: "title", begin: g, relevance: 0,
- }, UNDERSCORE_TITLE_MODE: { className: "title", begin: d, relevance: 0 }, METHOD_GUARD: {
- begin: "\\.\\s*[a-zA-Z_]\\w*", relevance: 0 }, END_SAME_AS_BEGIN: e => Object.assign(e, {
- "on:begin": (e, t) => { t.data._beginMatch = e[1] }, "on:end": (e, t) => {
- t.data._beginMatch !== e[1] && t.ignoreMatch()
- } }) }); function _(e, t) {
- "." === e.input[e.index - 1] && t.ignoreMatch()
- } function k(e, t) {
- t && e.beginKeywords && (e.begin = "\\b(" + e.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)",
- e.__beforeBegin = _, e.keywords = e.keywords || e.beginKeywords, delete e.beginKeywords)
- } function M(e, t) {
- Array.isArray(e.illegal) && (e.illegal = ((...e) => "(" + e.map((e => u(e))).join("|") + ")")(...e.illegal))
- } function O(e, t) {
- if (e.match) {
- if (e.begin || e.end) throw Error("begin & end are not supported with match")
- e.begin = e.match, delete e.match
- }
- } function A(e, t) {
- void 0 === e.relevance && (e.relevance = 1)
- }
- const L = ["of", "and", "for", "in", "not", "or", "if", "then", "parent", "list", "value"]
- function B(e, t) { return t ? Number(t) : (e => L.includes(e.toLowerCase()))(e) ? 0 : 1 }
- function I(e, { plugins: t }) {
- function n(t, n) {
- return RegExp(u(t), "m" + (e.case_insensitive ? "i" : "") + (n ? "g" : ""))
- } class s {
- constructor() {
- this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0
- }
-
- addRule(e, t) {
- t.position = this.position++, this.matchIndexes[this.matchAt] = t, this.regexes.push([t, e]),
- this.matchAt += (e => RegExp(e.toString() + "|").exec("").length - 1)(e) + 1
- }
-
- compile() {
- 0 === this.regexes.length && (this.exec = () => null)
- const e = this.regexes.map((e => e[1])); this.matcherRe = n(((e, t = "|") => {
- const n = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; let s = 0, r = ""
- for (let a = 0; a < e.length; a++) {
- s += 1; const i = s; let o = u(e[a])
- for (a > 0 && (r += t), r += "("; o.length > 0;) {
- const e = n.exec(o); if (null == e) { r += o; break }
- r += o.substring(0, e.index),
- o = o.substring(e.index + e[0].length), "\\" === e[0][0] && e[1]
- ? r += "\\" + (Number(e[1]) + i)
- : (r += e[0],
- "(" === e[0] && s++)
- }r += ")"
- } return r
- })(e), !0), this.lastIndex = 0
- }
-
- exec(e) {
- this.matcherRe.lastIndex = this.lastIndex; const t = this.matcherRe.exec(e)
- if (!t) return null
- const n = t.findIndex(((e, t) => t > 0 && void 0 !== e)), s = this.matchIndexes[n]
- return t.splice(0, n), Object.assign(t, s)
- }
- } class r {
- constructor() {
- this.rules = [], this.multiRegexes = [],
- this.count = 0, this.lastIndex = 0, this.regexIndex = 0
- }
-
- getMatcher(e) {
- if (this.multiRegexes[e]) return this.multiRegexes[e]; const t = new s()
- return this.rules.slice(e).forEach((([e, n]) => t.addRule(e, n))),
- t.compile(), this.multiRegexes[e] = t, t
- }
-
- resumingScanAtSamePosition() {
- return 0 !== this.regexIndex
- }
-
- considerAll() { this.regexIndex = 0 }addRule(e, t) {
- this.rules.push([e, t]), "begin" === t.type && this.count++
- }
-
- exec(e) {
- const t = this.getMatcher(this.regexIndex); t.lastIndex = this.lastIndex
- let n = t.exec(e)
- if (this.resumingScanAtSamePosition()) if (n && n.index === this.lastIndex);else {
- const t = this.getMatcher(0); t.lastIndex = this.lastIndex + 1, n = t.exec(e)
- }
- return n && (this.regexIndex += n.position + 1,
- this.regexIndex === this.count && this.considerAll()), n
- }
- }
- if (e.compilerExtensions || (e.compilerExtensions = []),
- e.contains && e.contains.includes("self")) throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.")
- return e.classNameAliases = a(e.classNameAliases || {}), (function t(s, i) {
- const o = s
- if (s.compiled) return o
- ;[O].forEach((e => e(s, i))), e.compilerExtensions.forEach((e => e(s, i))),
- s.__beforeBegin = null, [k, M, A].forEach((e => e(s, i))), s.compiled = !0; let l = null
- if ("object" == typeof s.keywords && (l = s.keywords.$pattern,
- delete s.keywords.$pattern), s.keywords && (s.keywords = ((e, t) => {
- const n = {}
- return "string" == typeof e
- ? s("keyword", e)
- : Object.keys(e).forEach(((t) => {
- s(t, e[t])
- })), n; function s(e, s) {
- t && (s = s.toLowerCase()), s.split(" ").forEach(((t) => {
- const s = t.split("|"); n[s[0]] = [e, B(s[0], s[1])]
- }))
- }
- })(s.keywords, e.case_insensitive)),
- s.lexemes && l) throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ")
- return l = l || s.lexemes || /\w+/,
- o.keywordPatternRe = n(l, !0), i && (s.begin || (s.begin = /\B|\b/),
- o.beginRe = n(s.begin), s.endSameAsBegin && (s.end = s.begin),
- s.end || s.endsWithParent || (s.end = /\B|\b/),
- s.end && (o.endRe = n(s.end)), o.terminatorEnd = u(s.end) || "",
- s.endsWithParent && i.terminatorEnd && (o.terminatorEnd += (s.end ? "|" : "") + i.terminatorEnd)),
- s.illegal && (o.illegalRe = n(s.illegal)),
- s.contains || (s.contains = []), s.contains = [].concat(...s.contains.map((e => (e => (e.variants && !e.cachedVariants && (e.cachedVariants = e.variants.map((t => a(e, {
- variants: null }, t)))), e.cachedVariants
- ? e.cachedVariants
- : T(e)
- ? a(e, {
- starts: e.starts ? a(e.starts) : null,
- })
- : Object.isFrozen(e) ? a(e) : e))("self" === e ? s : e)))), s.contains.forEach(((e) => {
- t(e, o)
- })), s.starts && t(s.starts, i), o.matcher = ((e) => {
- const t = new r()
- return e.contains.forEach((e => t.addRule(e.begin, { rule: e, type: "begin",
- }))), e.terminatorEnd && t.addRule(e.terminatorEnd, { type: "end",
- }), e.illegal && t.addRule(e.illegal, { type: "illegal" }), t
- })(o), o
- }(e))
- } function T(e) {
- return !!e && (e.endsWithParent || T(e.starts))
- } function j(e) {
- const t = {
- props: ["language", "code", "autodetect"], data: () => ({ detectedLanguage: "",
- unknownLanguage: !1 }), computed: { className() {
- return this.unknownLanguage ? "" : "hljs " + this.detectedLanguage
- }, highlighted() {
- if (!this.autoDetect && !e.getLanguage(this.language)) return console.warn(`The language "${this.language}" you specified could not be found.`),
- this.unknownLanguage = !0, r(this.code); let t = {}
- return this.autoDetect
- ? (t = e.highlightAuto(this.code),
- this.detectedLanguage = t.language)
- : (t = e.highlight(this.language, this.code, this.ignoreIllegals),
- this.detectedLanguage = this.language), t.value
- }, autoDetect() {
- return !(this.language && (e = this.autodetect, !e && "" !== e)); var e
- },
- ignoreIllegals: () => !0 }, render(e) {
- return e("pre", {}, [e("code", {
- class: this.className, domProps: { innerHTML: this.highlighted } })])
- } }; return {
- Component: t, VuePlugin: { install(e) { e.component("highlightjs", t) } } }
- } const S = {
- "after:highlightBlock": ({ block: e, result: t, text: n }) => {
- const s = D(e)
- if (!s.length) return; const a = document.createElement("div")
- a.innerHTML = t.value, t.value = ((e, t, n) => {
- let s = 0, a = ""; const i = []; function o() {
- return e.length && t.length ? e[0].offset !== t[0].offset ? e[0].offset < t[0].offset ? e : t : "start" === t[0].event ? e : t : e.length ? e : t
- } function l(e) {
- a += "<" + P(e) + [].map.call(e.attributes, function (e) {
- return " " + e.nodeName + "=\"" + r(e.value) + "\""
- }).join("") + ">"
- } function c(e) {
- a += "" + P(e) + ">"
- } function u(e) { ("start" === e.event ? l : c)(e.node) }
- for (;e.length || t.length;) {
- let t = o()
- if (a += r(n.substring(s, t[0].offset)), s = t[0].offset, t === e) {
- i.reverse().forEach(c)
- do { u(t.splice(0, 1)[0]), t = o() } while (t === e && t.length && t[0].offset === s)
- i.reverse().forEach(l)
- }
- else "start" === t[0].event ? i.push(t[0].node) : i.pop(), u(t.splice(0, 1)[0])
- }
- return a + r(n.substr(s))
- })(s, D(a), n)
- } }; function P(e) {
- return e.nodeName.toLowerCase()
- } function D(e) {
- const t = []; return (function e(n, s) {
- for (let r = n.firstChild; r; r = r.nextSibling)3 === r.nodeType
- ? s += r.nodeValue.length
- : 1 === r.nodeType && (t.push({
- event: "start", offset: s, node: r }), s = e(r, s), P(r).match(/br|hr|img|input/) || t.push({
- event: "stop", offset: s, node: r })); return s
- }(e, 0)), t
- } const C = (e) => {
- console.error(e)
- }, H = (e, ...t) => { console.log("WARN: " + e, ...t) }, $ = (e, t) => {
- console.log(`Deprecated as of ${e}. ${t}`)
- }, U = r, z = a, K = Symbol("nomatch")
- return ((e) => {
- const n = Object.create(null), r = Object.create(null), a = []; let i = !0
- const o = /(^(<[^>]+>|\t|)+|\n)/gm, l = "Could not find the language '{}', did you forget to load/include a language module?", u = {
- disableAutodetect: !0, name: "Plain text", contains: [] }; let g = {
- noHighlightRe: /^(no-?highlight)$/i,
- languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i, classPrefix: "hljs-",
- tabReplace: null, useBR: !1, languages: null, __emitter: c }; function d(e) {
- return g.noHighlightRe.test(e)
- } function h(e, t, n, s) {
- const r = { code: t, language: e }
- _("before:highlight", r); const a = r.result ? r.result : f(r.language, r.code, n, s)
- return a.code = r.code, _("after:highlight", a), a
- } function f(e, t, r, o) {
- const c = t
- function u(e, t) {
- const n = w.case_insensitive ? t[0].toLowerCase() : t[0]
- return Object.prototype.hasOwnProperty.call(e.keywords, n) && e.keywords[n]
- }
- function d() {
- null != _.subLanguage
- ? (() => {
- if ("" === O) return; let e = null
- if ("string" == typeof _.subLanguage) {
- if (!n[_.subLanguage]) return void M.addText(O)
- e = f(_.subLanguage, O, !0, k[_.subLanguage]), k[_.subLanguage] = e.top
- }
- else e = p(O, _.subLanguage.length ? _.subLanguage : null)
- _.relevance > 0 && (A += e.relevance), M.addSublanguage(e.emitter, e.language)
- })()
- : (() => {
- if (!_.keywords) return void M.addText(O); let e = 0
- _.keywordPatternRe.lastIndex = 0; let t = _.keywordPatternRe.exec(O), n = ""; for (;t;) {
- n += O.substring(e, t.index); const s = u(_, t); if (s) {
- const [e, r] = s
- M.addText(n), n = "", A += r; const a = w.classNameAliases[e] || e; M.addKeyword(t[0], a)
- }
- else n += t[0]; e = _.keywordPatternRe.lastIndex, t = _.keywordPatternRe.exec(O)
- }
- n += O.substr(e), M.addText(n)
- })(), O = ""
- } function h(e) {
- return e.className && M.openNode(w.classNameAliases[e.className] || e.className),
- _ = Object.create(e, { parent: { value: _ } }), _
- } function m(e, t, n) {
- let r = ((e, t) => {
- const n = e && e.exec(t); return n && 0 === n.index
- })(e.endRe, n); if (r) {
- if (e["on:end"]) {
- const n = new s(e); e["on:end"](t, n), n.ignore && (r = !1)
- } if (r) {
- for (;e.endsParent && e.parent;)e = e.parent; return e
- }
- }
- if (e.endsWithParent) return m(e.parent, t, n)
- } function b(e) {
- return 0 === _.matcher.regexIndex ? (O += e[0], 1) : (T = !0, 0)
- } function x(e) {
- const t = e[0], n = c.substr(e.index), s = m(_, e, n); if (!s) return K; const r = _
- r.skip ? O += t : (r.returnEnd || r.excludeEnd || (O += t), d(), r.excludeEnd && (O = t)); do {
- _.className && M.closeNode(), _.skip || _.subLanguage || (A += _.relevance), _ = _.parent
- } while (_ !== s.parent)
- return s.starts && (s.endSameAsBegin && (s.starts.endRe = s.endRe),
- h(s.starts)), r.returnEnd ? 0 : t.length
- } let E = {}; function v(t, n) {
- const a = n && n[0]
- if (O += t, null == a) return d(), 0
- if ("begin" === E.type && "end" === n.type && E.index === n.index && "" === a) {
- if (O += c.slice(n.index, n.index + 1), !i) {
- const t = Error("0 width match regex")
- throw t.languageName = e, t.badRule = E.rule, t
- } return 1
- }
- if (E = n, "begin" === n.type) return (function (e) {
- const t = e[0], n = e.rule, r = new s(n), a = [n.__beforeBegin, n["on:begin"]]
- for (const n of a) if (n && (n(e, r), r.ignore)) return b(t)
- return n && n.endSameAsBegin && (n.endRe = RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m")),
- n.skip
- ? O += t
- : (n.excludeBegin && (O += t),
- d(), n.returnBegin || n.excludeBegin || (O = t)), h(n), n.returnBegin ? 0 : t.length
- }(n))
- if ("illegal" === n.type && !r) {
- const e = Error("Illegal lexeme \"" + a + "\" for mode \"" + (_.className || "") + "\"")
- throw e.mode = _, e
- } if ("end" === n.type) { const e = x(n); if (e !== K) return e }
- if ("illegal" === n.type && "" === a) return 1
- if (B > 1e5 && B > 3 * n.index) throw Error("potential infinite loop, way more iterations than matches")
- return O += a, a.length
- } const w = N(e)
- if (!w) throw C(l.replace("{}", e)), Error("Unknown language: \"" + e + "\"")
- const R = I(w, { plugins: a }); let y = "", _ = o || R; const k = {}, M = new g.__emitter(g); (() => {
- const e = []; for (let t = _; t !== w; t = t.parent)t.className && e.unshift(t.className)
- e.forEach((e => M.openNode(e)))
- })(); let O = "", A = 0, L = 0, B = 0, T = !1; try {
- for (_.matcher.considerAll(); ;) {
- B++, T ? T = !1 : _.matcher.considerAll(), _.matcher.lastIndex = L
- const e = _.matcher.exec(c); if (!e) break; const t = v(c.substring(L, e.index), e)
- L = e.index + t
- } return v(c.substr(L)), M.closeAllNodes(), M.finalize(), y = M.toHTML(), {
- relevance: A, value: y, language: e, illegal: !1, emitter: M, top: _ }
- }
- catch (t) {
- if (t.message && t.message.includes("Illegal")) return { illegal: !0, illegalBy: {
- msg: t.message, context: c.slice(L - 100, L + 100), mode: t.mode }, sofar: y, relevance: 0,
- value: U(c), emitter: M }; if (i) return { illegal: !1, relevance: 0, value: U(c), emitter: M,
- language: e, top: _, errorRaised: t }; throw t
- }
- } function p(e, t) {
- t = t || g.languages || Object.keys(n); const s = ((e) => {
- const t = { relevance: 0,
- emitter: new g.__emitter(g), value: U(e), illegal: !1, top: u }
- return t.emitter.addText(e), t
- })(e), r = t.filter(N).filter(R).map((t => f(t, e, !1)))
- r.unshift(s); const a = r.sort(((e, t) => {
- if (e.relevance !== t.relevance) return t.relevance - e.relevance
- if (e.language && t.language) {
- if (N(e.language).supersetOf === t.language) return 1
- if (N(t.language).supersetOf === e.language) return -1
- } return 0
- })), [i, o] = a, l = i
- return l.second_best = o, l
- } const m = { "before:highlightBlock": ({ block: e }) => {
- g.useBR && (e.innerHTML = e.innerHTML.replace(/\n/g, "").replace(/
/g, "\n"))
- }, "after:highlightBlock": ({ result: e }) => {
- g.useBR && (e.value = e.value.replace(/\n/g, "
"))
- } }, b = /^(<[^>]+>|\t)+/gm, x = {
- "after:highlightBlock": ({ result: e }) => {
- g.tabReplace && (e.value = e.value.replace(b, e => e.replace(/\t/g, g.tabReplace)))
- } }
- function E(e) {
- let t = null; const n = ((e) => {
- let t = e.className + " "
- t += e.parentNode ? e.parentNode.className : ""; const n = g.languageDetectRe.exec(t)
- if (n) {
- const t = N(n[1])
- return t || (H(l.replace("{}", n[1])), H("Falling back to no-highlight mode for this block.", e)),
- t ? n[1] : "no-highlight"
- } return t.split(/\s+/).find((e => d(e) || N(e)))
- })(e)
- if (d(n)) return; _("before:highlightBlock", { block: e, language: n }), t = e
- const s = t.textContent, a = n ? h(n, s, !0) : p(s); _("after:highlightBlock", { block: e,
- result: a, text: s }), e.innerHTML = a.value, ((e, t, n) => {
- const s = t ? r[t] : n
- e.classList.add("hljs"), s && e.classList.add(s)
- })(e, n, a.language), e.result = {
- language: a.language, re: a.relevance, relavance: a.relevance,
- }, a.second_best && (e.second_best = { language: a.second_best.language,
- re: a.second_best.relevance, relavance: a.second_best.relevance })
- } const v = () => {
- v.called || (v.called = !0, document.querySelectorAll("pre code").forEach(E))
- }
- function N(e) { return e = (e || "").toLowerCase(), n[e] || n[r[e]] }
- function w(e, { languageName: t }) {
- "string" == typeof e && (e = [e]), e.forEach(((e) => {
- r[e] = t
- }))
- } function R(e) { const t = N(e); return t && !t.disableAutodetect } function _(e, t) {
- const n = e; a.forEach(((e) => { e[n] && e[n](t) }))
- }Object.assign(e, { highlight: h,
- highlightAuto: p, fixMarkup: (e) => {
- return $("10.2.0", "fixMarkup will be removed entirely in v11.0"),
- $("10.2.0", "Please see https://github.com/highlightjs/highlight.js/issues/2534"),
- t = e,
- g.tabReplace || g.useBR ? t.replace(o, e => "\n" === e ? g.useBR ? "
" : e : g.tabReplace ? e.replace(/\t/g, g.tabReplace) : e) : t
- var t
- }, highlightBlock: E, configure: (e) => {
- e.useBR && ($("10.3.0", "'useBR' will be removed entirely in v11.0"),
- $("10.3.0", "Please see https://github.com/highlightjs/highlight.js/issues/2559")),
- g = z(g, e)
- }, initHighlighting: v, initHighlightingOnLoad: () => {
- window.addEventListener("DOMContentLoaded", v, !1)
- }, registerLanguage: (t, s) => {
- let r = null; try { r = s(e) }
- catch (e) {
- if (C("Language definition for '{}' could not be registered.".replace("{}", t)),
- !i) throw e; C(e), r = u
- }
- r.name || (r.name = t), n[t] = r, r.rawDefinition = s.bind(null, e), r.aliases && w(r.aliases, {
- languageName: t })
- }, listLanguages: () => Object.keys(n), getLanguage: N,
- registerAliases: w, requireLanguage: (e) => {
- $("10.4.0", "requireLanguage will be removed entirely in v11."),
- $("10.4.0", "Please see https://github.com/highlightjs/highlight.js/pull/2844")
- const t = N(e); if (t) return t
- throw Error("The '{}' language is required, but not loaded.".replace("{}", e))
- },
- autoDetection: R, inherit: z, addPlugin: (e) => { a.push(e) }, vuePlugin: j(e).VuePlugin,
- }), e.debugMode = () => { i = !1 }, e.safeMode = () => { i = !0 }, e.versionString = "10.5.0"
- for (const e in y)"object" == typeof y[e] && t(y[e])
- return Object.assign(e, y), e.addPlugin(m), e.addPlugin(S), e.addPlugin(x), e
- })({})
-}()); "object" == typeof exports && "undefined" != typeof module && (module.exports = hljs); hljs.registerLanguage("cpp", (() => {
- "use strict"; function e(e) {
- return ((...e) => e.map((e => (e => e ? "string" == typeof e ? e : e.source : null)(e))).join(""))("(", e, ")?")
- } return (t) => {
- const n = ((t) => {
- const n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }],
- }), r = "[a-zA-Z_]\\w*::", a = "(decltype\\(auto\\)|" + e(r) + "[a-zA-Z_]\\w*" + e("<[^<>]+>") + ")", s = {
- className: "keyword", begin: "\\b[a-z\\d_]*_t\\b" }, i = { className: "string",
- variants: [{ begin: "(u8?|U|L)?\"", end: "\"", illegal: "\\n",
- contains: [t.BACKSLASH_ESCAPE] }, {
- begin: "(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",
- end: "'", illegal: "." }, t.END_SAME_AS_BEGIN({
- begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/, end: /\)([^()\\ ]{0,16})"/ })] }, c = {
- className: "number", variants: [{ begin: "\\b(0b[01']+)" }, {
- begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)",
- }, {
- begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)",
- }], relevance: 0 }, o = { className: "meta", begin: /#\s*[a-z]+\b/, end: /$/, keywords: {
- "meta-keyword": "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include",
- }, contains: [{ begin: /\\\n/, relevance: 0 }, t.inherit(i, { className: "meta-string" }), {
- className: "meta-string", begin: /<.*?>/, end: /$/, illegal: "\\n",
- }, n, t.C_BLOCK_COMMENT_MODE] }, l = { className: "title", begin: e(r) + t.IDENT_RE,
- relevance: 0 }, d = e(r) + t.IDENT_RE + "\\s*\\(", u = {
- keyword: "int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",
- built_in: "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",
- literal: "true false nullptr NULL" }, p = [o, s, n, t.C_BLOCK_COMMENT_MODE, c, i], m = {
- variants: [{ begin: /=/, end: /;/ }, { begin: /\(/, end: /\)/ }, {
- beginKeywords: "new throw return else", end: /;/ }], keywords: u, contains: p.concat([{
- begin: /\(/, end: /\)/, keywords: u, contains: p.concat(["self"]), relevance: 0 }]),
- relevance: 0 }, _ = { className: "function", begin: "(" + a + "[\\*&\\s]+)+" + d,
- returnBegin: !0, end: /[{;=]/, excludeEnd: !0, keywords: u, illegal: /[^\w\s\*&:<>.]/,
- contains: [{ begin: "decltype\\(auto\\)", keywords: u, relevance: 0 }, { begin: d,
- returnBegin: !0, contains: [l], relevance: 0 }, { className: "params", begin: /\(/,
- end: /\)/, keywords: u, relevance: 0, contains: [n, t.C_BLOCK_COMMENT_MODE, i, c, s, {
- begin: /\(/, end: /\)/, keywords: u, relevance: 0,
- contains: ["self", n, t.C_BLOCK_COMMENT_MODE, i, c, s] }],
- }, s, n, t.C_BLOCK_COMMENT_MODE, o] }; return {
- aliases: ["c", "cc", "h", "c++", "h++", "hpp", "hh", "hxx", "cxx"], keywords: u,
- disableAutodetect: !0, illegal: "", contains: [].concat(m, _, p, [o, {
- begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",
- end: ">", keywords: u, contains: ["self", s] }, { begin: t.IDENT_RE + "::", keywords: u }, {
- className: "class", beginKeywords: "enum class struct union", end: /[{;:<>=]/,
- contains: [{ beginKeywords: "final class struct" }, t.TITLE_MODE] }]), exports: {
- preprocessor: o, strings: i, keywords: u } }
- })(t)
- return n.disableAutodetect = !1, n.name = "C++",
- n.aliases = ["cc", "c++", "h++", "hpp", "hh", "hxx", "cxx"], n
- }
-})()); hljs.registerLanguage("http", (() => {
- "use strict"; function e(...e) {
- return e.map(((e) => {
- return (n = e) ? "string" == typeof n ? n : n.source : null; var n
- })).join("")
- } return (n) => {
- const a = "HTTP/(2|1\\.[01])", s = [{ className: "attribute",
- begin: e("^", /[A-Za-z][A-Za-z0-9-]*/, "(?=\\:\\s)"), starts: { contains: [{
- className: "punctuation", begin: /: /, relevance: 0, starts: { end: "$", relevance: 0 } }] },
- }, { begin: "\\n\\n", starts: { subLanguage: [], endsWithParent: !0 } }]; return {
- name: "HTTP", aliases: ["https"], illegal: /\S/, contains: [{ begin: "^(?=" + a + " \\d{3})",
- end: /$/, contains: [{ className: "meta", begin: a }, { className: "number",
- begin: "\\b\\d{3}\\b" }], starts: { end: /\b\B/, illegal: /\S/, contains: s } }, {
- begin: "(?=^[A-Z]+ (.*?) " + a + "$)", end: /$/, contains: [{ className: "string",
- begin: " ", end: " ", excludeBegin: !0, excludeEnd: !0 }, { className: "meta", begin: a }, {
- className: "keyword", begin: "[A-Z]+" }], starts: { end: /\b\B/, illegal: /\S/, contains: s },
- }] }
- }
-})()); hljs.registerLanguage("java", (() => {
- "use strict"
- var e = "\\.([0-9](_*[0-9])*)", n = "[0-9a-fA-F](_*[0-9a-fA-F])*", a = {
- className: "number", variants: [{
- begin: `(\\b([0-9](_*[0-9])*)((${e})|\\.)?|(${e}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`,
- }, { begin: `\\b([0-9](_*[0-9])*)((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)` }, {
- begin: `(${e})[fFdD]?\\b` }, { begin: "\\b([0-9](_*[0-9])*)[fFdD]\\b" }, {
- begin: `\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b`,
- }, { begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" }, { begin: `\\b0[xX](${n})[lL]?\\b` }, {
- begin: "\\b0(_*[0-7])*[lL]?\\b" }, { begin: "\\b0[bB][01](_*[01])*[lL]?\\b" }],
- relevance: 0 }; return (e) => {
- var n = "false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do", s = {
- className: "meta", begin: "@[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",
- contains: [{ begin: /\(/, end: /\)/, contains: ["self"] }] }; const r = a; return {
- name: "Java", aliases: ["jsp"], keywords: n, illegal: /<\/|#/,
- contains: [e.COMMENT("/\\*\\*", "\\*/", { relevance: 0, contains: [{ begin: /\w+@/,
- relevance: 0 }, { className: "doctag", begin: "@[A-Za-z]+" }] }), {
- begin: /import java\.[a-z]+\./, keywords: "import", relevance: 2,
- }, e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE, e.APOS_STRING_MODE, e.QUOTE_STRING_MODE, {
- className: "class", beginKeywords: "class interface enum", end: /[{;=]/,
- excludeEnd: !0, keywords: "class interface enum", illegal: /[:"\[\]]/, contains: [{
- beginKeywords: "extends implements" }, e.UNDERSCORE_TITLE_MODE] }, {
- beginKeywords: "new throw return else", relevance: 0 }, { className: "class",
- begin: "record\\s+" + e.UNDERSCORE_IDENT_RE + "\\s*\\(", returnBegin: !0, excludeEnd: !0,
- end: /[{;=]/, keywords: n, contains: [{ beginKeywords: "record" }, {
- begin: e.UNDERSCORE_IDENT_RE + "\\s*\\(", returnBegin: !0, relevance: 0,
- contains: [e.UNDERSCORE_TITLE_MODE] }, { className: "params", begin: /\(/, end: /\)/,
- keywords: n, relevance: 0, contains: [e.C_BLOCK_COMMENT_MODE],
- }, e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE] }, { className: "function",
- begin: "([\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(<[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*(\\s*,\\s*[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*)*>)?\\s+)+" + e.UNDERSCORE_IDENT_RE + "\\s*\\(",
- returnBegin: !0, end: /[{;=]/, excludeEnd: !0, keywords: n, contains: [{
- begin: e.UNDERSCORE_IDENT_RE + "\\s*\\(", returnBegin: !0, relevance: 0,
- contains: [e.UNDERSCORE_TITLE_MODE] }, { className: "params", begin: /\(/, end: /\)/,
- keywords: n, relevance: 0,
- contains: [s, e.APOS_STRING_MODE, e.QUOTE_STRING_MODE, r, e.C_BLOCK_COMMENT_MODE],
- }, e.C_LINE_COMMENT_MODE, e.C_BLOCK_COMMENT_MODE] }, r, s] }
- }
-})()); hljs.registerLanguage("nginx", (() => {
- "use strict"; return (e) => {
- const n = {
- className: "variable", variants: [{ begin: /\$\d+/ }, { begin: /\$\{/, end: /\}/ }, {
- begin: /[$@]/ + e.UNDERSCORE_IDENT_RE }] }, a = { endsWithParent: !0, keywords: {
- $pattern: "[a-z/_]+",
- literal: "on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll",
- }, relevance: 0, illegal: "=>", contains: [e.HASH_COMMENT_MODE, { className: "string",
- contains: [e.BACKSLASH_ESCAPE, n], variants: [{ begin: /"/, end: /"/ }, { begin: /'/, end: /'/,
- }] }, { begin: "([a-z]+):/", end: "\\s", endsWithParent: !0, excludeEnd: !0, contains: [n],
- }, { className: "regexp", contains: [e.BACKSLASH_ESCAPE, n], variants: [{ begin: "\\s\\^",
- end: "\\s|\\{|;", returnEnd: !0 }, { begin: "~\\*?\\s+", end: "\\s|\\{|;", returnEnd: !0 }, {
- begin: "\\*(\\.[a-z\\-]+)+" }, { begin: "([a-z\\-]+\\.)+\\*" }] }, { className: "number",
- begin: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b" }, {
- className: "number", begin: "\\b\\d+[kKmMgGdshdwy]*\\b", relevance: 0 }, n] }; return {
- name: "Nginx config", aliases: ["nginxconf"], contains: [e.HASH_COMMENT_MODE, {
- begin: e.UNDERSCORE_IDENT_RE + "\\s+\\{", returnBegin: !0, end: /\{/, contains: [{
- className: "section", begin: e.UNDERSCORE_IDENT_RE }], relevance: 0 }, {
- begin: e.UNDERSCORE_IDENT_RE + "\\s", end: ";|\\{", returnBegin: !0, contains: [{
- className: "attribute", begin: e.UNDERSCORE_IDENT_RE, starts: a }], relevance: 0 }],
- illegal: "[^\\s\\}]" }
- }
-})()); hljs.registerLanguage("xml", (() => {
- "use strict"; function e(e) {
- return e ? "string" == typeof e ? e : e.source : null
- } function n(e) { return a("(?=", e, ")") }
- function a(...n) { return n.map((n => e(n))).join("") } function s(...n) {
- return "(" + n.map((n => e(n))).join("|") + ")"
- } return (e) => {
- const t = a(/[A-Z_]/, a("(", /[A-Z0-9_.-]+:/, ")?"), /[A-Z0-9_.-]*/), i = {
- className: "symbol", begin: /&[a-z]+;|[0-9]+;|[a-f0-9]+;/ }, r = { begin: /\s/,
- contains: [{ className: "meta-keyword", begin: /#?[a-z_][a-z1-9_-]+/, illegal: /\n/ }],
- }, c = e.inherit(r, { begin: /\(/, end: /\)/ }), l = e.inherit(e.APOS_STRING_MODE, {
- className: "meta-string" }), g = e.inherit(e.QUOTE_STRING_MODE, {
- className: "meta-string" }), m = { endsWithParent: !0, illegal: /, relevance: 0,
- contains: [{ className: "attr", begin: /[A-Za-z0-9._:-]+/, relevance: 0 }, { begin: /=\s*/,
- relevance: 0, contains: [{ className: "string", endsParent: !0, variants: [{ begin: /"/,
- end: /"/, contains: [i] }, { begin: /'/, end: /'/, contains: [i] }, { begin: /[^\s"'=<>`]+/ }] }],
- }] }; return { name: "HTML, XML",
- aliases: ["html", "xhtml", "rss", "atom", "xjb", "xsd", "xsl", "plist", "wsf", "svg"],
- case_insensitive: !0, contains: [{ className: "meta", begin: //,
- relevance: 10, contains: [r, g, l, c, { begin: /\[/, end: /\]/, contains: [{ className: "meta",
- begin: //, contains: [r, c, g, l] }] }] }, e.COMMENT(//, {
- relevance: 10 }), { begin: //, relevance: 10 }, i, {
- className: "meta", begin: /<\?xml/, end: /\?>/, relevance: 10 }, { className: "tag",
- begin: /