diff --git a/.refsrc.json b/.refsrc.json new file mode 100644 index 0000000..9512c71 --- /dev/null +++ b/.refsrc.json @@ -0,0 +1,16 @@ +{ + "description": "{{description}},为开发人员分享快速参考备忘单。", + "keywords": "reference,Quick,Reference,cheatsheet,cheat,sheet", + "data-info": "👆待完善需要您的参与", + "search": { + "label": "搜索", + "placeholder": "搜索备忘清单", + "cancel": "取消" + }, + "editor": { + "label": "编辑" + }, + "github": { + "url": "https://github.com/jaywcjlove/reference" + } +} diff --git a/scripts/assets/ansible.svg b/assets/ansible.svg similarity index 100% rename from scripts/assets/ansible.svg rename to assets/ansible.svg diff --git a/scripts/assets/bash.svg b/assets/bash.svg similarity index 100% rename from scripts/assets/bash.svg rename to assets/bash.svg diff --git a/scripts/assets/c.svg b/assets/c.svg similarity index 100% rename from scripts/assets/c.svg rename to assets/c.svg diff --git a/scripts/assets/cargo.svg b/assets/cargo.svg similarity index 100% rename from scripts/assets/cargo.svg rename to assets/cargo.svg diff --git a/scripts/assets/chmod.svg b/assets/chmod.svg similarity index 100% rename from scripts/assets/chmod.svg rename to assets/chmod.svg diff --git a/scripts/assets/cmake.svg b/assets/cmake.svg similarity index 100% rename from scripts/assets/cmake.svg rename to assets/cmake.svg diff --git a/scripts/assets/cmd.svg b/assets/cmd.svg similarity index 100% rename from scripts/assets/cmd.svg rename to assets/cmd.svg diff --git a/scripts/assets/cocoapods.svg b/assets/cocoapods.svg similarity index 100% rename from scripts/assets/cocoapods.svg rename to assets/cocoapods.svg diff --git a/scripts/assets/colors-named.svg b/assets/colors-named.svg similarity index 100% rename from scripts/assets/colors-named.svg rename to assets/colors-named.svg diff --git a/scripts/assets/conan.svg b/assets/conan.svg similarity index 100% rename from scripts/assets/conan.svg rename to assets/conan.svg diff --git a/scripts/assets/cpp.svg b/assets/cpp.svg similarity index 100% rename from scripts/assets/cpp.svg rename to assets/cpp.svg diff --git a/scripts/assets/cron.svg b/assets/cron.svg similarity index 100% rename from scripts/assets/cron.svg rename to assets/cron.svg diff --git a/scripts/assets/cs.svg b/assets/cs.svg similarity index 100% rename from scripts/assets/cs.svg rename to assets/cs.svg diff --git a/scripts/assets/css.svg b/assets/css.svg similarity index 100% rename from scripts/assets/css.svg rename to assets/css.svg diff --git a/scripts/assets/dart.svg b/assets/dart.svg similarity index 100% rename from scripts/assets/dart.svg rename to assets/dart.svg diff --git a/scripts/assets/djiango.svg b/assets/djiango.svg similarity index 100% rename from scripts/assets/djiango.svg rename to assets/djiango.svg diff --git a/scripts/assets/docker.svg b/assets/docker.svg similarity index 100% rename from scripts/assets/docker.svg rename to assets/docker.svg diff --git a/scripts/assets/dockerfile.svg b/assets/dockerfile.svg similarity index 100% rename from scripts/assets/dockerfile.svg rename to assets/dockerfile.svg diff --git a/scripts/assets/electron.svg b/assets/electron.svg similarity index 100% rename from scripts/assets/electron.svg rename to assets/electron.svg diff --git a/scripts/assets/emacs.svg b/assets/emacs.svg similarity index 100% rename from scripts/assets/emacs.svg rename to assets/emacs.svg diff --git a/scripts/assets/emmet.svg b/assets/emmet.svg similarity index 100% rename from scripts/assets/emmet.svg rename to assets/emmet.svg diff --git a/scripts/assets/emoji.svg b/assets/emoji.svg similarity index 100% rename from scripts/assets/emoji.svg rename to assets/emoji.svg diff --git a/scripts/assets/expressjs.svg b/assets/expressjs.svg similarity index 100% rename from scripts/assets/expressjs.svg rename to assets/expressjs.svg diff --git a/scripts/assets/ffmpeg.svg b/assets/ffmpeg.svg similarity index 100% rename from scripts/assets/ffmpeg.svg rename to assets/ffmpeg.svg diff --git a/scripts/assets/find.svg b/assets/find.svg similarity index 100% rename from scripts/assets/find.svg rename to assets/find.svg diff --git a/scripts/assets/flutter.svg b/assets/flutter.svg similarity index 100% rename from scripts/assets/flutter.svg rename to assets/flutter.svg diff --git a/scripts/assets/git.svg b/assets/git.svg similarity index 100% rename from scripts/assets/git.svg rename to assets/git.svg diff --git a/scripts/assets/github-actions.svg b/assets/github-actions.svg similarity index 100% rename from scripts/assets/github-actions.svg rename to assets/github-actions.svg diff --git a/scripts/assets/gitlab-ci.svg b/assets/gitlab-ci.svg similarity index 100% rename from scripts/assets/gitlab-ci.svg rename to assets/gitlab-ci.svg diff --git a/scripts/assets/gmail.svg b/assets/gmail.svg similarity index 100% rename from scripts/assets/gmail.svg rename to assets/gmail.svg diff --git a/scripts/assets/golang.svg b/assets/golang.svg similarity index 100% rename from scripts/assets/golang.svg rename to assets/golang.svg diff --git a/scripts/assets/graphql.svg b/assets/graphql.svg similarity index 100% rename from scripts/assets/graphql.svg rename to assets/graphql.svg diff --git a/scripts/assets/grep.svg b/assets/grep.svg similarity index 100% rename from scripts/assets/grep.svg rename to assets/grep.svg diff --git a/scripts/assets/homebrew.svg b/assets/homebrew.svg similarity index 100% rename from scripts/assets/homebrew.svg rename to assets/homebrew.svg diff --git a/scripts/assets/html.svg b/assets/html.svg similarity index 100% rename from scripts/assets/html.svg rename to assets/html.svg diff --git a/scripts/assets/htop.svg b/assets/htop.svg similarity index 100% rename from scripts/assets/htop.svg rename to assets/htop.svg diff --git a/scripts/assets/java.svg b/assets/java.svg similarity index 100% rename from scripts/assets/java.svg rename to assets/java.svg diff --git a/scripts/assets/javascript.svg b/assets/javascript.svg similarity index 100% rename from scripts/assets/javascript.svg rename to assets/javascript.svg diff --git a/scripts/assets/jest.svg b/assets/jest.svg similarity index 100% rename from scripts/assets/jest.svg rename to assets/jest.svg diff --git a/scripts/assets/json.svg b/assets/json.svg similarity index 100% rename from scripts/assets/json.svg rename to assets/json.svg diff --git a/scripts/assets/julia.svg b/assets/julia.svg similarity index 100% rename from scripts/assets/julia.svg rename to assets/julia.svg diff --git a/scripts/assets/koajs.svg b/assets/koajs.svg similarity index 100% rename from scripts/assets/koajs.svg rename to assets/koajs.svg diff --git a/scripts/assets/kotlin.svg b/assets/kotlin.svg similarity index 100% rename from scripts/assets/kotlin.svg rename to assets/kotlin.svg diff --git a/scripts/assets/laravel.svg b/assets/laravel.svg similarity index 100% rename from scripts/assets/laravel.svg rename to assets/laravel.svg diff --git a/scripts/assets/latex.svg b/assets/latex.svg similarity index 100% rename from scripts/assets/latex.svg rename to assets/latex.svg diff --git a/scripts/assets/lerna.svg b/assets/lerna.svg similarity index 100% rename from scripts/assets/lerna.svg rename to assets/lerna.svg diff --git a/scripts/assets/lessjs.svg b/assets/lessjs.svg similarity index 100% rename from scripts/assets/lessjs.svg rename to assets/lessjs.svg diff --git a/scripts/assets/lua.svg b/assets/lua.svg similarity index 100% rename from scripts/assets/lua.svg rename to assets/lua.svg diff --git a/scripts/assets/markdown.svg b/assets/markdown.svg similarity index 100% rename from scripts/assets/markdown.svg rename to assets/markdown.svg diff --git a/scripts/assets/matlab.svg b/assets/matlab.svg similarity index 100% rename from scripts/assets/matlab.svg rename to assets/matlab.svg diff --git a/scripts/assets/menu.svg b/assets/menu.svg similarity index 100% rename from scripts/assets/menu.svg rename to assets/menu.svg diff --git a/scripts/assets/mitmproxy.svg b/assets/mitmproxy.svg similarity index 100% rename from scripts/assets/mitmproxy.svg rename to assets/mitmproxy.svg diff --git a/scripts/assets/mysql.svg b/assets/mysql.svg similarity index 100% rename from scripts/assets/mysql.svg rename to assets/mysql.svg diff --git a/scripts/assets/nestjs.svg b/assets/nestjs.svg similarity index 100% rename from scripts/assets/nestjs.svg rename to assets/nestjs.svg diff --git a/scripts/assets/netcat.svg b/assets/netcat.svg similarity index 100% rename from scripts/assets/netcat.svg rename to assets/netcat.svg diff --git a/scripts/assets/netstat.svg b/assets/netstat.svg similarity index 100% rename from scripts/assets/netstat.svg rename to assets/netstat.svg diff --git a/scripts/assets/nginx.svg b/assets/nginx.svg similarity index 100% rename from scripts/assets/nginx.svg rename to assets/nginx.svg diff --git a/scripts/assets/npm.svg b/assets/npm.svg similarity index 100% rename from scripts/assets/npm.svg rename to assets/npm.svg diff --git a/scripts/assets/openssl.svg b/assets/openssl.svg similarity index 100% rename from scripts/assets/openssl.svg rename to assets/openssl.svg diff --git a/scripts/assets/oracle.svg b/assets/oracle.svg similarity index 100% rename from scripts/assets/oracle.svg rename to assets/oracle.svg diff --git a/scripts/assets/php.svg b/assets/php.svg similarity index 100% rename from scripts/assets/php.svg rename to assets/php.svg diff --git a/scripts/assets/postgres.svg b/assets/postgres.svg similarity index 100% rename from scripts/assets/postgres.svg rename to assets/postgres.svg diff --git a/scripts/assets/python.svg b/assets/python.svg similarity index 100% rename from scripts/assets/python.svg rename to assets/python.svg diff --git a/scripts/assets/pytorch.svg b/assets/pytorch.svg similarity index 100% rename from scripts/assets/pytorch.svg rename to assets/pytorch.svg diff --git a/scripts/assets/quickreference.svg b/assets/quickreference.svg similarity index 100% rename from scripts/assets/quickreference.svg rename to assets/quickreference.svg diff --git a/scripts/assets/react.svg b/assets/react.svg similarity index 100% rename from scripts/assets/react.svg rename to assets/react.svg diff --git a/scripts/assets/regex.svg b/assets/regex.svg similarity index 100% rename from scripts/assets/regex.svg rename to assets/regex.svg diff --git a/scripts/assets/ruby.svg b/assets/ruby.svg similarity index 100% rename from scripts/assets/ruby.svg rename to assets/ruby.svg diff --git a/scripts/assets/rust.svg b/assets/rust.svg similarity index 100% rename from scripts/assets/rust.svg rename to assets/rust.svg diff --git a/scripts/assets/sass.svg b/assets/sass.svg similarity index 100% rename from scripts/assets/sass.svg rename to assets/sass.svg diff --git a/scripts/assets/sed.svg b/assets/sed.svg similarity index 100% rename from scripts/assets/sed.svg rename to assets/sed.svg diff --git a/scripts/assets/semver.svg b/assets/semver.svg similarity index 100% rename from scripts/assets/semver.svg rename to assets/semver.svg diff --git a/scripts/assets/sketch.svg b/assets/sketch.svg similarity index 100% rename from scripts/assets/sketch.svg rename to assets/sketch.svg diff --git a/scripts/assets/ssh.svg b/assets/ssh.svg similarity index 100% rename from scripts/assets/ssh.svg rename to assets/ssh.svg diff --git a/scripts/assets/styled-components.svg b/assets/styled-components.svg similarity index 100% rename from scripts/assets/styled-components.svg rename to assets/styled-components.svg diff --git a/scripts/assets/stylus.svg b/assets/stylus.svg similarity index 100% rename from scripts/assets/stylus.svg rename to assets/stylus.svg diff --git a/scripts/assets/sublime-text.svg b/assets/sublime-text.svg similarity index 100% rename from scripts/assets/sublime-text.svg rename to assets/sublime-text.svg diff --git a/scripts/assets/swift.svg b/assets/swift.svg similarity index 100% rename from scripts/assets/swift.svg rename to assets/swift.svg diff --git a/scripts/assets/swiftui.svg b/assets/swiftui.svg similarity index 100% rename from scripts/assets/swiftui.svg rename to assets/swiftui.svg diff --git a/scripts/assets/sysdig.svg b/assets/sysdig.svg similarity index 100% rename from scripts/assets/sysdig.svg rename to assets/sysdig.svg diff --git a/scripts/assets/systemd.svg b/assets/systemd.svg similarity index 100% rename from scripts/assets/systemd.svg rename to assets/systemd.svg diff --git a/scripts/assets/tar.svg b/assets/tar.svg similarity index 100% rename from scripts/assets/tar.svg rename to assets/tar.svg diff --git a/scripts/assets/tmux.svg b/assets/tmux.svg similarity index 100% rename from scripts/assets/tmux.svg rename to assets/tmux.svg diff --git a/scripts/assets/toml.svg b/assets/toml.svg similarity index 100% rename from scripts/assets/toml.svg rename to assets/toml.svg diff --git a/scripts/assets/typescript.svg b/assets/typescript.svg similarity index 100% rename from scripts/assets/typescript.svg rename to assets/typescript.svg diff --git a/scripts/assets/vim.svg b/assets/vim.svg similarity index 100% rename from scripts/assets/vim.svg rename to assets/vim.svg diff --git a/scripts/assets/vscode.svg b/assets/vscode.svg similarity index 100% rename from scripts/assets/vscode.svg rename to assets/vscode.svg diff --git a/scripts/assets/vue.svg b/assets/vue.svg similarity index 100% rename from scripts/assets/vue.svg rename to assets/vue.svg diff --git a/scripts/assets/vue2.svg b/assets/vue2.svg similarity index 100% rename from scripts/assets/vue2.svg rename to assets/vue2.svg diff --git a/scripts/assets/webstorm.svg b/assets/webstorm.svg similarity index 100% rename from scripts/assets/webstorm.svg rename to assets/webstorm.svg diff --git a/scripts/assets/xcode.svg b/assets/xcode.svg similarity index 100% rename from scripts/assets/xcode.svg rename to assets/xcode.svg diff --git a/scripts/assets/xpath.svg b/assets/xpath.svg similarity index 100% rename from scripts/assets/xpath.svg rename to assets/xpath.svg diff --git a/scripts/assets/yaml.svg b/assets/yaml.svg similarity index 100% rename from scripts/assets/yaml.svg rename to assets/yaml.svg diff --git a/scripts/assets/yarn.svg b/assets/yarn.svg similarity index 100% rename from scripts/assets/yarn.svg rename to assets/yarn.svg diff --git a/package.json b/package.json index 9fca3a2..592717e 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "private": false, "scripts": { "prepare": "husky install", - "build": "node scripts/build.mjs", - "start": "node scripts/watch.mjs", + "build": "refs-cli", + "start": "refs-cli --watch", "prettier": "prettier --write '**/*.{mjs,css,json,prettierrc,lintstagedrc}'", "markdownlint": "npx markdownlint-cli --fix ./docs/*.md" }, @@ -22,26 +22,10 @@ }, "keywords": [], "devDependencies": { - "@uiw/formatter": "^1.3.3", - "@wcj/markdown-to-html": "^2.2.0", - "chokidar": "^3.5.3", - "dotenv": "^16.0.3", - "fs-extra": "^10.1.0", "husky": "^8.0.1", "lint-staged": "^13.0.3", - "markdownlint-cli": "^0.32.2", "prettier": "^2.7.1", - "recursive-readdir-files": "^2.3.0", - "rehype-autolink-headings": "^6.1.1", - "rehype-document": "^6.1.0", - "rehype-parse": "^8.0.4", - "rehype-raw": "^6.1.1", - "rehype-rewrite": "^3.0.6", - "rehype-slug": "^5.0.1", - "remark-gemoji": "^7.0.1", - "unified": "^10.1.2", - "unist-util-visit": "^4.1.1", - "vfile": "^5.3.5" + "refs-cli": "^0.0.5" }, "engines": { "node": ">=16.0.0" diff --git a/scripts/assets/list.svg b/scripts/assets/list.svg deleted file mode 100644 index d52f6f7..0000000 --- a/scripts/assets/list.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/scripts/assets/moon.svg b/scripts/assets/moon.svg deleted file mode 100644 index 80efdd2..0000000 --- a/scripts/assets/moon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/scripts/assets/search.svg b/scripts/assets/search.svg deleted file mode 100644 index 149ca61..0000000 --- a/scripts/assets/search.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/scripts/assets/sun.svg b/scripts/assets/sun.svg deleted file mode 100644 index eeb7198..0000000 --- a/scripts/assets/sun.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/scripts/build.mjs b/scripts/build.mjs deleted file mode 100644 index f3f5729..0000000 --- a/scripts/build.mjs +++ /dev/null @@ -1,3 +0,0 @@ -import { run } from './index.mjs'; - -run(); diff --git a/scripts/create.mjs b/scripts/create.mjs deleted file mode 100644 index 653b3dc..0000000 --- a/scripts/create.mjs +++ /dev/null @@ -1,129 +0,0 @@ -import markdown from '@wcj/markdown-to-html'; -import rehypeDocument from 'rehype-document'; -import remarkGemoji from 'remark-gemoji'; -import rehypeRaw from 'rehype-raw'; -import rehypeAutolinkHeadings from 'rehype-autolink-headings'; -import { getCodeString } from 'rehype-rewrite'; -import rehypeSlug from 'rehype-slug'; -import { htmlTagAddAttri } from './nodes/htmlTagAddAttri.mjs'; -import { footer } from './nodes/footer.mjs'; -import { search } from './nodes/search.mjs'; -import { header } from './nodes/header.mjs'; -import { rehypeUrls } from './utils/rehypeUrls.mjs'; -import { tooltips } from './utils/tooltips.mjs'; -import { homeCardIcons } from './utils/homeCardIcons.mjs'; -import { getTocsTree, getTocsTitleNode, getTocsTitleNodeWarpper, addTocsInWarp } from './utils/getTocsTree.mjs'; -import { rehypeTitle } from './utils/rehypeTitle.mjs'; -import { rehypePreviewHTML } from './utils/rehypePreviewHTML.mjs'; - -const favicon = `data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20height%3D%221em%22%20width%3D%221em%22%3E%20%3Cpath%20d%3D%22m21.66%2010.44-.98%204.18c-.84%203.61-2.5%205.07-5.62%204.77-.5-.04-1.04-.13-1.62-.27l-1.68-.4c-4.17-.99-5.46-3.05-4.48-7.23l.98-4.19c.2-.85.44-1.59.74-2.2%201.17-2.42%203.16-3.07%206.5-2.28l1.67.39c4.19.98%205.47%203.05%204.49%207.23Z%22%20fill%3D%22%23c9d1d9%22%2F%3E%20%3Cpath%20d%3D%22M15.06%2019.39c-.62.42-1.4.77-2.35%201.08l-1.58.52c-3.97%201.28-6.06.21-7.35-3.76L2.5%2013.28c-1.28-3.97-.22-6.07%203.75-7.35l1.58-.52c.41-.13.8-.24%201.17-.31-.3.61-.54%201.35-.74%202.2l-.98%204.19c-.98%204.18.31%206.24%204.48%207.23l1.68.4c.58.14%201.12.23%201.62.27Zm2.43-8.88c-.06%200-.12-.01-.19-.02l-4.85-1.23a.75.75%200%200%201%20.37-1.45l4.85%201.23a.748.748%200%200%201-.18%201.47Z%22%20fill%3D%22%23228e6c%22%20%2F%3E%20%3Cpath%20d%3D%22M14.56%2013.89c-.06%200-.12-.01-.19-.02l-2.91-.74a.75.75%200%200%201%20.37-1.45l2.91.74c.4.1.64.51.54.91-.08.34-.38.56-.72.56Z%22%20fill%3D%22%23228e6c%22%20%2F%3E%20%3C%2Fsvg%3E`; - -export function create(str = '', options = {}) { - let title = str.match(/[^===]+(?=[===])/g) || []; - let description = str.match(/\n==={1,}\n+([\s\S]*?)\n/g) || []; - title = title[0] || ''; - description = (description[0] || '') - .replace(/^\n[=\n]+/, '') - .replace(/\[([\s\S]*?)?\]\(([\s\S]*?)?\)/g, '$1') - .replace(//gi, '') - .replace(/\n/, ''); - const subTitle = options.filename && !options.isHome ? `${options.filename} cheatsheet & ` : ''; - /** 用于搜索数据 */ - const detailData = { - title: title.replace(/\n/g, ''), - path: '', - intro: description, - icon: '', - sections: [], - }; - const mdOptions = { - showLineNumbers: false, - hastNode: false, - katexOptions: { - strict: false, - }, - remarkPlugins: [remarkGemoji], - rehypePlugins: [ - rehypeSlug, - rehypeAutolinkHeadings, - [ - rehypeDocument, - { - title: `${title ? `${title} & ` : ''} ${subTitle} Quick Reference`, - css: [...options.css], - link: [{ rel: 'icon', href: favicon, type: 'image/svg+xml' }], - meta: [ - { description: `${description}为开发人员分享快速参考备忘单。` }, - { keywords: `Quick,Reference,cheatsheet,${(!options.isHome && options.filename) || ''}` }, - ], - }, - ], - ], - filterPlugins: (type, plugins = []) => { - if (type === 'rehype') { - let rehypePrism = null; - const dt = plugins.filter((plug) => { - if (Array.isArray(plug) && /(rehypePrism)/.test(plug[0].name)) { - rehypePrism = plug; - } - return /(rehypeRaw|rehypePrism)/.test(plug.name) ? false : true; - }); - // 放在 rehypeDocument 前面 - dt.unshift(rehypeRaw); - if (rehypePrism) { - dt.unshift(rehypePrism); - } - dt.unshift(rehypePreviewHTML); - return dt; - } - return plugins; - }, - rewrite: (node, index, parent) => { - const iconName = rehypeTitle(node, options.filename); - if (iconName) { - detailData.icon = iconName; - } - const resultHomeCard = homeCardIcons(node, parent, options.isHome); - if (options.filename && resultHomeCard[options.filename]) { - detailData.rgb = resultHomeCard[options.filename].rgb; - detailData.name = resultHomeCard[options.filename].title; - if (resultHomeCard[options.filename].tags) { - detailData.tags = resultHomeCard[options.filename].tags; - } - } - tooltips(node, index, parent); - htmlTagAddAttri(node, options); - rehypeUrls(node); - if (node.children) { - if (node.type === 'element' && node.tagName === 'body') { - const tocsData = getTocsTree([...node.children]); - if (!options.isHome) { - const tocsMenus = getTocsTitleNode([...tocsData]); - node.children = addTocsInWarp([...tocsData], getTocsTitleNodeWarpper(tocsMenus)); - // 生成搜索数据 - tocsMenus.forEach((menu, idx) => { - const level = menu?.properties['data-num']; - if (idx + 1 === tocsMenus.length && level === 2) { - return; - } - if (level < 4) { - detailData.sections.push({ - a: menu?.properties?.href, - t: getCodeString(menu.children), - l: menu?.properties['data-num'], - }); - } - }); - } else { - node.children = tocsData; - } - node.children.unshift(header(options)); - node.children.push(footer(options)); - node.children = node.children.concat(search(options)); - } - } - }, - }; - const htmlStr = markdown(str, mdOptions); - return { html: htmlStr, data: detailData }; -} diff --git a/scripts/index.mjs b/scripts/index.mjs deleted file mode 100644 index 8771d6e..0000000 --- a/scripts/index.mjs +++ /dev/null @@ -1,87 +0,0 @@ -import fs from 'fs-extra'; -import path from 'path'; -import recursiveReaddirFiles from 'recursive-readdir-files'; -import { create } from './create.mjs'; - -export const OUTOUT = path.resolve(process.cwd(), 'dist'); -export const DOCS = path.resolve(process.cwd(), 'docs'); -/** 搜索数据路径 */ -export const SEARCH_DATA = path.resolve(OUTOUT, 'data.json'); -export const SEARCH_DATA_JS = path.resolve(OUTOUT, 'data.js'); -export const SEARCH_DATA_CACHE = path.resolve(process.cwd(), 'node_modules/.cache/reference/data.json'); - -export async function createHTML(files = [], num = 0) { - const dataFile = files[num]; - if (!dataFile) { - console.log(' \n done!\n'); - return; - } - ++num; - const githubURL = `https://github.com/jaywcjlove/reference/blob/main/${path - .relative(process.cwd(), dataFile.path) - .replace(path.sep, '/')}`; - - const mdstr = await fs.readFile(dataFile.path); - const htmlPath = path.relative(DOCS, dataFile.path); - const outputHTMLPath = path - .resolve(OUTOUT, 'docs', htmlPath) - .replace(/README.md$/i, 'index.html') - .replace(/.md$/, '.html'); - - await fs.ensureDir(path.dirname(outputHTMLPath)); - const options = { - filename: path.basename(outputHTMLPath, '.html'), - isHome: /README.md$/.test(path.relative(process.cwd(), dataFile.path)), - githubURL, - homePath: path.relative(path.dirname(outputHTMLPath), path.resolve(OUTOUT, 'index.html')), - css: [ - path.relative(path.dirname(outputHTMLPath), path.resolve(OUTOUT, 'style/style.css')), - path.relative(path.dirname(outputHTMLPath), path.resolve(OUTOUT, 'style/katex.css')), - ], - }; - const { html, data } = create(mdstr.toString(), options); - if (!options.isHome) { - const searchData = await fs.readJSON(SEARCH_DATA_CACHE); - data.path = path.relative(OUTOUT, outputHTMLPath).replace(/[\\/]/g, '/'); - searchData[options.filename] = data; - searchData.name = options.filename; - await fs.writeJSON(SEARCH_DATA_CACHE, searchData); - const resultSearchData = Object.keys({ ...searchData }) - .map((name) => searchData[name]) - .filter((item) => typeof item !== 'string'); - await fs.writeJSON(SEARCH_DATA, resultSearchData); - await fs.writeFile(SEARCH_DATA_JS, `const REFS_DATA = ${JSON.stringify(resultSearchData)}`); - } - await fs.writeFile(outputHTMLPath, html); - console.log(`♻️ \x1b[32;1m ${path.relative(OUTOUT, outputHTMLPath)} \x1b[0m`); - createHTML(files, num); -} - -export async function copyCSSFile() { - await fs.copy(path.resolve(process.cwd(), 'scripts/style'), path.resolve(OUTOUT, 'style')); -} - -export async function copyJSFile() { - await fs.copy(path.resolve(process.cwd(), 'scripts/js'), path.resolve(OUTOUT, 'js')); -} - -export async function run() { - try { - await fs.ensureDir(OUTOUT); - await fs.emptyDir(OUTOUT); - await fs.ensureDir(path.resolve(OUTOUT, 'style')); - await fs.ensureFile(SEARCH_DATA_CACHE); - await fs.writeFile(SEARCH_DATA_CACHE, '{}'); - await fs.writeFile(SEARCH_DATA, '[]'); - await copyCSSFile(); - await copyJSFile(); - const files = await recursiveReaddirFiles(process.cwd(), { - ignored: /[\\/](node_modules|\.git)/g, - exclude: /(\.json|\.mjs|CONTRIBUTING\.md)$/, - filter: (item) => item.ext === 'md', - }); - createHTML(files); - } catch (error) { - console.log('ERR:', error); - } -} diff --git a/scripts/js/dark.js b/scripts/js/dark.js deleted file mode 100644 index 58e853a..0000000 --- a/scripts/js/dark.js +++ /dev/null @@ -1,12 +0,0 @@ -const LOCAL_NANE = '_dark_mode_theme_' -const rememberedValue = localStorage.getItem(LOCAL_NANE); -if (rememberedValue && ['light', 'dark'].includes(rememberedValue)) { - document.documentElement.setAttribute('data-color-mode', rememberedValue); -} -const button = document.querySelector('#darkMode'); -button.onclick = () => { - const theme = document.documentElement.dataset.colorMode; - const mode = theme === 'light' ? 'dark' : 'light'; - document.documentElement.setAttribute('data-color-mode', mode); - localStorage.setItem(LOCAL_NANE, mode); -} \ No newline at end of file diff --git a/scripts/js/fuse.min.js b/scripts/js/fuse.min.js deleted file mode 100644 index 455ad13..0000000 --- a/scripts/js/fuse.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) - * - * Copyright (c) 2022 Kiro Risk (http://kiro.me) - * All Rights Reserved. Apache Software License 2.0 - * - * http://www.apache.org/licenses/LICENSE-2.0 - */ - var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,l=i.includeMatches,f=void 0===l?I.includeMatches:l,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,l=void 0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=l(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,l=void 0===h?I.distance:h,f=o.includeMatches,d=void 0===f?I.includeMatches:f,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void 0===f?I.findAllMatches:f,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(le(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=le(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); diff --git a/scripts/js/main.js b/scripts/js/main.js deleted file mode 100644 index e6e19fc..0000000 --- a/scripts/js/main.js +++ /dev/null @@ -1,186 +0,0 @@ -/** ==========anchor============== */ -if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) { - window.onhashchange = function () { - anchorPoint() - updateAnchor() - }; -} -function anchorPoint() { - const hash = window.location.hash?.replace(/^#/, '') || ''; - const elm = document.getElementById(decodeURIComponent(hash)); - Array.from(document.querySelectorAll('.h2wrap-body .wrap')).forEach((elm) => elm.classList.remove('active')) - if (elm?.tagName === 'H3') { - elm?.parentElement?.parentElement?.classList.add('active'); - } -} -anchorPoint(); -function updateAnchor(element) { - const anchorContainer = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); - anchorContainer.forEach((tocanchor) => { - tocanchor.classList.remove('is-active-link'); - }); - const anchor = element || document.querySelector(`a.tocs-link[href='${decodeURIComponent(window.location.hash)}']`); - if (anchor) { - anchor.classList.add('is-active-link'); - } -} -// toc 定位 -updateAnchor() -const anchorAll = document.querySelectorAll('.menu-tocs .menu-modal a.tocs-link'); -anchorAll.forEach((item) => { - item.addEventListener('click', (e) => { - updateAnchor() - }) -}) - -/** ==========search============== */ -const fuse = new Fuse(REFS_DATA, { - includeScore: !1, - shouldSort: !0, - includeMatches: !0, - matchEmptyQuery: !0, - threshold: .1, - keys: [ - { name: "name", weight: 20 }, - { name: 'intro', weight: 2 }, - { name: 'tags', weight: 2 }, - { name: 'sections.t', weight: 5 } - ], -}); - -const searchBtn = document.getElementById('searchbtn'); -const searchBox = document.getElementById('mysearch'); -const searchInput = document.getElementById('mysearch-input'); -const closeBtn = document.getElementById('mysearch-close'); -const searchMenu = document.getElementById('mysearch-menu'); -const searchContent = document.getElementById('mysearch-content'); -const isHome = document.body.classList.contains('home'); -function getDocUrl(url = '') { - return isHome ? url : url.replace('docs/', ''); -} -searchBtn.addEventListener('click', (ev) => { - ev.preventDefault(); - showSearch(); -}); - -closeBtn.addEventListener('click', hideSearch); -searchBox.addEventListener('click', hideSearch); -searchBox.firstChild.addEventListener('click', (ev) => ev.stopPropagation()); -searchInput.addEventListener('input', (evn) => searchResult(evn.target.value)); - -let activeMenu = {} -let result = [] -let inputValue = ''; -let activeIndex = 0 - -document.addEventListener('keydown', (ev) => { - if (ev.metaKey && ev.key.toLocaleLowerCase() === 'k') { - searchBox.classList.contains('show') ? hideSearch() : showSearch(); - } - if (ev.key.toLocaleLowerCase() === 'enter') { - const url = activeMenu.path || activeMenu?.item.path; - window.location.href = getDocUrl(url); - } - if (ev.key.toLocaleLowerCase() === 'arrowdown') { - activeAnchorElm('down') - } - if (ev.key.toLocaleLowerCase() === 'arrowup') { - activeAnchorElm('up') - } -}); - -function activeAnchorElm(type) { - if (type === 'down') { - ++activeIndex; - } - if (type === 'up') { - --activeIndex; - } - const data = Array.from(searchMenu.children); - if (activeIndex < 0) activeIndex = 0; - if (activeIndex >= data.length) activeIndex = data.length - 1; - anchorElm = data[activeIndex]; - if (anchorElm) { - data.forEach(item => item.classList.remove('active')); - anchorElm.classList.add('active'); - activeMenu = result[activeIndex]; - activeIndex = activeIndex; - searchSectionsResult(activeIndex); - } -} - -function showSearch() { - document.body.classList.add('search'); - searchBox.classList.add('show'); - searchResult(searchInput.value || ''); - searchInput.focus(); -} - -function hideSearch() { - document.body.classList.remove('search'); - searchBox.classList.remove('show'); -} -function getValueReg(val = '') { - return new RegExp(val.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d'), 'ig'); -} - -function searchResult(value) { - inputValue = value; - result = fuse.search(value); - if (!value) { - result = REFS_DATA.map(item => ({ item: item })); - } - let menuHTML = ''; - result.forEach((item, idx) => { - const label = (item.item.name || '').replace(getValueReg(value), (txt) => { - return `${txt}`; - }) - const tags = (item.item.tags || []).join(',').replace(getValueReg(value), (txt) => { - return `${txt}`; - }) - const href = isHome ? item.item.path : item.item.path.replace('docs/', ''); - if (idx === 0) { - activeIndex = idx; - activeMenu = item.item; - menuHTML += `${label}${tags}`; - } else { - menuHTML += `${label}${tags}`; - } - }); - searchMenu.innerHTML = menuHTML; - searchSectionsResult(); - const data = Array.from(searchMenu.children); - data.forEach((anchor, idx) => { - anchor.onmouseenter = (evn) => { - data.forEach(item => item.classList.remove('active')); - evn.target.classList.add('active'); - activeMenu = result[idx]; - activeIndex = idx; - searchSectionsResult(idx); - } - }); - const anchorData = searchContent.querySelectorAll('a'); - Array.from(anchorData).forEach((item) => { - item.addEventListener('click', hideSearch); - }) -} -function searchSectionsResult(idx = 0) { - const data = result[idx] || []; - const title = (data.item?.intro || '').replace(getValueReg(inputValue), (txt) => `${txt}`); - let sectionHTML = `

${title}

    `; - if (data && data.item && data.item.sections) { - data.item.sections.forEach((item, idx) => { - const label = item.t.replace(getValueReg(inputValue), (txt) => `${txt}`); - const href = getDocUrl(data.item.path); - if (item.l < 3) { - sectionHTML += `
  1. ${label}
    `; - } else { - sectionHTML += `${label}`; - } - if (data.item.sections.length === idx + 1) { - sectionHTML += `
  2. `; - } - }) - } - searchContent.innerHTML = sectionHTML; -} \ No newline at end of file diff --git a/scripts/nodes/footer.mjs b/scripts/nodes/footer.mjs deleted file mode 100644 index f3a454d..0000000 --- a/scripts/nodes/footer.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import formatter from '@uiw/formatter'; - -export function footer({ isHome } = {}) { - let footerText = '© 2022 Kenny Wang.'; - if (isHome) { - const now = new Date(); - const utc = now.getTime() + now.getTimezoneOffset() * 60000; - const cst = new Date(utc + 3600000 * 8); - footerText += ` Updated on ${formatter('YYYY/MM/DD HH:mm:ss', cst)}`; - } - return { - type: 'element', - tagName: 'footer', - properties: { - class: 'footer-wrap', - }, - children: [ - { - type: 'element', - tagName: 'footer', - properties: { - class: ['max-container'], - }, - children: [{ type: 'text', value: footerText }], - }, - ], - }; -} diff --git a/scripts/nodes/header.mjs b/scripts/nodes/header.mjs deleted file mode 100644 index 9b81768..0000000 --- a/scripts/nodes/header.mjs +++ /dev/null @@ -1,155 +0,0 @@ -import path from 'path'; -import * as dotenv from 'dotenv'; -import { github, editor, home } from './logo.mjs'; -import { getSVGNode } from '../utils/getSVGNode.mjs'; -import { darkMode } from '../utils/darkMode.mjs'; - -dotenv.config(); - -const ICONS_PATH = path.resolve(process.cwd(), 'scripts/assets/quickreference.svg'); -const ICONS_SEARCH_PATH = path.resolve(process.cwd(), 'scripts/assets/search.svg'); - -export function getReferrals() { - const url = process.env.REF_URL; - const label = process.env.REF_LABEL; - if (!url || !label) return []; - return [ - { - menu: true, - href: url, - target: '__blank', - label: label, - children: [home], - }, - ]; -} - -export function header({ homePath, githubURL = '', isHome } = {}) { - const svgNode = getSVGNode(ICONS_PATH); - const svgSearchNode = getSVGNode(ICONS_SEARCH_PATH); - const data = [ - { - menu: true, - href: 'javascript:void(0);', - class: ['searchbtn'], - id: 'searchbtn', - children: [ - ...svgSearchNode, - { - type: 'element', - tagName: 'span', - children: [ - { - type: 'text', - value: '搜索', - }, - ], - }, - { - type: 'element', - tagName: 'span', - children: [ - { - type: 'text', - value: '⌘', - }, - { - type: 'text', - value: 'K', - }, - ], - }, - ], - }, - ...getReferrals(), - { - menu: true, - href: githubURL, - target: '__blank', - label: '编辑', - children: [editor], - }, - ...darkMode({ homePath, isHome }), - { - menu: true, - href: 'https://github.com/jaywcjlove/reference', - target: '__blank', - children: [github], - }, - ]; - return { - type: 'element', - tagName: 'nav', - properties: { - class: 'header-nav', - }, - children: [ - { - type: 'element', - tagName: 'div', - properties: { - class: ['max-container'], - }, - children: [ - { - type: 'element', - tagName: 'a', - properties: { - href: homePath, - class: ['logo'], - }, - children: [ - ...svgNode, - { - type: 'element', - tagName: 'span', - properties: { - class: ['title'], - }, - children: [{ type: 'text', value: 'Quick Reference' }], - }, - ], - }, - { - type: 'element', - tagName: 'div', - properties: { - class: ['menu'], - }, - children: data.map(({ href, label, menu, children = [], ...props }) => { - if (!menu) return { children, ...props }; - const childs = { - type: 'element', - tagName: 'a', - properties: { href, class: [], ...props }, - children: [ - ...children, - { - type: 'element', - tagName: 'span', - properties: {}, - children: label ? [{ type: 'text', value: label }] : [], - }, - ], - }; - if (label) { - childs.children = [ - ...children, - { - type: 'element', - tagName: 'span', - properties: {}, - children: [{ type: 'text', value: label }], - }, - ]; - } else { - childs.children = children; - } - return childs; - }), - }, - ], - }, - ], - }; -} diff --git a/scripts/nodes/htmlTagAddAttri.mjs b/scripts/nodes/htmlTagAddAttri.mjs deleted file mode 100644 index e87332f..0000000 --- a/scripts/nodes/htmlTagAddAttri.mjs +++ /dev/null @@ -1,8 +0,0 @@ -export function htmlTagAddAttri(node, { isHome }) { - if (node && node.tagName === 'html') { - node.properties['data-color-mode'] = 'dark'; - } - if (node && node.tagName === 'body' && isHome) { - node.properties.class = ['home']; - } -} diff --git a/scripts/nodes/logo.mjs b/scripts/nodes/logo.mjs deleted file mode 100644 index 2b24f3a..0000000 --- a/scripts/nodes/logo.mjs +++ /dev/null @@ -1,116 +0,0 @@ -export const logo = [ - { - type: 'element', - tagName: 'svg', - properties: { - viewBox: '0 0 24 24', - fill: 'none', - xmlns: 'http://www.w3.org/2000/svg', - height: '1em', - width: '1em', - }, - children: [ - { - type: 'element', - tagName: 'path', - properties: { - opacity: '.5', - d: 'm21.66 10.44-.98 4.18c-.84 3.61-2.5 5.07-5.62 4.77-.5-.04-1.04-.13-1.62-.27l-1.68-.4c-4.17-.99-5.46-3.05-4.48-7.23l.98-4.19c.2-.85.44-1.59.74-2.2 1.17-2.42 3.16-3.07 6.5-2.28l1.67.39c4.19.98 5.47 3.05 4.49 7.23Z', - fill: 'white', - }, - }, - { - type: 'element', - tagName: 'path', - properties: { - d: 'M15.06 19.39c-.62.42-1.4.77-2.35 1.08l-1.58.52c-3.97 1.28-6.06.21-7.35-3.76L2.5 13.28c-1.28-3.97-.22-6.07 3.75-7.35l1.58-.52c.41-.13.8-.24 1.17-.31-.3.61-.54 1.35-.74 2.2l-.98 4.19c-.98 4.18.31 6.24 4.48 7.23l1.68.4c.58.14 1.12.23 1.62.27Zm2.43-8.88c-.06 0-.12-.01-.19-.02l-4.85-1.23a.75.75 0 0 1 .37-1.45l4.85 1.23a.748.748 0 0 1-.18 1.47Z', - fill: '#cbd5e1', - }, - }, - { - type: 'element', - tagName: 'path', - properties: { - d: 'M14.56 13.89c-.06 0-.12-.01-.19-.02l-2.91-.74a.75.75 0 0 1 .37-1.45l2.91.74c.4.1.64.51.54.91-.08.34-.38.56-.72.56Z', - fill: '#292D32', - }, - }, - ], - }, - { - type: 'element', - tagName: 'span', - properties: { - class: ['title'], - }, - children: [{ type: 'text', value: 'Quick Reference' }], - }, -]; - -export const github = { - type: 'element', - tagName: 'svg', - properties: { - viewBox: '0 0 16 16', - fill: 'currentColor', - height: '1em', - width: '1em', - }, - children: [ - { - type: 'element', - tagName: 'path', - properties: { - d: 'M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z', - }, - }, - ], -}; - -export const editor = { - type: 'element', - tagName: 'svg', - properties: { - viewBox: '0 0 36 36', - fill: 'currentColor', - height: '1em', - width: '1em', - }, - children: [ - { - type: 'element', - tagName: 'path', - properties: { - d: 'm33 6.4-3.7-3.7a1.71 1.71 0 0 0-2.36 0L23.65 6H6a2 2 0 0 0-2 2v22a2 2 0 0 0 2 2h22a2 2 0 0 0 2-2V11.76l3-3a1.67 1.67 0 0 0 0-2.36ZM18.83 20.13l-4.19.93 1-4.15 9.55-9.57 3.23 3.23ZM29.5 9.43 26.27 6.2l1.85-1.85 3.23 3.23Z', - }, - }, - { - type: 'element', - tagName: 'path', - properties: { - fill: 'none', - d: 'M0 0h36v36H0z', - }, - }, - ], -}; - -export const home = { - type: 'element', - tagName: 'svg', - properties: { - viewBox: '0 0 24 24', - fill: 'currentColor', - height: '1em', - width: '1em', - }, - children: [ - { - type: 'element', - tagName: 'path', - properties: { - d: 'M12.74 2.32a1 1 0 0 0-1.48 0l-9 10A1 1 0 0 0 3 14h2v7a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7h2a1 1 0 0 0 1-1 1 1 0 0 0-.26-.68z', - }, - }, - ], -}; diff --git a/scripts/nodes/search.mjs b/scripts/nodes/search.mjs deleted file mode 100644 index 7e8eaff..0000000 --- a/scripts/nodes/search.mjs +++ /dev/null @@ -1,115 +0,0 @@ -import path from 'path'; -import { getSVGNode } from '../utils/getSVGNode.mjs'; - -const ICONS_SEARCH_PATH = path.resolve(process.cwd(), 'scripts/assets/search.svg'); - -export function search({ homePath = '', isHome } = {}) { - const relativePath = homePath.replace(/\/?index.html$/, isHome ? '' : '/'); - const fuseJSUrl = relativePath + 'js/fuse.min.js'; - const manJSUrl = relativePath + 'js/main.js'; - const dataJSUrl = relativePath + 'data.js'; - const svgSearchNode = getSVGNode(ICONS_SEARCH_PATH); - return [ - { - type: 'element', - tagName: 'div', - properties: { - id: 'mysearch', - }, - children: [ - { - type: 'element', - tagName: 'div', - properties: { - class: ['mysearch-box'], - }, - children: [ - { - type: 'element', - tagName: 'div', - properties: { class: ['mysearch-input'] }, - children: [ - { - type: 'element', - tagName: 'div', - properties: {}, - children: [ - ...svgSearchNode, - { - type: 'element', - tagName: 'input', - properties: { - id: ['mysearch-input'], - type: 'search', - placeholder: '搜索备忘清单', - autocomplete: 'off', - }, - children: [], - }, - { - type: 'element', - tagName: 'div', - properties: { class: ['mysearch-clear'] }, - }, - ], - }, - { - type: 'element', - tagName: 'button', - properties: { id: ['mysearch-close'], type: 'button' }, - children: [{ type: 'text', value: '取消' }], - }, - ], - }, - { - type: 'element', - tagName: 'div', - properties: { class: ['mysearch-result'] }, - children: [ - { - type: 'element', - tagName: 'div', - properties: { id: 'mysearch-menu' }, - children: [], - }, - { - type: 'element', - tagName: 'div', - properties: { id: 'mysearch-content' }, - children: [], - }, - ], - }, - ], - }, - ], - }, - { - type: 'element', - tagName: 'script', - properties: { - src: dataJSUrl, - type: 'text/javascript', - defer: true, - }, - }, - { - type: 'element', - tagName: 'script', - properties: { - src: fuseJSUrl, - type: 'text/javascript', - defer: true, - }, - }, - { - type: 'element', - tagName: 'script', - properties: { - src: manJSUrl, - type: 'text/javascript', - defer: true, - }, - }, - ]; -} diff --git a/scripts/style/fonts/KaTeX_AMS-Regular.ttf b/scripts/style/fonts/KaTeX_AMS-Regular.ttf deleted file mode 100644 index c6f9a5e..0000000 Binary files a/scripts/style/fonts/KaTeX_AMS-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_AMS-Regular.woff b/scripts/style/fonts/KaTeX_AMS-Regular.woff deleted file mode 100644 index b804d7b..0000000 Binary files a/scripts/style/fonts/KaTeX_AMS-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_AMS-Regular.woff2 b/scripts/style/fonts/KaTeX_AMS-Regular.woff2 deleted file mode 100644 index 0acaaff..0000000 Binary files a/scripts/style/fonts/KaTeX_AMS-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Bold.ttf b/scripts/style/fonts/KaTeX_Caligraphic-Bold.ttf deleted file mode 100644 index 9ff4a5e..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Bold.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff b/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff deleted file mode 100644 index 9759710..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff2 b/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff2 deleted file mode 100644 index f390922..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Bold.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Regular.ttf b/scripts/style/fonts/KaTeX_Caligraphic-Regular.ttf deleted file mode 100644 index f522294..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff b/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff deleted file mode 100644 index 9bdd534..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff2 b/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff2 deleted file mode 100644 index 75344a1..0000000 Binary files a/scripts/style/fonts/KaTeX_Caligraphic-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Bold.ttf b/scripts/style/fonts/KaTeX_Fraktur-Bold.ttf deleted file mode 100644 index 4e98259..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Bold.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Bold.woff b/scripts/style/fonts/KaTeX_Fraktur-Bold.woff deleted file mode 100644 index e7730f6..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Bold.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Bold.woff2 b/scripts/style/fonts/KaTeX_Fraktur-Bold.woff2 deleted file mode 100644 index 395f28b..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Bold.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Regular.ttf b/scripts/style/fonts/KaTeX_Fraktur-Regular.ttf deleted file mode 100644 index b8461b2..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Regular.woff b/scripts/style/fonts/KaTeX_Fraktur-Regular.woff deleted file mode 100644 index acab069..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Fraktur-Regular.woff2 b/scripts/style/fonts/KaTeX_Fraktur-Regular.woff2 deleted file mode 100644 index 735f694..0000000 Binary files a/scripts/style/fonts/KaTeX_Fraktur-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Bold.ttf b/scripts/style/fonts/KaTeX_Main-Bold.ttf deleted file mode 100644 index 4060e62..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Bold.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Bold.woff b/scripts/style/fonts/KaTeX_Main-Bold.woff deleted file mode 100644 index f38136a..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Bold.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Bold.woff2 b/scripts/style/fonts/KaTeX_Main-Bold.woff2 deleted file mode 100644 index ab2ad21..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Bold.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-BoldItalic.ttf b/scripts/style/fonts/KaTeX_Main-BoldItalic.ttf deleted file mode 100644 index dc00797..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-BoldItalic.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-BoldItalic.woff b/scripts/style/fonts/KaTeX_Main-BoldItalic.woff deleted file mode 100644 index 67807b0..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-BoldItalic.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-BoldItalic.woff2 b/scripts/style/fonts/KaTeX_Main-BoldItalic.woff2 deleted file mode 100644 index 5931794..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-BoldItalic.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Italic.ttf b/scripts/style/fonts/KaTeX_Main-Italic.ttf deleted file mode 100644 index 0e9b0f3..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Italic.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Italic.woff b/scripts/style/fonts/KaTeX_Main-Italic.woff deleted file mode 100644 index 6f43b59..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Italic.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Italic.woff2 b/scripts/style/fonts/KaTeX_Main-Italic.woff2 deleted file mode 100644 index b50920e..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Italic.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Regular.ttf b/scripts/style/fonts/KaTeX_Main-Regular.ttf deleted file mode 100644 index dd45e1e..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Regular.woff b/scripts/style/fonts/KaTeX_Main-Regular.woff deleted file mode 100644 index 21f5812..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Main-Regular.woff2 b/scripts/style/fonts/KaTeX_Main-Regular.woff2 deleted file mode 100644 index eb24a7b..0000000 Binary files a/scripts/style/fonts/KaTeX_Main-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-BoldItalic.ttf b/scripts/style/fonts/KaTeX_Math-BoldItalic.ttf deleted file mode 100644 index 728ce7a..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-BoldItalic.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-BoldItalic.woff b/scripts/style/fonts/KaTeX_Math-BoldItalic.woff deleted file mode 100644 index 0ae390d..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-BoldItalic.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-BoldItalic.woff2 b/scripts/style/fonts/KaTeX_Math-BoldItalic.woff2 deleted file mode 100644 index 2965702..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-BoldItalic.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-Italic.ttf b/scripts/style/fonts/KaTeX_Math-Italic.ttf deleted file mode 100644 index 70d559b..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-Italic.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-Italic.woff b/scripts/style/fonts/KaTeX_Math-Italic.woff deleted file mode 100644 index eb5159d..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-Italic.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Math-Italic.woff2 b/scripts/style/fonts/KaTeX_Math-Italic.woff2 deleted file mode 100644 index 215c143..0000000 Binary files a/scripts/style/fonts/KaTeX_Math-Italic.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Bold.ttf b/scripts/style/fonts/KaTeX_SansSerif-Bold.ttf deleted file mode 100644 index 2f65a8a..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Bold.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Bold.woff b/scripts/style/fonts/KaTeX_SansSerif-Bold.woff deleted file mode 100644 index 8d47c02..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Bold.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Bold.woff2 b/scripts/style/fonts/KaTeX_SansSerif-Bold.woff2 deleted file mode 100644 index cfaa3bd..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Bold.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Italic.ttf b/scripts/style/fonts/KaTeX_SansSerif-Italic.ttf deleted file mode 100644 index d5850df..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Italic.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Italic.woff b/scripts/style/fonts/KaTeX_SansSerif-Italic.woff deleted file mode 100644 index 7e02df9..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Italic.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Italic.woff2 b/scripts/style/fonts/KaTeX_SansSerif-Italic.woff2 deleted file mode 100644 index 349c06d..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Italic.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Regular.ttf b/scripts/style/fonts/KaTeX_SansSerif-Regular.ttf deleted file mode 100644 index 537279f..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Regular.woff b/scripts/style/fonts/KaTeX_SansSerif-Regular.woff deleted file mode 100644 index 31b8482..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_SansSerif-Regular.woff2 b/scripts/style/fonts/KaTeX_SansSerif-Regular.woff2 deleted file mode 100644 index a90eea8..0000000 Binary files a/scripts/style/fonts/KaTeX_SansSerif-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Script-Regular.ttf b/scripts/style/fonts/KaTeX_Script-Regular.ttf deleted file mode 100644 index fd679bf..0000000 Binary files a/scripts/style/fonts/KaTeX_Script-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Script-Regular.woff b/scripts/style/fonts/KaTeX_Script-Regular.woff deleted file mode 100644 index 0e7da82..0000000 Binary files a/scripts/style/fonts/KaTeX_Script-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Script-Regular.woff2 b/scripts/style/fonts/KaTeX_Script-Regular.woff2 deleted file mode 100644 index b3048fc..0000000 Binary files a/scripts/style/fonts/KaTeX_Script-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size1-Regular.ttf b/scripts/style/fonts/KaTeX_Size1-Regular.ttf deleted file mode 100644 index 871fd7d..0000000 Binary files a/scripts/style/fonts/KaTeX_Size1-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size1-Regular.woff b/scripts/style/fonts/KaTeX_Size1-Regular.woff deleted file mode 100644 index 7f292d9..0000000 Binary files a/scripts/style/fonts/KaTeX_Size1-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size1-Regular.woff2 b/scripts/style/fonts/KaTeX_Size1-Regular.woff2 deleted file mode 100644 index c5a8462..0000000 Binary files a/scripts/style/fonts/KaTeX_Size1-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size2-Regular.ttf b/scripts/style/fonts/KaTeX_Size2-Regular.ttf deleted file mode 100644 index 7a212ca..0000000 Binary files a/scripts/style/fonts/KaTeX_Size2-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size2-Regular.woff b/scripts/style/fonts/KaTeX_Size2-Regular.woff deleted file mode 100644 index d241d9b..0000000 Binary files a/scripts/style/fonts/KaTeX_Size2-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size2-Regular.woff2 b/scripts/style/fonts/KaTeX_Size2-Regular.woff2 deleted file mode 100644 index e1bccfe..0000000 Binary files a/scripts/style/fonts/KaTeX_Size2-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size3-Regular.ttf b/scripts/style/fonts/KaTeX_Size3-Regular.ttf deleted file mode 100644 index 00bff34..0000000 Binary files a/scripts/style/fonts/KaTeX_Size3-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size3-Regular.woff b/scripts/style/fonts/KaTeX_Size3-Regular.woff deleted file mode 100644 index e6e9b65..0000000 Binary files a/scripts/style/fonts/KaTeX_Size3-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size3-Regular.woff2 b/scripts/style/fonts/KaTeX_Size3-Regular.woff2 deleted file mode 100644 index 249a286..0000000 Binary files a/scripts/style/fonts/KaTeX_Size3-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size4-Regular.ttf b/scripts/style/fonts/KaTeX_Size4-Regular.ttf deleted file mode 100644 index 74f0892..0000000 Binary files a/scripts/style/fonts/KaTeX_Size4-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size4-Regular.woff b/scripts/style/fonts/KaTeX_Size4-Regular.woff deleted file mode 100644 index e1ec545..0000000 Binary files a/scripts/style/fonts/KaTeX_Size4-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Size4-Regular.woff2 b/scripts/style/fonts/KaTeX_Size4-Regular.woff2 deleted file mode 100644 index 680c130..0000000 Binary files a/scripts/style/fonts/KaTeX_Size4-Regular.woff2 and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Typewriter-Regular.ttf b/scripts/style/fonts/KaTeX_Typewriter-Regular.ttf deleted file mode 100644 index c83252c..0000000 Binary files a/scripts/style/fonts/KaTeX_Typewriter-Regular.ttf and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Typewriter-Regular.woff b/scripts/style/fonts/KaTeX_Typewriter-Regular.woff deleted file mode 100644 index 2432419..0000000 Binary files a/scripts/style/fonts/KaTeX_Typewriter-Regular.woff and /dev/null differ diff --git a/scripts/style/fonts/KaTeX_Typewriter-Regular.woff2 b/scripts/style/fonts/KaTeX_Typewriter-Regular.woff2 deleted file mode 100644 index 771f1af..0000000 Binary files a/scripts/style/fonts/KaTeX_Typewriter-Regular.woff2 and /dev/null differ diff --git a/scripts/style/katex.css b/scripts/style/katex.css deleted file mode 100644 index bec73cd..0000000 --- a/scripts/style/katex.css +++ /dev/null @@ -1,1096 +0,0 @@ -/* stylelint-disable font-family-no-missing-generic-family-keyword */ -@font-face { - font-family: 'KaTeX_AMS'; - src: url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'), url(fonts/KaTeX_AMS-Regular.woff) format('woff'), - url(fonts/KaTeX_AMS-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Caligraphic'; - src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'), url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'), - url(fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Caligraphic'; - src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'), - url(fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Fraktur'; - src: url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'), url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'), - url(fonts/KaTeX_Fraktur-Bold.ttf) format('truetype'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Fraktur'; - src: url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'), url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'), - url(fonts/KaTeX_Fraktur-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Main'; - src: url(fonts/KaTeX_Main-Bold.woff2) format('woff2'), url(fonts/KaTeX_Main-Bold.woff) format('woff'), - url(fonts/KaTeX_Main-Bold.ttf) format('truetype'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Main'; - src: url(fonts/KaTeX_Main-BoldItalic.woff2) format('woff2'), url(fonts/KaTeX_Main-BoldItalic.woff) format('woff'), - url(fonts/KaTeX_Main-BoldItalic.ttf) format('truetype'); - font-weight: bold; - font-style: italic; -} -@font-face { - font-family: 'KaTeX_Main'; - src: url(fonts/KaTeX_Main-Italic.woff2) format('woff2'), url(fonts/KaTeX_Main-Italic.woff) format('woff'), - url(fonts/KaTeX_Main-Italic.ttf) format('truetype'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'KaTeX_Main'; - src: url(fonts/KaTeX_Main-Regular.woff2) format('woff2'), url(fonts/KaTeX_Main-Regular.woff) format('woff'), - url(fonts/KaTeX_Main-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Math'; - src: url(fonts/KaTeX_Math-BoldItalic.woff2) format('woff2'), url(fonts/KaTeX_Math-BoldItalic.woff) format('woff'), - url(fonts/KaTeX_Math-BoldItalic.ttf) format('truetype'); - font-weight: bold; - font-style: italic; -} -@font-face { - font-family: 'KaTeX_Math'; - src: url(fonts/KaTeX_Math-Italic.woff2) format('woff2'), url(fonts/KaTeX_Math-Italic.woff) format('woff'), - url(fonts/KaTeX_Math-Italic.ttf) format('truetype'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Bold.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Bold.woff) format('woff'), - url(fonts/KaTeX_SansSerif-Bold.ttf) format('truetype'); - font-weight: bold; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Italic.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Italic.woff) format('woff'), - url(fonts/KaTeX_SansSerif-Italic.ttf) format('truetype'); - font-weight: normal; - font-style: italic; -} -@font-face { - font-family: 'KaTeX_SansSerif'; - src: url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'), url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'), - url(fonts/KaTeX_SansSerif-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Script'; - src: url(fonts/KaTeX_Script-Regular.woff2) format('woff2'), url(fonts/KaTeX_Script-Regular.woff) format('woff'), - url(fonts/KaTeX_Script-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Size1'; - src: url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size1-Regular.woff) format('woff'), - url(fonts/KaTeX_Size1-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Size2'; - src: url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size2-Regular.woff) format('woff'), - url(fonts/KaTeX_Size2-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Size3'; - src: url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size3-Regular.woff) format('woff'), - url(fonts/KaTeX_Size3-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Size4'; - src: url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'), url(fonts/KaTeX_Size4-Regular.woff) format('woff'), - url(fonts/KaTeX_Size4-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -@font-face { - font-family: 'KaTeX_Typewriter'; - src: url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'), - url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'), url(fonts/KaTeX_Typewriter-Regular.ttf) format('truetype'); - font-weight: normal; - font-style: normal; -} -.katex { - font: normal 1.21em KaTeX_Main, Times New Roman, serif; - line-height: 1.2; - text-indent: 0; - text-rendering: auto; -} -.katex * { - -ms-high-contrast-adjust: none !important; - border-color: currentColor; -} -.katex .katex-version::after { - content: '0.16.3'; -} -.katex .katex-mathml { - /* Accessibility hack to only show to screen readers - Found at: http://a11yproject.com/posts/how-to-hide-content/ */ - position: absolute; - clip: rect(1px, 1px, 1px, 1px); - padding: 0; - border: 0; - height: 1px; - width: 1px; - overflow: hidden; -} -.katex .katex-html > .newline { - display: block; -} -.katex .base { - position: relative; - display: inline-block; - white-space: nowrap; - width: -webkit-min-content; - width: -moz-min-content; - width: min-content; -} -.katex .strut { - display: inline-block; -} -.katex .textbf { - font-weight: bold; -} -.katex .textit { - font-style: italic; -} -.katex .textrm { - font-family: KaTeX_Main; -} -.katex .textsf { - font-family: KaTeX_SansSerif; -} -.katex .texttt { - font-family: KaTeX_Typewriter; -} -.katex .mathnormal { - font-family: KaTeX_Math; - font-style: italic; -} -.katex .mathit { - font-family: KaTeX_Main; - font-style: italic; -} -.katex .mathrm { - font-style: normal; -} -.katex .mathbf { - font-family: KaTeX_Main; - font-weight: bold; -} -.katex .boldsymbol { - font-family: KaTeX_Math; - font-weight: bold; - font-style: italic; -} -.katex .amsrm { - font-family: KaTeX_AMS; -} -.katex .mathbb, -.katex .textbb { - font-family: KaTeX_AMS; -} -.katex .mathcal { - font-family: KaTeX_Caligraphic; -} -.katex .mathfrak, -.katex .textfrak { - font-family: KaTeX_Fraktur; -} -.katex .mathtt { - font-family: KaTeX_Typewriter; -} -.katex .mathscr, -.katex .textscr { - font-family: KaTeX_Script; -} -.katex .mathsf, -.katex .textsf { - font-family: KaTeX_SansSerif; -} -.katex .mathboldsf, -.katex .textboldsf { - font-family: KaTeX_SansSerif; - font-weight: bold; -} -.katex .mathitsf, -.katex .textitsf { - font-family: KaTeX_SansSerif; - font-style: italic; -} -.katex .mainrm { - font-family: KaTeX_Main; - font-style: normal; -} -.katex .vlist-t { - display: inline-table; - table-layout: fixed; - border-collapse: collapse; -} -.katex .vlist-r { - display: table-row; -} -.katex .vlist { - display: table-cell; - vertical-align: bottom; - position: relative; -} -.katex .vlist > span { - display: block; - height: 0; - position: relative; -} -.katex .vlist > span > span { - display: inline-block; -} -.katex .vlist > span > .pstrut { - overflow: hidden; - width: 0; -} -.katex .vlist-t2 { - margin-right: -2px; -} -.katex .vlist-s { - display: table-cell; - vertical-align: bottom; - font-size: 1px; - width: 2px; - min-width: 2px; -} -.katex .vbox { - display: inline-flex; - flex-direction: column; - align-items: baseline; -} -.katex .hbox { - display: inline-flex; - flex-direction: row; - width: 100%; -} -.katex .thinbox { - display: inline-flex; - flex-direction: row; - width: 0; - max-width: 0; -} -.katex .msupsub { - text-align: left; -} -.katex .mfrac > span > span { - text-align: center; -} -.katex .mfrac .frac-line { - display: inline-block; - width: 100%; - border-bottom-style: solid; -} -.katex .mfrac .frac-line, -.katex .overline .overline-line, -.katex .underline .underline-line, -.katex .hline, -.katex .hdashline, -.katex .rule { - min-height: 1px; -} -.katex .mspace { - display: inline-block; -} -.katex .llap, -.katex .rlap, -.katex .clap { - width: 0; - position: relative; -} -.katex .llap > .inner, -.katex .rlap > .inner, -.katex .clap > .inner { - position: absolute; -} -.katex .llap > .fix, -.katex .rlap > .fix, -.katex .clap > .fix { - display: inline-block; -} -.katex .llap > .inner { - right: 0; -} -.katex .rlap > .inner, -.katex .clap > .inner { - left: 0; -} -.katex .clap > .inner > span { - margin-left: -50%; - margin-right: 50%; -} -.katex .rule { - display: inline-block; - border: solid 0; - position: relative; -} -.katex .overline .overline-line, -.katex .underline .underline-line, -.katex .hline { - display: inline-block; - width: 100%; - border-bottom-style: solid; -} -.katex .hdashline { - display: inline-block; - width: 100%; - border-bottom-style: dashed; -} -.katex .sqrt > .root { - /* These values are taken from the definition of `\r@@t`, - `\mkern 5mu` and `\mkern -10mu`. */ - margin-left: 0.27777778em; - margin-right: -0.55555556em; -} -.katex .sizing.reset-size1.size1, -.katex .fontsize-ensurer.reset-size1.size1 { - font-size: 1em; -} -.katex .sizing.reset-size1.size2, -.katex .fontsize-ensurer.reset-size1.size2 { - font-size: 1.2em; -} -.katex .sizing.reset-size1.size3, -.katex .fontsize-ensurer.reset-size1.size3 { - font-size: 1.4em; -} -.katex .sizing.reset-size1.size4, -.katex .fontsize-ensurer.reset-size1.size4 { - font-size: 1.6em; -} -.katex .sizing.reset-size1.size5, -.katex .fontsize-ensurer.reset-size1.size5 { - font-size: 1.8em; -} -.katex .sizing.reset-size1.size6, -.katex .fontsize-ensurer.reset-size1.size6 { - font-size: 2em; -} -.katex .sizing.reset-size1.size7, -.katex .fontsize-ensurer.reset-size1.size7 { - font-size: 2.4em; -} -.katex .sizing.reset-size1.size8, -.katex .fontsize-ensurer.reset-size1.size8 { - font-size: 2.88em; -} -.katex .sizing.reset-size1.size9, -.katex .fontsize-ensurer.reset-size1.size9 { - font-size: 3.456em; -} -.katex .sizing.reset-size1.size10, -.katex .fontsize-ensurer.reset-size1.size10 { - font-size: 4.148em; -} -.katex .sizing.reset-size1.size11, -.katex .fontsize-ensurer.reset-size1.size11 { - font-size: 4.976em; -} -.katex .sizing.reset-size2.size1, -.katex .fontsize-ensurer.reset-size2.size1 { - font-size: 0.83333333em; -} -.katex .sizing.reset-size2.size2, -.katex .fontsize-ensurer.reset-size2.size2 { - font-size: 1em; -} -.katex .sizing.reset-size2.size3, -.katex .fontsize-ensurer.reset-size2.size3 { - font-size: 1.16666667em; -} -.katex .sizing.reset-size2.size4, -.katex .fontsize-ensurer.reset-size2.size4 { - font-size: 1.33333333em; -} -.katex .sizing.reset-size2.size5, -.katex .fontsize-ensurer.reset-size2.size5 { - font-size: 1.5em; -} -.katex .sizing.reset-size2.size6, -.katex .fontsize-ensurer.reset-size2.size6 { - font-size: 1.66666667em; -} -.katex .sizing.reset-size2.size7, -.katex .fontsize-ensurer.reset-size2.size7 { - font-size: 2em; -} -.katex .sizing.reset-size2.size8, -.katex .fontsize-ensurer.reset-size2.size8 { - font-size: 2.4em; -} -.katex .sizing.reset-size2.size9, -.katex .fontsize-ensurer.reset-size2.size9 { - font-size: 2.88em; -} -.katex .sizing.reset-size2.size10, -.katex .fontsize-ensurer.reset-size2.size10 { - font-size: 3.45666667em; -} -.katex .sizing.reset-size2.size11, -.katex .fontsize-ensurer.reset-size2.size11 { - font-size: 4.14666667em; -} -.katex .sizing.reset-size3.size1, -.katex .fontsize-ensurer.reset-size3.size1 { - font-size: 0.71428571em; -} -.katex .sizing.reset-size3.size2, -.katex .fontsize-ensurer.reset-size3.size2 { - font-size: 0.85714286em; -} -.katex .sizing.reset-size3.size3, -.katex .fontsize-ensurer.reset-size3.size3 { - font-size: 1em; -} -.katex .sizing.reset-size3.size4, -.katex .fontsize-ensurer.reset-size3.size4 { - font-size: 1.14285714em; -} -.katex .sizing.reset-size3.size5, -.katex .fontsize-ensurer.reset-size3.size5 { - font-size: 1.28571429em; -} -.katex .sizing.reset-size3.size6, -.katex .fontsize-ensurer.reset-size3.size6 { - font-size: 1.42857143em; -} -.katex .sizing.reset-size3.size7, -.katex .fontsize-ensurer.reset-size3.size7 { - font-size: 1.71428571em; -} -.katex .sizing.reset-size3.size8, -.katex .fontsize-ensurer.reset-size3.size8 { - font-size: 2.05714286em; -} -.katex .sizing.reset-size3.size9, -.katex .fontsize-ensurer.reset-size3.size9 { - font-size: 2.46857143em; -} -.katex .sizing.reset-size3.size10, -.katex .fontsize-ensurer.reset-size3.size10 { - font-size: 2.96285714em; -} -.katex .sizing.reset-size3.size11, -.katex .fontsize-ensurer.reset-size3.size11 { - font-size: 3.55428571em; -} -.katex .sizing.reset-size4.size1, -.katex .fontsize-ensurer.reset-size4.size1 { - font-size: 0.625em; -} -.katex .sizing.reset-size4.size2, -.katex .fontsize-ensurer.reset-size4.size2 { - font-size: 0.75em; -} -.katex .sizing.reset-size4.size3, -.katex .fontsize-ensurer.reset-size4.size3 { - font-size: 0.875em; -} -.katex .sizing.reset-size4.size4, -.katex .fontsize-ensurer.reset-size4.size4 { - font-size: 1em; -} -.katex .sizing.reset-size4.size5, -.katex .fontsize-ensurer.reset-size4.size5 { - font-size: 1.125em; -} -.katex .sizing.reset-size4.size6, -.katex .fontsize-ensurer.reset-size4.size6 { - font-size: 1.25em; -} -.katex .sizing.reset-size4.size7, -.katex .fontsize-ensurer.reset-size4.size7 { - font-size: 1.5em; -} -.katex .sizing.reset-size4.size8, -.katex .fontsize-ensurer.reset-size4.size8 { - font-size: 1.8em; -} -.katex .sizing.reset-size4.size9, -.katex .fontsize-ensurer.reset-size4.size9 { - font-size: 2.16em; -} -.katex .sizing.reset-size4.size10, -.katex .fontsize-ensurer.reset-size4.size10 { - font-size: 2.5925em; -} -.katex .sizing.reset-size4.size11, -.katex .fontsize-ensurer.reset-size4.size11 { - font-size: 3.11em; -} -.katex .sizing.reset-size5.size1, -.katex .fontsize-ensurer.reset-size5.size1 { - font-size: 0.55555556em; -} -.katex .sizing.reset-size5.size2, -.katex .fontsize-ensurer.reset-size5.size2 { - font-size: 0.66666667em; -} -.katex .sizing.reset-size5.size3, -.katex .fontsize-ensurer.reset-size5.size3 { - font-size: 0.77777778em; -} -.katex .sizing.reset-size5.size4, -.katex .fontsize-ensurer.reset-size5.size4 { - font-size: 0.88888889em; -} -.katex .sizing.reset-size5.size5, -.katex .fontsize-ensurer.reset-size5.size5 { - font-size: 1em; -} -.katex .sizing.reset-size5.size6, -.katex .fontsize-ensurer.reset-size5.size6 { - font-size: 1.11111111em; -} -.katex .sizing.reset-size5.size7, -.katex .fontsize-ensurer.reset-size5.size7 { - font-size: 1.33333333em; -} -.katex .sizing.reset-size5.size8, -.katex .fontsize-ensurer.reset-size5.size8 { - font-size: 1.6em; -} -.katex .sizing.reset-size5.size9, -.katex .fontsize-ensurer.reset-size5.size9 { - font-size: 1.92em; -} -.katex .sizing.reset-size5.size10, -.katex .fontsize-ensurer.reset-size5.size10 { - font-size: 2.30444444em; -} -.katex .sizing.reset-size5.size11, -.katex .fontsize-ensurer.reset-size5.size11 { - font-size: 2.76444444em; -} -.katex .sizing.reset-size6.size1, -.katex .fontsize-ensurer.reset-size6.size1 { - font-size: 0.5em; -} -.katex .sizing.reset-size6.size2, -.katex .fontsize-ensurer.reset-size6.size2 { - font-size: 0.6em; -} -.katex .sizing.reset-size6.size3, -.katex .fontsize-ensurer.reset-size6.size3 { - font-size: 0.7em; -} -.katex .sizing.reset-size6.size4, -.katex .fontsize-ensurer.reset-size6.size4 { - font-size: 0.8em; -} -.katex .sizing.reset-size6.size5, -.katex .fontsize-ensurer.reset-size6.size5 { - font-size: 0.9em; -} -.katex .sizing.reset-size6.size6, -.katex .fontsize-ensurer.reset-size6.size6 { - font-size: 1em; -} -.katex .sizing.reset-size6.size7, -.katex .fontsize-ensurer.reset-size6.size7 { - font-size: 1.2em; -} -.katex .sizing.reset-size6.size8, -.katex .fontsize-ensurer.reset-size6.size8 { - font-size: 1.44em; -} -.katex .sizing.reset-size6.size9, -.katex .fontsize-ensurer.reset-size6.size9 { - font-size: 1.728em; -} -.katex .sizing.reset-size6.size10, -.katex .fontsize-ensurer.reset-size6.size10 { - font-size: 2.074em; -} -.katex .sizing.reset-size6.size11, -.katex .fontsize-ensurer.reset-size6.size11 { - font-size: 2.488em; -} -.katex .sizing.reset-size7.size1, -.katex .fontsize-ensurer.reset-size7.size1 { - font-size: 0.41666667em; -} -.katex .sizing.reset-size7.size2, -.katex .fontsize-ensurer.reset-size7.size2 { - font-size: 0.5em; -} -.katex .sizing.reset-size7.size3, -.katex .fontsize-ensurer.reset-size7.size3 { - font-size: 0.58333333em; -} -.katex .sizing.reset-size7.size4, -.katex .fontsize-ensurer.reset-size7.size4 { - font-size: 0.66666667em; -} -.katex .sizing.reset-size7.size5, -.katex .fontsize-ensurer.reset-size7.size5 { - font-size: 0.75em; -} -.katex .sizing.reset-size7.size6, -.katex .fontsize-ensurer.reset-size7.size6 { - font-size: 0.83333333em; -} -.katex .sizing.reset-size7.size7, -.katex .fontsize-ensurer.reset-size7.size7 { - font-size: 1em; -} -.katex .sizing.reset-size7.size8, -.katex .fontsize-ensurer.reset-size7.size8 { - font-size: 1.2em; -} -.katex .sizing.reset-size7.size9, -.katex .fontsize-ensurer.reset-size7.size9 { - font-size: 1.44em; -} -.katex .sizing.reset-size7.size10, -.katex .fontsize-ensurer.reset-size7.size10 { - font-size: 1.72833333em; -} -.katex .sizing.reset-size7.size11, -.katex .fontsize-ensurer.reset-size7.size11 { - font-size: 2.07333333em; -} -.katex .sizing.reset-size8.size1, -.katex .fontsize-ensurer.reset-size8.size1 { - font-size: 0.34722222em; -} -.katex .sizing.reset-size8.size2, -.katex .fontsize-ensurer.reset-size8.size2 { - font-size: 0.41666667em; -} -.katex .sizing.reset-size8.size3, -.katex .fontsize-ensurer.reset-size8.size3 { - font-size: 0.48611111em; -} -.katex .sizing.reset-size8.size4, -.katex .fontsize-ensurer.reset-size8.size4 { - font-size: 0.55555556em; -} -.katex .sizing.reset-size8.size5, -.katex .fontsize-ensurer.reset-size8.size5 { - font-size: 0.625em; -} -.katex .sizing.reset-size8.size6, -.katex .fontsize-ensurer.reset-size8.size6 { - font-size: 0.69444444em; -} -.katex .sizing.reset-size8.size7, -.katex .fontsize-ensurer.reset-size8.size7 { - font-size: 0.83333333em; -} -.katex .sizing.reset-size8.size8, -.katex .fontsize-ensurer.reset-size8.size8 { - font-size: 1em; -} -.katex .sizing.reset-size8.size9, -.katex .fontsize-ensurer.reset-size8.size9 { - font-size: 1.2em; -} -.katex .sizing.reset-size8.size10, -.katex .fontsize-ensurer.reset-size8.size10 { - font-size: 1.44027778em; -} -.katex .sizing.reset-size8.size11, -.katex .fontsize-ensurer.reset-size8.size11 { - font-size: 1.72777778em; -} -.katex .sizing.reset-size9.size1, -.katex .fontsize-ensurer.reset-size9.size1 { - font-size: 0.28935185em; -} -.katex .sizing.reset-size9.size2, -.katex .fontsize-ensurer.reset-size9.size2 { - font-size: 0.34722222em; -} -.katex .sizing.reset-size9.size3, -.katex .fontsize-ensurer.reset-size9.size3 { - font-size: 0.40509259em; -} -.katex .sizing.reset-size9.size4, -.katex .fontsize-ensurer.reset-size9.size4 { - font-size: 0.46296296em; -} -.katex .sizing.reset-size9.size5, -.katex .fontsize-ensurer.reset-size9.size5 { - font-size: 0.52083333em; -} -.katex .sizing.reset-size9.size6, -.katex .fontsize-ensurer.reset-size9.size6 { - font-size: 0.5787037em; -} -.katex .sizing.reset-size9.size7, -.katex .fontsize-ensurer.reset-size9.size7 { - font-size: 0.69444444em; -} -.katex .sizing.reset-size9.size8, -.katex .fontsize-ensurer.reset-size9.size8 { - font-size: 0.83333333em; -} -.katex .sizing.reset-size9.size9, -.katex .fontsize-ensurer.reset-size9.size9 { - font-size: 1em; -} -.katex .sizing.reset-size9.size10, -.katex .fontsize-ensurer.reset-size9.size10 { - font-size: 1.20023148em; -} -.katex .sizing.reset-size9.size11, -.katex .fontsize-ensurer.reset-size9.size11 { - font-size: 1.43981481em; -} -.katex .sizing.reset-size10.size1, -.katex .fontsize-ensurer.reset-size10.size1 { - font-size: 0.24108004em; -} -.katex .sizing.reset-size10.size2, -.katex .fontsize-ensurer.reset-size10.size2 { - font-size: 0.28929605em; -} -.katex .sizing.reset-size10.size3, -.katex .fontsize-ensurer.reset-size10.size3 { - font-size: 0.33751205em; -} -.katex .sizing.reset-size10.size4, -.katex .fontsize-ensurer.reset-size10.size4 { - font-size: 0.38572806em; -} -.katex .sizing.reset-size10.size5, -.katex .fontsize-ensurer.reset-size10.size5 { - font-size: 0.43394407em; -} -.katex .sizing.reset-size10.size6, -.katex .fontsize-ensurer.reset-size10.size6 { - font-size: 0.48216008em; -} -.katex .sizing.reset-size10.size7, -.katex .fontsize-ensurer.reset-size10.size7 { - font-size: 0.57859209em; -} -.katex .sizing.reset-size10.size8, -.katex .fontsize-ensurer.reset-size10.size8 { - font-size: 0.69431051em; -} -.katex .sizing.reset-size10.size9, -.katex .fontsize-ensurer.reset-size10.size9 { - font-size: 0.83317261em; -} -.katex .sizing.reset-size10.size10, -.katex .fontsize-ensurer.reset-size10.size10 { - font-size: 1em; -} -.katex .sizing.reset-size10.size11, -.katex .fontsize-ensurer.reset-size10.size11 { - font-size: 1.19961427em; -} -.katex .sizing.reset-size11.size1, -.katex .fontsize-ensurer.reset-size11.size1 { - font-size: 0.20096463em; -} -.katex .sizing.reset-size11.size2, -.katex .fontsize-ensurer.reset-size11.size2 { - font-size: 0.24115756em; -} -.katex .sizing.reset-size11.size3, -.katex .fontsize-ensurer.reset-size11.size3 { - font-size: 0.28135048em; -} -.katex .sizing.reset-size11.size4, -.katex .fontsize-ensurer.reset-size11.size4 { - font-size: 0.32154341em; -} -.katex .sizing.reset-size11.size5, -.katex .fontsize-ensurer.reset-size11.size5 { - font-size: 0.36173633em; -} -.katex .sizing.reset-size11.size6, -.katex .fontsize-ensurer.reset-size11.size6 { - font-size: 0.40192926em; -} -.katex .sizing.reset-size11.size7, -.katex .fontsize-ensurer.reset-size11.size7 { - font-size: 0.48231511em; -} -.katex .sizing.reset-size11.size8, -.katex .fontsize-ensurer.reset-size11.size8 { - font-size: 0.57877814em; -} -.katex .sizing.reset-size11.size9, -.katex .fontsize-ensurer.reset-size11.size9 { - font-size: 0.69453376em; -} -.katex .sizing.reset-size11.size10, -.katex .fontsize-ensurer.reset-size11.size10 { - font-size: 0.83360129em; -} -.katex .sizing.reset-size11.size11, -.katex .fontsize-ensurer.reset-size11.size11 { - font-size: 1em; -} -.katex .delimsizing.size1 { - font-family: KaTeX_Size1; -} -.katex .delimsizing.size2 { - font-family: KaTeX_Size2; -} -.katex .delimsizing.size3 { - font-family: KaTeX_Size3; -} -.katex .delimsizing.size4 { - font-family: KaTeX_Size4; -} -.katex .delimsizing.mult .delim-size1 > span { - font-family: KaTeX_Size1; -} -.katex .delimsizing.mult .delim-size4 > span { - font-family: KaTeX_Size4; -} -.katex .nulldelimiter { - display: inline-block; - width: 0.12em; -} -.katex .delimcenter { - position: relative; -} -.katex .op-symbol { - position: relative; -} -.katex .op-symbol.small-op { - font-family: KaTeX_Size1; -} -.katex .op-symbol.large-op { - font-family: KaTeX_Size2; -} -.katex .op-limits > .vlist-t { - text-align: center; -} -.katex .accent > .vlist-t { - text-align: center; -} -.katex .accent .accent-body { - position: relative; -} -.katex .accent .accent-body:not(.accent-full) { - width: 0; -} -.katex .overlay { - display: block; -} -.katex .mtable .vertical-separator { - display: inline-block; - min-width: 1px; -} -.katex .mtable .arraycolsep { - display: inline-block; -} -.katex .mtable .col-align-c > .vlist-t { - text-align: center; -} -.katex .mtable .col-align-l > .vlist-t { - text-align: left; -} -.katex .mtable .col-align-r > .vlist-t { - text-align: right; -} -.katex .svg-align { - text-align: left; -} -.katex svg { - display: block; - position: absolute; - width: 100%; - height: inherit; - fill: currentColor; - stroke: currentColor; - fill-rule: nonzero; - fill-opacity: 1; - stroke-width: 1; - stroke-linecap: butt; - stroke-linejoin: miter; - stroke-miterlimit: 4; - stroke-dasharray: none; - stroke-dashoffset: 0; - stroke-opacity: 1; -} -.katex svg path { - stroke: none; -} -.katex img { - border-style: none; - min-width: 0; - min-height: 0; - max-width: none; - max-height: none; -} -.katex .stretchy { - width: 100%; - display: block; - position: relative; - overflow: hidden; -} -.katex .stretchy::before, -.katex .stretchy::after { - content: ''; -} -.katex .hide-tail { - width: 100%; - position: relative; - overflow: hidden; -} -.katex .halfarrow-left { - position: absolute; - left: 0; - width: 50.2%; - overflow: hidden; -} -.katex .halfarrow-right { - position: absolute; - right: 0; - width: 50.2%; - overflow: hidden; -} -.katex .brace-left { - position: absolute; - left: 0; - width: 25.1%; - overflow: hidden; -} -.katex .brace-center { - position: absolute; - left: 25%; - width: 50%; - overflow: hidden; -} -.katex .brace-right { - position: absolute; - right: 0; - width: 25.1%; - overflow: hidden; -} -.katex .x-arrow-pad { - padding: 0 0.5em; -} -.katex .cd-arrow-pad { - padding: 0 0.55556em 0 0.27778em; -} -.katex .x-arrow, -.katex .mover, -.katex .munder { - text-align: center; -} -.katex .boxpad { - padding: 0 0.3em; -} -.katex .fbox, -.katex .fcolorbox { - box-sizing: border-box; - border: 0.04em solid; -} -.katex .cancel-pad { - padding: 0 0.2em; -} -.katex .cancel-lap { - margin-left: -0.2em; - margin-right: -0.2em; -} -.katex .sout { - border-bottom-style: solid; - border-bottom-width: 0.08em; -} -.katex .angl { - box-sizing: border-box; - border-top: 0.049em solid; - border-right: 0.049em solid; - margin-right: 0.03889em; -} -.katex .anglpad { - padding: 0 0.03889em; -} -.katex .eqn-num::before { - counter-increment: katexEqnNo; - content: '(' counter(katexEqnNo) ')'; -} -.katex .mml-eqn-num::before { - counter-increment: mmlEqnNo; - content: '(' counter(mmlEqnNo) ')'; -} -.katex .mtr-glue { - width: 50%; -} -.katex .cd-vert-arrow { - display: inline-block; - position: relative; -} -.katex .cd-label-left { - display: inline-block; - position: absolute; - right: calc(50% + 0.3em); - text-align: left; -} -.katex .cd-label-right { - display: inline-block; - position: absolute; - left: calc(50% + 0.3em); - text-align: right; -} -.katex-display { - display: block; - margin: 1em 0; - text-align: center; -} -.katex-display > .katex { - display: block; - text-align: center; - white-space: nowrap; -} -.katex-display > .katex > .katex-html { - display: block; - position: relative; -} -.katex-display > .katex > .katex-html > .tag { - position: absolute; - right: 0; -} -.katex-display.leqno > .katex > .katex-html > .tag { - left: 0; - right: auto; -} -.katex-display.fleqn > .katex { - text-align: left; - padding-left: 2em; -} -body { - counter-reset: katexEqnNo mmlEqnNo; -} diff --git a/scripts/style/style.css b/scripts/style/style.css deleted file mode 100644 index fbd254d..0000000 --- a/scripts/style/style.css +++ /dev/null @@ -1,1471 +0,0 @@ -html { - scroll-behavior: smooth; -} -body { - -webkit-text-size-adjust: 100%; - tab-size: 4; - margin: 0; - line-height: inherit; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', - 'Segoe UI Emoji'; -} - -::-webkit-scrollbar { - background: transparent; - width: 8px; - height: 8px; -} - -::-webkit-scrollbar-thumb { - background: var(--color-fg-muted); - border-radius: 10px; -} - -[data-color-mode*='dark'] body .dark { - display: none; -} -[data-color-mode*='dark'] body .light { - display: block; -} -[data-color-mode*='light'] body .dark { - display: block; -} -[data-color-mode*='light'] body .light { - display: none; -} - -[data-color-mode*='light'], -[data-color-mode*='light'] body { - --color-prettylights-syntax-comment: #b1bac3; - --color-prettylights-syntax-constant: #0550ae; - --color-prettylights-syntax-entity: #8250df; - --color-prettylights-syntax-storage-modifier-import: #24292f; - --color-prettylights-syntax-entity-tag: #116329; - --color-prettylights-syntax-keyword: #cf222e; - --color-prettylights-syntax-string: #0a3069; - --color-prettylights-syntax-variable: #d15104; - --color-prettylights-syntax-brackethighlighter-unmatched: #82071e; - --color-prettylights-syntax-invalid-illegal-text: #f6f8fa; - --color-prettylights-syntax-invalid-illegal-bg: #82071e; - --color-prettylights-syntax-carriage-return-text: #f6f8fa; - --color-prettylights-syntax-carriage-return-bg: #cf222e; - --color-prettylights-syntax-string-regexp: #116329; - --color-prettylights-syntax-markup-list: #3b2300; - --color-prettylights-syntax-markup-heading: #0550ae; - --color-prettylights-syntax-markup-italic: #24292f; - --color-prettylights-syntax-markup-bold: #24292f; - --color-prettylights-syntax-markup-deleted-text: #82071e; - --color-prettylights-syntax-markup-deleted-bg: #ffebe9; - --color-prettylights-syntax-markup-inserted-text: #116329; - --color-prettylights-syntax-markup-inserted-bg: #dafbe1; - --color-prettylights-syntax-markup-changed-text: #953800; - --color-prettylights-syntax-markup-changed-bg: #ffd8b5; - --color-prettylights-syntax-markup-ignored-text: #eaeef2; - --color-prettylights-syntax-markup-ignored-bg: #0550ae; - --color-prettylights-syntax-meta-diff-range: #8250df; - --color-prettylights-syntax-brackethighlighter-angle: #57606a; - --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f; - --color-prettylights-syntax-constant-other-reference-link: #0a3069; - --color-fg-default: #24292f; - --color-fg-muted: #57606a; - --color-fg-subtle: #6e7781; - --color-canvas-default: #f1f5f9; - --color-canvas-subtle: #fff; - --color-bg-subtle: #f8f9fa; - --color-border-default: #d0d7de; - --color-border-muted: #ececec94; - --color-neutral-muted: rgba(175, 184, 193, 0.2); - --color-accent-fg: #0969da; - --color-accent-emphasis: #0969da; - --color-attention-subtle: #fff8c5; - --color-danger-fg: #cf222e; - --box-shadow: 109 109 109; - --primary-color: #228e6c; -} - -[data-color-mode*='dark'], -[data-color-mode*='dark'] body { - --color-prettylights-syntax-comment: #8b949e; - --color-prettylights-syntax-constant: #79c0ff; - --color-prettylights-syntax-entity: #d2a8ff; - --color-prettylights-syntax-storage-modifier-import: #c9d1d9; - --color-prettylights-syntax-entity-tag: #7ee787; - --color-prettylights-syntax-keyword: #ff7b72; - --color-prettylights-syntax-string: #a5d6ff; - --color-prettylights-syntax-variable: #ffa657; - --color-prettylights-syntax-brackethighlighter-unmatched: #f85149; - --color-prettylights-syntax-invalid-illegal-text: #f0f6fc; - --color-prettylights-syntax-invalid-illegal-bg: #8e1519; - --color-prettylights-syntax-carriage-return-text: #f0f6fc; - --color-prettylights-syntax-carriage-return-bg: #b62324; - --color-prettylights-syntax-string-regexp: #7ee787; - --color-prettylights-syntax-markup-list: #f2cc60; - --color-prettylights-syntax-markup-heading: #1f6feb; - --color-prettylights-syntax-markup-italic: #c9d1d9; - --color-prettylights-syntax-markup-bold: #c9d1d9; - --color-prettylights-syntax-markup-deleted-text: #ffdcd7; - --color-prettylights-syntax-markup-deleted-bg: #67060c; - --color-prettylights-syntax-markup-inserted-text: #aff5b4; - --color-prettylights-syntax-markup-inserted-bg: #033a16; - --color-prettylights-syntax-markup-changed-text: #ffdfb6; - --color-prettylights-syntax-markup-changed-bg: #5a1e02; - --color-prettylights-syntax-markup-ignored-text: #c9d1d9; - --color-prettylights-syntax-markup-ignored-bg: #1158c7; - --color-prettylights-syntax-meta-diff-range: #d2a8ff; - --color-prettylights-syntax-brackethighlighter-angle: #8b949e; - --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58; - --color-prettylights-syntax-constant-other-reference-link: #a5d6ff; - --color-fg-default: #c9d1d9; - --color-fg-muted: #8b949e; - --color-fg-subtle: #94a3b8; - --color-canvas-default: #0f172a; - --color-canvas-subtle: #1e293b; - --color-bg-subtle: rgb(15 23 42/0.3); - --color-border-default: #404f5f; - --color-border-muted: rgb(51 65 85/0.5); - --color-neutral-muted: rgb(51 65 85/0.3); - --color-accent-fg: #58a6ff; - --color-accent-emphasis: #1f6feb; - --color-attention-subtle: rgba(187, 128, 9, 0.15); - --color-danger-fg: #f85149; - --box-shadow: 0 0 0; - --primary-color: #228e6c; -} - -body { - color: var(--color-fg-default); - background-color: var(--color-canvas-default); -} - -*, -::before, -::after { - box-sizing: border-box; -} - -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} - -yel, -yel code { - color: var(--color-prettylights-syntax-variable) !important; -} -red, -red code { - color: var(--color-danger-fg) !important; -} -pur, -pur code { - color: var(--color-prettylights-syntax-entity) !important; -} - -:is(.h3wrap-body, .wrap-body) p > code, -:is(.h3wrap-body, .wrap-body) ul li > code, -:is(.h3wrap-body, .wrap-body) tbody td code { - --text-opacity: 1; - color: rgb(5 150 105 / var(--text-opacity)); -} - -:is(.h3wrap-body, .wrap-body) em, -:is(.h3wrap-body, .wrap-body) sup, -:is(.h3wrap-body, .wrap-body) sub { - color: var(--color-fg-subtle); -} - -table { - width: 100%; - text-indent: 0; - border-color: inherit; - border-collapse: collapse; -} - -table.shortcuts td:not(:last-child) > code, -table.shortcuts td:not(:last-child) > del > code, -ul.shortcuts li > code, -kbd { - background-color: var(--color-neutral-muted); - color: var(--color-fg-subtle); - box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000; - letter-spacing: 0.075rem; - padding: 0.1em 0.54em; - border: 1px solid var(--color-border-muted); - border-color: var(--color-border-default); - line-height: 1.5; - font-family: Arial, Helvetica, sans-serif; - font-size: 12px; - display: inline-block; - border-radius: 3px; -} - -table tr + tr { - border-top: solid 1px #ececec94; - border-color: var(--color-border-muted); -} -table td, -table th { - padding: 9px 14px; - text-align: left; -} -table tr th:last-child, -table tr td:last-child { - text-align: right; -} - -table thead th { - white-space: nowrap; - font-weight: normal; - color: rgb(16 185 129/1); -} - -table thead { - display: none; - border-bottom: solid 1px rgba(85, 102, 119, 0.3); -} -table td:first-child > code { - --text-opacity: 1; - color: rgb(5 150 105 / var(--text-opacity)); - white-space: pre-wrap; -} -table td > del, -table td:first-child > del > code, -.h3wrap-body p > del > code { - color: var(--color-danger-fg); -} - -table.show-header thead { - display: table-header-group; -} - -table.style-list td + td, -table.style-list-arrow td + td { - padding-top: 0 !important; -} - -table.style-list td, -table.style-list-arrow td { - display: block; - text-align: left !important; -} - -table.style-list-arrow td:first-child::before, -ul.style-arrow li:before { - content: ''; - display: inline-block; - width: 0px; - height: 0px; - border-right: 6px solid transparent; - border-top: 5px solid transparent; - border-left: 6px solid #228e6c; - border-bottom: 5px solid transparent; -} - -tt, -code { - font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; - font-size: 1em; -} -pre:only-child { - height: 100%; -} - -pre { - margin-top: 0; - margin-bottom: 0; - font-family: ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace; - word-wrap: normal; - line-height: 1.5; - overflow: hidden; - padding: 1rem; -} - -.max-container a { - color: rgb(2 132 199/1); -} -.max-container a, -.max-container a:visited { - background-image: linear-gradient(transparent, transparent 6px, #34495e 6px, #34495e); - background-position: bottom; - background-size: 100% 6px; - background-repeat: repeat-x; - text-decoration-line: underline; - text-decoration-thickness: 2px; - text-underline-offset: 4px; - text-decoration-color: transparent; -} - -.max-container a:hover, -.max-container a:visited:hover { - text-decoration-color: #10b981; -} - -.max-container { - max-width: 1320px; - margin-left: auto; - margin-right: auto; - padding: 0.75rem; -} - -body.home .h1wrap-body, -body.home .h1wrap .wrap-body { - max-width: 940px; - margin-left: auto; - margin-right: auto; - padding: 0.75rem; -} -body.home .h2wrap > h2 { - display: inline-block; - padding-right: 0.5rem; -} - -body.home .h2wrap > h2::after { - content: ' '; - display: block; - height: 3px; - width: 110%; - margin-top: 0.5rem; - --bg-opacity: 1; - background-color: rgb(30 41 59 / var(--bg-opacity)); -} -body.home .h1wrap .wrap-body p + p { - margin-top: 1.6rem; -} -body.home .h1wrap .wrap-body p { - text-indent: 2rem; -} - -body:not(.home) .h2wrap > .wrap-body > ul { - list-style: initial; - margin-left: 1.2rem; -} - -body.home .h1wrap p { - text-align: left; -} -body.home .max-container a.home-button:hover, -body.home .max-container a.home-button:visited:hover { - transition: all 0.3s; - text-decoration-color: #fff; - color: #fff; -} - -.home-card { - display: grid; - gap: 2rem; - grid-template-columns: repeat(2, minmax(0, 1fr)); -} -.home-card br { - display: none; -} -.home-card :is(a.contributing, a.tag) { - position: relative; -} -.home-card a.contributing::after { - color: var(--color-fg-muted); - content: attr(data-info); - display: block; - position: absolute; - font-size: 10px; - left: 5px; - bottom: -15px; -} -.home-card a.contributing:hover:after { - color: var(--color-fg-muted); - animation: contributing-move 0.1s infinite; -} -@keyframes contributing-move { - 0% { - transform: translate(0px, 0px); - } - 50% { - transform: translate(0px, -3px); - } - 100% { - transform: translate(0px, 0px); - } -} - -.home-card a.tag::before { - content: attr(data-lang); - display: block; - position: absolute; - font-size: 10px; - right: 6px; - top: 6px; - background: rgba(255 255 255 / 0.3); - border-radius: 3px; - padding: 1px 3px 2px 3px; - transition: all 0.3s; -} -.home-card a.tag:hover:before { - background: rgba(255 255 255 / 0.2); -} - -[data-color-mode*='light'] body .home-card a { - --text-opacity: 0.75; - color: rgb(15 19 24 / var(--text-opacity)); -} -[data-color-mode*='light'] body .home-card a:hover { - --text-opacity: 0.85; - color: rgb(241 245 249 / var(--text-opacity)) !important; -} -.home-card a { - display: flex; - align-items: center; - gap: 0.5rem; - cursor: pointer; - border-radius: 0.5rem; - padding: 0rem 1rem; - height: 4rem; - box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(0, 0, 0, 0.05); - color: var(--color-fg-default); - --text-opacity: 0.75; - color: rgb(241 245 249 / var(--text-opacity)); - --bg-opacity: 0.5; - background-color: rgb(62 69 72 / var(--bg-opacity)); - transition: all 0.3s; - text-decoration: none; -} -.home-card a:hover { - --bg-opacity: 1; - --text-opacity: 0.75; -} -.home-card a svg { - min-width: 1.6rem; - height: 1.8rem; -} - -.home-title-reset { - padding-right: 0 !important; -} -.home-title-reset::after { - width: initial !important; -} - -a.home-button { - padding-left: 1.5rem; - padding-right: 1.5rem; - padding-top: 0.5rem; - padding-bottom: 0.5rem; - border-radius: 9999px; - line-height: 1.75rem; - margin-left: 1rem; - margin-right: 1rem; - --bg-opacity: 1; - background-color: rgb(10 147 102 / var(--bg-opacity)); - --text-opacity: 1; - color: rgb(203 213 225 / var(--text-opacity)); -} -a.home-button:hover { - --bg-opacity: 0.5; -} -a.text-grey { - --bg-opacity: 1; - background-color: rgb(56 76 109 / var(--bg-opacity)); -} - -.header-nav .max-container { - padding: 1.8rem 1.8rem 0; -} - -.header-nav .max-container, -.header-nav .logo, -.header-nav .menu, -.header-nav .menu a { - display: flex; - justify-content: space-between; - align-items: center; -} - -.header-nav .logo { - gap: 0.5rem; - color: currentColor; -} - -.header-nav .title { - font-size: 1.8rem; - line-height: 2rem; - font-weight: bold; -} - -.header-nav .logo svg { - font-size: 40px; -} - -.header-nav .menu a:hover, -.header-nav .menu button:hover { - background-color: var(--color-neutral-muted); -} - -.header-nav .menu a, -.header-nav .menu button { - padding-left: 0.55rem; - padding-right: 0.55rem; - padding-top: 0.4rem; - padding-bottom: 0.4rem; - border-radius: 9999px; - transition: all 0.3s; - border: 0; -} - -.header-nav .menu { - gap: 0.2rem; -} -.header-nav .menu a > span { - font-size: 0.9rem; -} -.header-nav .menu .searchbtn { - text-decoration-color: transparent; - gap: 0.75rem; -} -.header-nav .menu .searchbtn span:last-child { - transition: all 0.3s; - border: 1px solid var(--color-border-default); - border-radius: 0.4rem; - padding: 1px 1px 1px 3px; - letter-spacing: 3px; -} -.header-nav .menu .searchbtn:hover span:last-child { - border-color: var(--primary-color); - color: var(--primary-color); -} -.header-nav .menu button { - font-family: inherit; - font-size: 100%; - font-weight: inherit; - line-height: inherit; - background-color: transparent; - background-image: none; - color: var(--color-fg-default); - cursor: pointer; - font-size: 18px; -} - -.header-nav a, -.header-nav a:visited { - color: var(--color-fg-default); - line-height: 1.2; - gap: 0.3rem; -} - -.wrap-header.h1wrap { - text-align: center; - margin-top: 4.6rem; - margin-bottom: 5rem; -} - -.wrap-header.h1wrap .wrap-body { - color: var(--color-fg-subtle); - max-width: 850px; - margin: 0 auto; -} - -.wrap-header.h1wrap > h1 { - font-size: 3rem; - line-height: 1; - margin-bottom: 3rem; - display: inline-flex; -} - -.wrap-header.h1wrap > h1 > svg { - margin-right: 1rem; -} - -.h1wrap-body { - display: flex; - flex-direction: column; - gap: 3rem; - position: relative; -} -.menu-tocs { - position: sticky; - top: 0; - z-index: 88; - display: inline-flex; -} -.menu-tocs:hover > .menu-modal { - display: block; - border-radius: 0.5rem; - padding: 0.3rem; - max-height: 100vh; - overflow: auto; - background-color: var(--color-canvas-subtle); - box-shadow: 0 8px 24px rgba(var(--box-shadow) / 0.2); -} -.menu-tocs > .menu-btn { - border: 1px solid var(--color-border-default); - display: flex; - border-radius: 0.3rem; - padding: 0.3rem 0.4rem; - font-size: 1.3rem; - margin-left: -3rem; - margin-top: 0.3rem; - position: absolute; -} -.menu-tocs > .menu-modal { - width: 260px; - position: absolute; - display: none; - margin-left: -1rem; -} -.menu-tocs > .menu-modal a + a { - margin-bottom: 0.2rem; -} -.menu-tocs > .menu-modal a:hover { - background-color: var(--color-neutral-muted); -} -.menu-tocs > .menu-modal a.is-active-link { - background-color: var(--color-border-muted); - text-decoration-color: #10b981; -} -.menu-tocs > .menu-modal a { - display: block; - overflow: hidden; - padding: 0.3rem 0.5rem; - text-overflow: ellipsis; - white-space: nowrap; -} - -.menu-tocs > .menu-modal a.leve2 { - font-weight: bold; - color: var(--color-fg-default); -} - -.menu-tocs > .menu-modal a.leve3 { - padding-left: 1.2rem; -} -.menu-tocs > .menu-modal a.leve4, -.menu-tocs > .menu-modal a.leve5, -.menu-tocs > .menu-modal a.leve6 { - padding-left: 2.1rem; -} - -.wrap-header.h2wrap > h2 { - margin: 0; - padding: 0; - margin-bottom: 24px; - position: relative; - font-size: 30px; - line-height: 1.2; - font-weight: 200; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', - 'Droid Sans', 'Helvetica Neue', sans-serif; - margin-top: 0; -} - -.wrap-header.h2wrap > :last-child { - margin-bottom: 24px; -} -.wrap-header.h2wrap .wrap-body { - color: rgb(148 163 184/1); -} - -body:not(.home) .h2wrap > h2 a::after, -body:not(.home) .h3wrap > h3 a::after { - content: '#'; - padding-right: 0.5rem; - color: rgb(16 185 129/1); -} -body:not(.home) .h3wrap > h3 a::after { - position: absolute; - left: -18px; - font-size: 1rem; - display: none; -} -body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after { - display: initial; -} - -.wrap.h3body-exist .wrap-header.h3wrap { - flex: 1; -} - -.wrap.h3body-exist > .h3wrap-body { - flex: 1; - display: flex; - flex-direction: column; -} - -.wrap-header.h3wrap { - z-index: 0; - width: 100%; - flex: 1; -} - -.wrap-header.h3wrap > h3 { - position: sticky; - float: right; - margin-top: -24px; - color: rgb(226 232 240/1); - top: 0px; - z-index: 10; - border-top-right-radius: 0.5rem; - border-bottom-left-radius: 0.5rem; - background-color: #228e6c; - padding-left: 0.75rem; - padding-right: 0.75rem; - padding-top: 0.25rem; - padding-bottom: 0.25rem; - font-size: 0.75rem; - line-height: 1rem; - letter-spacing: 0.05em; -} - -.wrap-header.h3wrap > .wrap-body > p, -.h3wrap-body p { - margin: 0px; - width: 100%; - padding-left: 1rem; - padding-right: 1rem; - padding-top: 0.75rem; - padding-bottom: 0.75rem; - color: var(--color-fg-subtle); - background-color: var(--color-bg-subtle); -} - -.wrap-header.h3wrap > .wrap-body > p:only-child, -.h3wrap-body p:only-child { - background-color: transparent !important; - border-radius: 0.5rem; -} - -.wrap-header.h3wrap > .wrap-body > p:only-child:before { - background-color: transparent !important; -} - -.wrap-header.h3wrap > .wrap-body > p:first-child:before { - background-color: var(--color-bg-subtle); - color: rgb(30 41 59/0); - content: '-'; - line-height: 1.5rem; - top: 0; - position: absolute; - left: 0px; - width: 100%; - border-radius: 0.5rem 0.5rem 0 0; -} - -.wrap-header.h3wrap > .wrap-body > p:not(:first-child):last-child, -.h3wrap-body p:not(:first-child):last-child { - margin-top: auto; - border-radius: 0 0 0.5rem 0.5rem; -} - -.wrap-header.h3wrap > .wrap-body > :not(:first-child):last-child { - border-radius: 0 0 0.5rem 0.5rem; -} - -.wrap-header.h3wrap > .wrap-body { - z-index: 0; - display: flex; - height: 100%; - width: 100%; - flex-direction: column; -} - -.wrap-body > h4, -.wrap-body > h5, -.wrap-body > h6 { - border-color: transparent; - background-color: var(--color-neutral-muted); - color: var(--color-fg-default); - - margin: 0px; - border-top-width: 1px; - padding-left: 1rem; - padding-right: 1rem; - padding-top: 0.25rem; - padding-bottom: 0.25rem; - text-align: center; -} - -.h3wrap .wrap-body > ul, -.h3wrap .wrap-body > ol, -.h3wrap .wrap-body > dl { - margin-top: 0.5rem; - margin-bottom: 0.5rem; - display: grid; - list-style-position: outside; - grid-template-columns: repeat(1, minmax(0, 1fr)); -} - -.h3wrap > .wrap-body ul:not(:last-child), -.h3wrap > .wrap-body ol, -.h3wrap > .wrap-body dl { - margin-bottom: 0; -} - -.h2wrap-body ul li, -.h2wrap-body ol li, -.h2wrap-body dl li { - padding: 9px; - padding-left: 26px; - position: relative; - border-bottom: solid 1px var(--color-border-muted); -} - -.h2wrap-body ul:not(.style-none) > li::before { - content: ''; - position: absolute; - display: inline-block; - width: 4px; - height: 4px; - background: #556677; - border-radius: 50%; - left: 13px; - top: 18px; -} - -.h2wrap-body ul li, -.h2wrap-body ol li, -.h2wrap-body dl li { - position: relative; -} - -.h2wrap-body ul.style-timeline { - counter-reset: stepCount; -} -.h2wrap-body ul.style-timeline > li:first-child:before { - background-color: #228e6c; - color: rgb(226 232 240/1); -} -.h2wrap-body ul.style-timeline > li::before { - color: #228e6c; - background-color: var(--color-canvas-default); - counter-increment: stepCount; - content: counter(stepCount); - border-radius: initial; - border-radius: 0.5rem; - height: 1.5rem; - width: 1.5rem; - text-align: center; - font-size: 0.875rem; - line-height: 1.3rem; - border: 2px solid #228e6c; - top: -1px; - left: -14px; -} -.h2wrap-body ul.style-timeline > li:last-child { - border-image: linear-gradient(to bottom, #46c69e96, rgba(0, 0, 0, 0)) 1 100%; -} -.h2wrap-body ul.style-timeline > li { - border-bottom: 0 !important; - padding-top: 0 !important; - padding-bottom: 25px !important; - border-left: 2px solid #46c69e96; - margin-left: 30px; - border-left-color: #46c69e96; -} -.h2wrap-body ul.style-timeline > li > pre { - padding: 0 !important; - padding-top: 10px !important; - height: initial !important; -} - -.h2wrap-body ul.style-round li::before { - border-radius: 9999px; - border-width: 2px; - height: 0.5rem; - width: 0.5rem; - border-color: #228e6c; - background: transparent; - border-style: solid; - top: 14px; -} - -.h2wrap-body ul.style-arrow li:before { - position: absolute; - background-color: transparent; - border-radius: initial; - left: 16px; - top: 13px; -} - -.wrap-body ul:last-child { - margin-bottom: 0; -} - -.wrap-body ul:last-child li:last-child { - border-bottom: 0; -} - -.h3wrap hr, -.h3wrap-body hr { - border-width: 0; - border-style: solid; - border-color: #e5e7eb; - border-bottom: 1px solid var(--color-border-default); -} - -.h2wrap-body { - font-size: 0.925rem; - grid-template-columns: repeat(3, minmax(0, 1fr)); - flex-direction: column; -} - -.h2wrap-body > .wrap { - background-color: var(--color-canvas-subtle); - position: relative; - display: flex; - flex-direction: column; - border-radius: 0.5rem; - padding-top: 1.5rem; - margin-bottom: 1rem; - box-shadow: 0 0 #0000, 0 0 #0000, 0 6px 8px rgba(102, 119, 136, 0.03), 0 1px 2px rgba(102, 119, 136, 0.3); -} - -.h3wrap-body > *:last-child { - border-radius: 0 0 0.5rem 0.5rem; -} - -.h2wrap-body > .wrap.active { - box-shadow: 0 0 0 1.6pt #10b981; - transition: box-shadow 0.5s ease-in-out; -} - -.code-highlight { - display: block; - overflow-x: auto; -} - -.cols-1 { - grid-template-columns: repeat(1, minmax(0, 1fr)) !important; -} -.cols-2 { - grid-template-columns: repeat(2, minmax(0, 1fr)) !important; -} -.cols-3 { - grid-template-columns: repeat(3, minmax(0, 1fr)) !important; -} -.cols-4 { - grid-template-columns: repeat(4, minmax(0, 1fr)) !important; -} -.cols-5 { - grid-template-columns: repeat(5, minmax(0, 1fr)) !important; -} -.cols-6 { - grid-template-columns: repeat(6, minmax(0, 1fr)) !important; -} -.cols-7 { - grid-template-columns: repeat(7, minmax(0, 1fr)) !important; -} -.cols-8 { - grid-template-columns: repeat(8, minmax(0, 1fr)) !important; -} -.cols-9 { - grid-template-columns: repeat(9, minmax(0, 1fr)) !important; -} -.col-span-2 { - grid-column: span 2 / span 2; -} -.col-span-3 { - grid-column: span 3 / span 3; -} -.col-span-4 { - grid-column: span 4 / span 4; -} -.col-span-5 { - grid-column: span 5 / span 5; -} -.col-span-6 { - grid-column: span 6 / span 6; -} -.col-span-7 { - grid-column: span 7 / span 7; -} -.col-span-8 { - grid-column: span 8 / span 8; -} -.col-span-9 { - grid-column: span 9 / span 9; -} -.col-span-10 { - grid-column: span 10 / span 10; -} -.row-span-2 { - grid-row: span 2 / span 2; -} -.row-span-3 { - grid-row: span 3 / span 3; -} -.row-span-4 { - grid-row: span 4 / span 4; -} -.row-span-5 { - grid-row: span 5 / span 5; -} -.row-span-6 { - grid-row: span 6 / span 6; -} -.row-span-7 { - grid-row: span 7 / span 7; -} -.row-span-8 { - grid-row: span 8 / span 8; -} -.row-span-9 { - grid-row: span 9 / span 9; -} -.row-span-10 { - grid-row: span 10 / span 10; -} - -.wrap-text { - white-space: pre-wrap !important; - overflow-wrap: break-word !important; - word-break: break-all; -} - -.left-align, -.left-align tr :is(td, th):last-child { - text-align: left; -} - -.tooltip { - position: relative; - display: inline-block; -} -.tooltip .tooltiptext { - display: none; - font-style: inherit; - position: absolute; - background-color: rgb(67 67 67 / 66%); - color: #fff; - padding: 0.5rem; - font-size: 12px; - opacity: 0; - border-radius: 0.5rem; - z-index: 1; - transition: opacity 0.6s; - line-height: 1.5; - - width: 220px; - bottom: 125%; - left: 50%; - margin-left: -110px; -} -.tooltip .tooltiptext::after { - content: ''; - position: absolute; - top: 100%; - left: 50%; - margin-left: -5px; - border-width: 5px; - border-style: solid; - border-color: rgb(67 67 67 / 66%) transparent transparent transparent; -} -.tooltip:hover .tooltiptext { - visibility: visible; - display: inline-block; - opacity: 1; -} - -/* 代码高亮 Start */ -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: var(--color-prettylights-syntax-comment); -} -.token.namespace { - opacity: 0.7; -} -.token.tag, -.token.selector, -.token.constant, -.token.symbol, -.token.deleted { - color: var(--color-prettylights-syntax-entity-tag); -} -.token.maybe-class-name { - color: var(--color-prettylights-syntax-entity); -} -.token.property-access, -.token.operator, -.token.boolean, -.token.number, -.token.selector .token.class, -.token.attr-name, -.token.string, -.token.char, -.token.builtin { - color: var(--color-prettylights-syntax-constant); -} -.token.deleted { - color: var(--color-prettylights-syntax-markup-deleted-text); -} -.token.property { - color: var(--color-prettylights-syntax-constant); -} -.token.punctuation { - color: var(--color-prettylights-syntax-markup-ignored-bg); -} -.code-line .token.deleted { - background-color: var(--color-prettylights-syntax-markup-deleted-bg); -} -.token.inserted { - color: var(--color-prettylights-syntax-markup-inserted-text); -} -.code-line .token.inserted { - background-color: var(--color-prettylights-syntax-markup-inserted-bg); -} - -.token.variable { - color: var(--color-prettylights-syntax-constant); -} -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: var(--color-prettylights-syntax-string); -} -.token.color, -.token.atrule, -.token.attr-value, -.token.function, -.token.class-name { - color: var(--color-prettylights-syntax-string); -} -.token.rule, -.token.regex, -.token.important, -.token.keyword { - color: var(--color-prettylights-syntax-keyword); -} -.token.module { - color: var(--color-prettylights-syntax-variable); -} -.token.coord { - color: var(--color-prettylights-syntax-meta-diff-range); -} -.token.function { - color: var(--color-prettylights-syntax-entity); -} -.token.number { - color: var(--color-accent-emphasis); -} -.token.string { - color: var(--color-prettylights-syntax-string); -} -.token.boolean { - color: var(--color-prettylights-syntax-markup-heading); -} -.token.property-access { - color: var(--color-prettylights-syntax-variable); -} - -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} -.token.entity { - cursor: help; -} - -.highlight-line { - background-color: var(--color-neutral-muted); - display: block; -} -.code-line.line-number::before { - display: inline-block; - width: 1rem; - text-align: right; - margin-right: 16px; - color: var(--color-fg-subtle); - content: attr(line); - white-space: nowrap; -} -/* 代码高亮 End */ - -.footer-wrap { - margin-top: 3.5rem; - color: rgb(100 116 139/1); - background-color: var(--color-canvas-subtle); - text-align: center; - font-size: 0.75rem; -} - -body.search { - overflow: hidden; -} -#mysearch { - transition: all 0.3s; - display: none; -} -#mysearch.show .mysearch-box { - background-color: var(--color-canvas-default); - box-shadow: 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 0 #0000, 0 35px 60px -15px rgba(0, 0, 0, 0.3); - border-radius: 0.5rem; - display: flex; - flex-direction: column; - max-width: 1024px; - width: 100%; - height: 100%; -} -#mysearch.show .mysearch-result > * { - overflow-y: auto; - padding: 0.6rem; -} -#mysearch.show .mysearch-result > :last-child { - background-color: var(--color-neutral-muted); - border-bottom-right-radius: 0.5rem; -} -#mysearch.show .mysearch-result { - display: flex; - flex: 1; - height: calc(100% - 3.5rem); -} -#mysearch.show { - background-color: var(--color-neutral-muted); - height: 100vh; - left: 0; - position: fixed; - top: 0; - width: 100vw; - z-index: 200; - display: flex; - align-items: center; - justify-content: center; -} - -.mysearch-input input::placeholder { - font-weight: normal; - font-size: 1.3rem; -} -.mysearch-input { - height: 3.5rem; - display: flex; - flex-direction: row; - border-bottom: 1px solid var(--color-neutral-muted); -} -.mysearch-input > :first-child { - flex: 1; - display: flex; - flex-direction: row; - align-items: center; -} -.mysearch-input > :first-child svg { - margin-left: 1rem; - font-size: 1.3rem; - position: absolute; - color: var(--primary-color); -} -.mysearch-input > :first-child input { - flex: 1; - height: 100%; - padding-left: 2.9rem; - font-size: 1.6rem; - color: var(--color-fg-default); - border: 0; - font-weight: 800; - background: transparent; - outline: 0; -} -#mysearch-close:hover { - color: var(--primary-color); -} -#mysearch-close { - background-color: transparent; - color: var(--color-fg-default); - border: 0; - padding: 0 1.6rem; - cursor: pointer; - font-size: 1.1rem; - transition: all 0.3s; -} - -#mysearch-menu a + a { - margin: 0.2rem 0; -} -#mysearch-menu a { - display: flex; - padding-top: 0.625rem; - padding-bottom: 0.625rem; - padding-left: 0.875rem; - padding-right: 0.875rem; - transition: all 0.3s; - white-space: pre-wrap; - text-decoration: none; - color: var(--color-fg-default); - align-items: center; - justify-content: space-between; -} -#mysearch-menu a > sup { - color: var(--color-fg-subtle); - font-size: 0.7rem; -} -#mysearch-menu a:hover, -#mysearch-menu a.active { - background-color: var(--color-neutral-muted); - border-radius: 0.5rem; -} -#mysearch-menu { - width: 25rem; -} -#mysearch-content { - flex: 1; -} -#mysearch-content ol li div a:hover { - background-color: var(--primary-color); - color: #fff; -} -#mysearch-content ol li div a { - padding: 0.125rem 0.5rem; - border-radius: 100px; - margin: 0.1rem 0.2rem; - color: var(--color-fg-subtle); -} -#mysearch-content ol li div { - margin-left: -1.54rem; - padding-top: 0.82rem; -} -#mysearch-content ol li > a:hover { - text-decoration: underline; -} -#mysearch-content ol li > a { - font-weight: bold; -} -#mysearch-content ol li a { - font-size: 0.85rem; - white-space: nowrap; - display: inline-block; - text-decoration: none; - color: var(--color-fg-default); - transition: all 0.3s; -} -#mysearch-content ol li { - word-break: break-all; - white-space: pre-wrap; - padding-bottom: 1.56rem; -} -#mysearch-content ol { - list-style: auto; - padding-left: 1.75rem; -} -#mysearch-content h3 { - padding-bottom: 1.3rem; - text-align: center; - padding-top: 1.5rem; - color: var(--color-fg-subtle); - max-width: 23rem; - margin: 0 auto; - font-size: 0.85rem; -} - -@media (min-width: 1024px) { - .h2wrap-body { - display: grid; - gap: 0.95rem; - } - .h2wrap-body > .wrap { - margin-bottom: 0; - } - #mysearch.show { - padding-bottom: 5rem; - padding-top: 4rem; - } -} -@media (375px <= width <= 1024px) { - .header-nav .title { - font-size: 1rem; - } - .header-nav .max-container { - padding-top: 0.85rem; - } - .header-nav .menu a, - .header-nav .menu button { - padding: 0.2rem 0.3rem; - } - .wrap-header.h1wrap > h1 { - margin-bottom: 2rem; - font-size: 2rem; - } - .wrap-header.h1wrap { - margin-top: 1.6rem; - margin-bottom: 2rem; - } - .wrap-header.h2wrap > h2 { - font-size: 1.3rem; - } - .wrap-header.h3wrap > .wrap-body { - overflow: auto; - } - .tooltip:hover .tooltiptext { - display: none; - } - .h1wrap-body { - gap: 2rem; - } - .home-card { - gap: 1rem; - } - a.home-button { - padding-left: 1.1rem; - padding-right: 1.1rem; - margin-left: 0.5rem; - margin-right: 0.5rem; - font-size: 0.87rem; - } - .footer-wrap { - font-size: 0.75rem; - } - table.auto-wrap { - overflow: auto; - display: block; - } - table.auto-wrap thead { - display: none; - } - table.auto-wrap td, - table.auto-wrap th { - display: block; - text-align: left !important; - } - table td + td, - table th + th { - padding-top: 0 !important; - } - table td:first-child { - white-space: initial; - } - .tooltip:hover .tooltiptext { - display: inline-block; - } -} - -@media (min-width: 768px) { - .home-card { - grid-template-columns: repeat(4, minmax(0, 1fr)); - } -} diff --git a/scripts/utils/childs.mjs b/scripts/utils/childs.mjs deleted file mode 100644 index 614a2f0..0000000 --- a/scripts/utils/childs.mjs +++ /dev/null @@ -1,17 +0,0 @@ -export function getChilds(data = [], level, result = []) { - for (let i = 1; i <= data.length; i++) { - const titleNum = Number(data[i]?.tagName?.replace(/^h/, '')); - if (titleNum && titleNum === level) break; - result.push(data[i]); - } - return result; -} - -/** 获取 Heading 到下一个 Heading 之间的内容*/ -export function getHeader(data = [], level, result = []) { - for (let i = 1; i <= data.length; i++) { - if (/^h\d$/.test(data[i]?.tagName) || data[i]?.number !== level) break; - result.push(data[i]); - } - return result; -} diff --git a/scripts/utils/darkMode.mjs b/scripts/utils/darkMode.mjs deleted file mode 100644 index 78ca40b..0000000 --- a/scripts/utils/darkMode.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import path from 'path'; -import { getSVGNode } from './getSVGNode.mjs'; - -const ICONS_PATH = path.resolve(process.cwd(), 'scripts/assets'); - -export function darkMode({ homePath = '', isHome } = {}) { - const relativePath = homePath.replace(/[\\/]?index.html$/, isHome ? '' : '/'); - const iconSunPath = path.resolve(ICONS_PATH, `sun.svg`); - const iconMoonPath = path.resolve(ICONS_PATH, `moon.svg`); - const sunNode = getSVGNode(iconSunPath); - const moonNode = getSVGNode(iconMoonPath); - const darkJSUrl = relativePath + 'js/dark.js'; - return [ - { - type: 'element', - tagName: 'button', - properties: { - id: 'darkMode', - type: 'button', - }, - children: [...sunNode, ...moonNode], - }, - { - type: 'element', - tagName: 'script', - properties: { - src: darkJSUrl, - }, - }, - ]; -} diff --git a/scripts/utils/getSVGNode.mjs b/scripts/utils/getSVGNode.mjs deleted file mode 100644 index fbd0975..0000000 --- a/scripts/utils/getSVGNode.mjs +++ /dev/null @@ -1,24 +0,0 @@ -import fs from 'fs-extra'; -import path from 'path'; -import rehypeParse from 'rehype-parse'; -import { unified } from 'unified'; -import { VFile } from 'vfile'; - -export const ICONS_PATH = path.resolve(process.cwd(), 'scripts/assets'); - -export function getSVGNode(iconPath, space = 'svg') { - const svgStr = fs.readFileSync(iconPath); - const processor = unified().use(rehypeParse, { fragment: true, space }); - const file = new VFile(); - file.value = svgStr.toString(); - const hastNode = processor.runSync(processor.parse(file), file); - return hastNode.children || []; -} - -export function getVNode(str = '', space = 'html') { - const processor = unified().use(rehypeParse, { fragment: true, space }); - const file = new VFile(); - file.value = str.toString(); - const hastNode = processor.runSync(processor.parse(file), file); - return hastNode.children || []; -} diff --git a/scripts/utils/getTocsTree.mjs b/scripts/utils/getTocsTree.mjs deleted file mode 100644 index 1b81a2c..0000000 --- a/scripts/utils/getTocsTree.mjs +++ /dev/null @@ -1,160 +0,0 @@ -import path from 'path'; -import { getCodeString } from 'rehype-rewrite'; -import { panelAddNumber } from './panelAddNumber.mjs'; -import { getChilds, getHeader } from './childs.mjs'; -import { ICONS_PATH, getSVGNode } from './getSVGNode.mjs'; - -export const titleNum = (tagName = '') => Number(tagName.replace(/^h/, '')); - -export function getTocsTitleNode(arr = [], result = []) { - arr.forEach(({ tagName, type, properties, children }) => { - if (/^h[23456]/.test(tagName)) { - const num = titleNum(tagName); - const props = { - 'aria-hidden': 'true', - class: `leve${num} tocs-link`, - 'data-num': num, - href: '#' + (properties.id || ''), - }; - const title = getCodeString(children || []); - result.push({ tagName: 'a', type, properties: props, children: [{ type: 'text', value: title || ' ' }] }); - } else if (children?.length > 0) { - result = result.concat(getTocsTitleNode(children)); - } - }); - return result; -} - -export function addTocsInWarp(tocsData = [], menuData, isDone = false) { - const childs = tocsData.map((item) => { - if (item.properties?.class?.includes('h1wrap-body')) { - isDone = true; - } - if (!isDone && item.children) { - item.children = addTocsInWarp([...item.children], menuData, isDone); - } - return item; - }); - if (isDone) { - childs.splice(1, 0, menuData); - } - return childs; -} - -export const getTocsTitleNodeWarpper = (children = []) => { - const iconPath = path.resolve(ICONS_PATH, `menu.svg`); - const svgNode = getSVGNode(iconPath); - return { - type: 'element', - tagName: 'div', - properties: { - class: 'menu-tocs', - }, - children: [ - { - type: 'element', - tagName: 'div', - properties: { - class: 'menu-btn', - }, - children: [...svgNode], - }, - { - type: 'element', - tagName: 'div', - properties: { - class: 'menu-modal', - }, - children: children, - }, - ], - }; -}; - -/** Markdown 文档转成树形结构 */ -export function getTocsTree(arr = [], result = []) { - const data = panelAddNumber(arr); - - let n = 0; - let level = -1; - - while (n < data.length) { - const toc = data[n]; - - if (level === -1) { - level = toc.number; - } - if (toc.number === level && titleNum(toc.tagName) === level) { - const header = getHeader(data.slice(n), level); - const childs = getChilds([...data.slice(n + 1)], level); - const resultChilds = getTocsTree(childs); - const wrapCls = ['wrap']; - const headerCls = ['wrap-header', `h${level}wrap`]; - wrapCls.push(`h${level}body-${resultChilds.length === 0 ? 'not-' : ''}exist`); - - if (level === 1) wrapCls.push('max-container'); - const wrapStyle = toc.properties['wrap-style']; - delete toc.properties['wrap-style']; - const wrapClass = toc.properties['wrap-class']; - if (wrapClass) wrapCls.push(wrapClass); - delete toc.properties['wrap-class']; - let panle = { - type: 'element', - tagName: 'div', - properties: { class: wrapCls, style: wrapStyle }, - children: [ - { - type: 'element', - tagName: level === 1 ? 'header' : 'div', - properties: { class: headerCls }, - children: [ - toc, - { - type: 'element', - tagName: 'div', - properties: { class: ['wrap-body'] }, - children: [...header], - }, - ], - }, - ], - }; - if (titleNum(toc.tagName) > 3) { - panle = [toc, ...header]; - } - if (resultChilds.length > -1) { - const bodyStyle = toc.properties['body-style']; - delete toc.properties['body-style']; - const bodyClass = toc.properties['body-class']; - delete toc.properties['body-class']; - if (Array.isArray(panle)) { - panle = panle.concat(resultChilds); - } else if (panle.children) { - if (titleNum(toc.tagName) < 3) { - panle.children = panle.children.concat({ - type: 'element', - tagName: 'div', - properties: { class: [`h${level}wrap-body`, bodyClass], style: bodyStyle }, - children: [...resultChilds], - }); - } else { - panle.children[0].children[1].properties?.class.push(bodyClass); - panle.children[0].children[1].children = panle.children[0].children[1].children.concat(resultChilds); - if (panle.children[0].children[1].properties && bodyStyle) { - const initStyle = panle.children[0].children[1].properties?.style || ''; - panle.children[0].children[1].properties.style = initStyle + bodyStyle; - } - } - } - } - if (Array.isArray(panle)) { - result = result.concat(panle); - } else { - result.push(panle); - } - } - - n++; - } - return result; -} diff --git a/scripts/utils/homeCardIcons.mjs b/scripts/utils/homeCardIcons.mjs deleted file mode 100644 index 067d5f1..0000000 --- a/scripts/utils/homeCardIcons.mjs +++ /dev/null @@ -1,64 +0,0 @@ -import fs from 'fs-extra'; -import path from 'path'; -import { getCodeString } from 'rehype-rewrite'; -import { getSVGNode, ICONS_PATH } from './getSVGNode.mjs'; - -const resultHomeCard = {}; -const COLOR_REG = /background:(\s+)?rgb\(([\d]+\s+[\d]+\s+[\d]+(\s+)?)\);?/gi; - -export function homeCardIcons(node, parent, isHome) { - if ( - isHome && - node && - node.type === 'element' && - (node.properties?.class || node.properties?.className)?.includes('contributing') - ) { - const info = node.properties['data-info']; - if (!info) { - node.properties['data-info'] = '👆待完善需要您的参与'; - } - } - if ( - isHome && - node && - node.type === 'element' && - (node.properties?.class || node.properties?.className)?.includes('home-card') - ) { - node.children = node.children.map((child) => { - const href = child.properties?.href; - if (href && href.endsWith('.md')) { - const iconName = path.basename(href, '.md'); - const iconPath = path.resolve(ICONS_PATH, `${iconName}.svg`); - const iconDefaultPath = path.resolve(ICONS_PATH, `list.svg`); - const iconExist = fs.existsSync(iconPath); - let color = ''; - child.properties.style = child.properties.style.replace(COLOR_REG, (str) => { - color = str.replace(COLOR_REG, '$2'); - return str.replace(/(\);)/, '/ var(--bg-opacity)$1'); - }); - const tags = child.properties['data-lang']; - const labelNode = { - type: 'element', - tagName: 'span', - children: child.children, - }; - const title = getCodeString(child.children); - if (iconExist) { - const svgNode = getSVGNode(iconPath); - child.children = [...svgNode, labelNode]; - } else { - const svgNode = getSVGNode(iconDefaultPath); - child.children = [...svgNode, labelNode]; - } - resultHomeCard[iconName] = { - md: iconName, - title: title, - rgb: color, - tags: tags ? tags.split('/') : [], - }; - } - return child; - }); - } - return resultHomeCard; -} diff --git a/scripts/utils/panelAddNumber.mjs b/scripts/utils/panelAddNumber.mjs deleted file mode 100644 index 697709b..0000000 --- a/scripts/utils/panelAddNumber.mjs +++ /dev/null @@ -1,17 +0,0 @@ -/** 标记 Number */ -export function panelAddNumber(arr = [], result = []) { - let n = 0; - let level = -1; - while (n < arr.length) { - const toc = arr[n]; - const titleNum = Number(toc?.tagName?.replace(/^h/, '')); - if (titleNum && titleNum > -1) { - level = titleNum; - } - if (toc) { - result.push({ ...toc, number: level }); - } - n++; - } - return result; -} diff --git a/scripts/utils/rehypePreviewHTML.mjs b/scripts/utils/rehypePreviewHTML.mjs deleted file mode 100644 index 3e1dcdf..0000000 --- a/scripts/utils/rehypePreviewHTML.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { visit } from 'unist-util-visit'; -import { getCodeString } from 'rehype-rewrite'; -import { getVNode } from './getSVGNode.mjs'; - -export function rehypePreviewHTML() { - return (tree) => { - visit(tree, (node, index, parent) => { - if (node.type === 'element' && node.tagName === 'pre') { - const child = node.children[0]; - if ( - child.properties?.className?.includes('language-html') && - child?.tagName === 'code' && - child.data?.meta === 'preview' - ) { - const code = getCodeString(child.children); - const vnode = getVNode(code || ''); - node.children = vnode; - } - } - }); - }; -} diff --git a/scripts/utils/rehypeTitle.mjs b/scripts/utils/rehypeTitle.mjs deleted file mode 100644 index 8345a02..0000000 --- a/scripts/utils/rehypeTitle.mjs +++ /dev/null @@ -1,20 +0,0 @@ -import fs from 'fs-extra'; -import path from 'path'; -import { getSVGNode, ICONS_PATH } from './getSVGNode.mjs'; - -export function rehypeTitle(node, iconName) { - if (node.type === 'element' && node.tagName === 'h1' && iconName !== 'index') { - const iconPath = path.resolve(ICONS_PATH, `${iconName}.svg`); - const iconDefaultPath = path.resolve(ICONS_PATH, `list.svg`); - const iconExist = fs.existsSync(iconPath); - if (iconExist) { - const svgNode = getSVGNode(iconPath); - node.children = [...svgNode, ...node.children]; - // 如果存在返回图标名称 - return iconName; - } else { - const svgNode = getSVGNode(iconDefaultPath); - node.children = [...svgNode, ...node.children]; - } - } -} diff --git a/scripts/utils/rehypeUrls.mjs b/scripts/utils/rehypeUrls.mjs deleted file mode 100644 index ea2aea9..0000000 --- a/scripts/utils/rehypeUrls.mjs +++ /dev/null @@ -1,11 +0,0 @@ -export function rehypeUrls(node) { - if ( - node.type === 'element' && - node.properties?.href && - /.md/.test(node.properties.href) && - !/^(https?:\/\/)/.test(node.properties.href) - ) { - let href = node.properties.href; - node.properties.href = href.replace(/([^\.\/\\]+)\.(md|markdown)/gi, '$1.html'); - } -} diff --git a/scripts/utils/tooltips.mjs b/scripts/utils/tooltips.mjs deleted file mode 100644 index e45f0f5..0000000 --- a/scripts/utils/tooltips.mjs +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 配置 tooltips 注释 - * - * ```markdown - * - [超链接有 tooltips 提示](#1xx-information) _Tooltips 展示内容_ - * ``` - * - * 上面示例:将 “Tooltips 展示内容” 放到 前一个 `` dom 节点作为子节点 - * - * - 注释配置的,前一个节点 A,A 的前一个节点 B - * - 如果 A 和 B 其中一个不存在 `tooltips` 将失效 - * - 设置 B 的类名称为 tooltips - */ -export function tooltips(node, index, parent) { - if (node.type === 'comment' && parent?.children.length > 2) { - const childs = parent?.children; - const result = []; - let recordPos = false; // 记录位置 - let tooltipNode = null; - for (let i = childs.length; i > -1; i--) { - const node = childs[i]; - // 记录 tooltip 的开始位置 - if (node?.type === 'comment' && node?.value === 'rehype:tooltips') { - recordPos = true; - continue; - } - // 记录 tooltip 的 node - if (recordPos && !tooltipNode) { - if (node.type === 'comment' || (node.type === 'text' && !node?.value?.replace(/\s\n/g, ''))) { - recordPos = false; - } - if (recordPos && node.type === 'element') { - tooltipNode = node; - tooltipNode.properties['class'] = 'tooltiptext'; - delete tooltipNode.position; - continue; - } - } - // 将 tooltip 节点,插入到下一个 element 节点的子节点中 - if (tooltipNode) { - if (node.type === 'comment' || (node.type === 'text' && !node?.value?.replace(/\s\n/g, ''))) { - recordPos = false; - tooltipNode = null; - } - if (tooltipNode && node?.type === 'element') { - recordPos = false; - node.properties['class'] = 'tooltip'; - node.children.push(tooltipNode); - tooltipNode = null; - } - } - if (!recordPos && node) { - result.push(node); - } - } - if (parent) { - parent.children = [...result.reverse()]; - } - } -} - -export function getPreviewNode() {} diff --git a/scripts/watch.mjs b/scripts/watch.mjs deleted file mode 100644 index c4c7579..0000000 --- a/scripts/watch.mjs +++ /dev/null @@ -1,32 +0,0 @@ -import path from 'path'; -import chokidar from 'chokidar'; -import { getStat } from 'recursive-readdir-files'; -import { run, DOCS, createHTML, copyCSSFile, copyJSFile } from './index.mjs'; - -(async () => { - await run(); - const homeMdPath = path.relative(process.cwd(), 'README.md'); - const cssDirPath = path.relative(process.cwd(), 'scripts/style'); - const jsDirPath = path.relative(process.cwd(), 'scripts/js'); - const watcher = chokidar.watch([DOCS, homeMdPath, cssDirPath, jsDirPath], { - ignored: /(^|[\/\\])\../, // ignore dotfiles - persistent: true, - }); - - watcher - .on('change', async (filepath) => { - if (filepath.endsWith('.md')) { - const stats = await getStat(filepath); - createHTML([stats]); - } - if (filepath.endsWith('.css')) { - copyCSSFile(filepath); - console.log(`♻️ \x1b[32;1m ${path.relative(cssDirPath, filepath)} \x1b[0m`); - } - if (filepath.endsWith('.js')) { - copyJSFile(filepath); - console.log(`♻️ \x1b[32;1m ${path.relative(jsDirPath, filepath)} \x1b[0m`); - } - }) - .on('error', (error) => console.log(`Watcher error: ${error}`)); -})();