From 37b1346361a9ffa88e0538002228af74c310dc2b Mon Sep 17 00:00:00 2001 From: snowy Date: Thu, 28 Mar 2024 12:05:03 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20vuepress=E6=9E=84=E5=BB=BA=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/navbar.ts | 16 +- docs/.vuepress/sidebar.ts | 4 +- docs/.vuepress/theme.js | 350 ++++++++++++++++++------------------ docs/.vuepress/theme.ts | 187 ------------------- docs/demo/README.md | 9 - docs/demo/disable.md | 42 ----- docs/demo/encrypt.md | 15 -- docs/demo/layout.md | 30 ---- docs/demo/markdown.md | 269 --------------------------- docs/demo/page.md | 125 ------------- docs/deployment/README.md | 6 +- docs/deployment/config.md | 41 +++++ docs/guide/README.md | 16 -- docs/guide/bar/README.md | 13 -- docs/guide/bar/baz.md | 6 - docs/guide/foo/README.md | 13 -- docs/guide/foo/ray.md | 6 - docs/usage/README.md | 6 +- docs/usage/basic_command.md | 52 ++++++ docs/usage/extra_command.md | 6 + 20 files changed, 295 insertions(+), 917 deletions(-) delete mode 100644 docs/.vuepress/theme.ts delete mode 100644 docs/demo/README.md delete mode 100644 docs/demo/disable.md delete mode 100644 docs/demo/encrypt.md delete mode 100644 docs/demo/layout.md delete mode 100644 docs/demo/markdown.md delete mode 100644 docs/demo/page.md delete mode 100644 docs/guide/README.md delete mode 100644 docs/guide/bar/README.md delete mode 100644 docs/guide/bar/baz.md delete mode 100644 docs/guide/foo/README.md delete mode 100644 docs/guide/foo/ray.md create mode 100644 docs/usage/basic_command.md create mode 100644 docs/usage/extra_command.md diff --git a/docs/.vuepress/navbar.ts b/docs/.vuepress/navbar.ts index 0a0a9d28..b1ed99b9 100644 --- a/docs/.vuepress/navbar.ts +++ b/docs/.vuepress/navbar.ts @@ -1,7 +1,15 @@ -import { navbar } from "vuepress-theme-hope"; +import {navbar} from "vuepress-theme-hope"; export default navbar([ - "/", - "/deployment/", - "/usage/", + "/", + { + text: "项目部署", + link: "/deployment/", + prefix: "deployment/", + }, + { + text: "使用手册", + link: "/usage/", + prefix: "usage/", + } ]); diff --git a/docs/.vuepress/sidebar.ts b/docs/.vuepress/sidebar.ts index d50fd551..6e9bb8e2 100644 --- a/docs/.vuepress/sidebar.ts +++ b/docs/.vuepress/sidebar.ts @@ -7,14 +7,12 @@ export default sidebar({ text: "项目部署", icon: "laptop-code", prefix: "deployment/", - link: "deployment/", children: "structure", }, { text: "使用手册", - icon: "laptop-code", + icon: "book", prefix: "usage/", - link: "usage/", children: "structure", }, ], diff --git a/docs/.vuepress/theme.js b/docs/.vuepress/theme.js index 32e982e3..fc646e9e 100644 --- a/docs/.vuepress/theme.js +++ b/docs/.vuepress/theme.js @@ -1,187 +1,187 @@ -import {hopeTheme} from "vuepress-theme-hope"; +import { hopeTheme } from "vuepress-theme-hope"; import navbar from "./navbar.js"; import sidebar from "./sidebar.js"; export default hopeTheme({ - hostname: "https://vuepress-theme-hope-docs-demo.netlify.app", + hostname: "https://vuepress-theme-hope-docs-demo.netlify.app", - author: { - name: "SnowyKami", - url: "https://snowykami.me", + author: { + name: "远野千束", + url: "https://snowykami.me", + }, + + iconAssets: "fontawesome-with-brands", + + logo: "https://cdn.liteyuki.icu/static/img/logo.png", + + repo: "https://github.com/snowykami/LiteyukiBot", + + docsDir: "src", + + // 导航栏 + navbar, + + // 侧边栏 + sidebar, + + // 页脚 + footer: "默认页脚", + displayFooter: true, + + // 加密配置 + encrypt: { + config: { + "/demo/encrypt.html": ["1234"], + }, + }, + + // 多语言配置 + metaLocales: { + editLink: "在 GitHub 上编辑此页", + }, + + // 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响 + // hotReload: true, + + // 在这里配置主题提供的插件 + plugins: { + // 你应该自行生成自己的评论服务 + comment: { + provider: "Giscus", + repo: "vuepress-theme-hope/giscus-discussions", + repoId: "R_kgDOG_Pt2A", + category: "Announcements", + categoryId: "DIC_kwDOG_Pt2M4COD69", }, - iconAssets: "fontawesome-with-brands", - - logo: "https://cdn.liteyuki.icu/static/img/logo.png", - - repo: "https://github.com/snowykami/LiteyukiBot", - - docsDir: "src", - - // 导航栏 - navbar, - - // 侧边栏 - sidebar, - - // 页脚 - footer: "LiteyukiBot", - displayFooter: true, - - // 加密配置 - encrypt: { - config: { - "/demo/encrypt.html": ["1234"], - }, + components: { + components: ["Badge", "VPCard"], }, - // 多语言配置 - metaLocales: { - editLink: "在 GitHub 上编辑此页", + // 此处开启了很多功能用于演示,你应仅保留用到的功能。 + mdEnhance: { + align: true, + attrs: true, + codetabs: true, + component: true, + demo: true, + figure: true, + imgLazyload: true, + imgSize: true, + include: true, + mark: true, + stylize: [ + { + matcher: "Recommended", + replacer: ({ tag }) => { + if (tag === "em") + return { + tag: "Badge", + attrs: { type: "tip" }, + content: "Recommended", + }; + }, + }, + ], + sub: true, + sup: true, + tabs: true, + vPre: true, + + // 在启用之前安装 chart.js + // chart: true, + + // insert component easily + + // 在启用之前安装 echarts + // echarts: true, + + // 在启用之前安装 flowchart.ts + // flowchart: true, + + // gfm requires mathjax-full to provide tex support + // gfm: true, + + // 在启用之前安装 katex + // katex: true, + + // 在启用之前安装 mathjax-full + // mathjax: true, + + // 在启用之前安装 mermaid + // mermaid: true, + + // playground: { + // presets: ["ts", "vue"], + // }, + + // 在启用之前安装 reveal.js + // revealJs: { + // plugins: ["highlight", "math", "search", "notes", "zoom"], + // }, + + // 在启用之前安装 @vue/repl + // vuePlayground: true, + + // install sandpack-vue3 before enabling it + // sandpack: true, }, - // 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响 - // hotReload: true, - - // 在这里配置主题提供的插件 - plugins: { - // 你应该自行生成自己的评论服务 - comment: { - provider: "Giscus", - repo: "vuepress-theme-hope/giscus-discussions", - repoId: "R_kgDOG_Pt2A", - category: "Announcements", - categoryId: "DIC_kwDOG_Pt2M4COD69", - }, - - components: { - components: ["Badge", "VPCard"], - }, - - // 此处开启了很多功能用于演示,你应仅保留用到的功能。 - mdEnhance: { - align: true, - attrs: true, - codetabs: true, - component: true, - demo: true, - figure: true, - imgLazyload: true, - imgSize: true, - include: true, - mark: true, - stylize: [ - { - matcher: "Recommended", - replacer: ({tag}) => { - if (tag === "em") - return { - tag: "Badge", - attrs: {type: "tip"}, - content: "Recommended", - }; - }, - }, - ], - sub: true, - sup: true, - tabs: true, - vPre: true, - - // 在启用之前安装 chart.js - // chart: true, - - // insert component easily - - // 在启用之前安装 echarts - // echarts: true, - - // 在启用之前安装 flowchart.ts - // flowchart: true, - - // gfm requires mathjax-full to provide tex support - // gfm: true, - - // 在启用之前安装 katex - // katex: true, - - // 在启用之前安装 mathjax-full - // mathjax: true, - - // 在启用之前安装 mermaid - // mermaid: true, - - // playground: { - // presets: ["ts", "vue"], - // }, - - // 在启用之前安装 reveal.js - // revealJs: { - // plugins: ["highlight", "math", "search", "notes", "zoom"], - // }, - - // 在启用之前安装 @vue/repl - // vuePlayground: true, - - // install sandpack-vue3 before enabling it - // sandpack: true, - }, - - // 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释 - // pwa: { - // favicon: "/favicon.ico", - // cacheHTML: true, - // cachePic: true, - // appendBase: true, - // apple: { - // icon: "/assets/icon/apple-icon-152.png", - // statusBarColor: "black", - // }, - // msTile: { - // image: "/assets/icon/ms-icon-144.png", - // color: "#ffffff", - // }, - // manifest: { - // icons: [ - // { - // src: "/assets/icon/chrome-mask-512.png", - // sizes: "512x512", - // purpose: "maskable", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-mask-192.png", - // sizes: "192x192", - // purpose: "maskable", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-512.png", - // sizes: "512x512", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-192.png", - // sizes: "192x192", - // type: "image/png", - // }, - // ], - // shortcuts: [ - // { - // name: "Demo", - // short_name: "Demo", - // url: "/demo/", - // icons: [ - // { - // src: "/assets/icon/guide-maskable.png", - // sizes: "192x192", - // purpose: "maskable", - // type: "image/png", - // }, - // ], - // }, - // ], - // }, - // }, - }, + // 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释 + // pwa: { + // favicon: "/favicon.ico", + // cacheHTML: true, + // cachePic: true, + // appendBase: true, + // apple: { + // icon: "/assets/icon/apple-icon-152.png", + // statusBarColor: "black", + // }, + // msTile: { + // image: "/assets/icon/ms-icon-144.png", + // color: "#ffffff", + // }, + // manifest: { + // icons: [ + // { + // src: "/assets/icon/chrome-mask-512.png", + // sizes: "512x512", + // purpose: "maskable", + // type: "image/png", + // }, + // { + // src: "/assets/icon/chrome-mask-192.png", + // sizes: "192x192", + // purpose: "maskable", + // type: "image/png", + // }, + // { + // src: "/assets/icon/chrome-512.png", + // sizes: "512x512", + // type: "image/png", + // }, + // { + // src: "/assets/icon/chrome-192.png", + // sizes: "192x192", + // type: "image/png", + // }, + // ], + // shortcuts: [ + // { + // name: "Demo", + // short_name: "Demo", + // url: "/demo/", + // icons: [ + // { + // src: "/assets/icon/guide-maskable.png", + // sizes: "192x192", + // purpose: "maskable", + // type: "image/png", + // }, + // ], + // }, + // ], + // }, + // }, + }, }); diff --git a/docs/.vuepress/theme.ts b/docs/.vuepress/theme.ts deleted file mode 100644 index 2b9fdc1c..00000000 --- a/docs/.vuepress/theme.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { hopeTheme } from "vuepress-theme-hope"; -import navbar from "./navbar.js"; -import sidebar from "./sidebar.js"; - -export default hopeTheme({ - hostname: "https://vuepress-theme-hope-docs-demo.netlify.app", - - author: { - name: "Mr.Hope", - url: "https://mister-hope.com", - }, - - iconAssets: "fontawesome-with-brands", - - logo: "https://theme-hope-assets.vuejs.press/logo.svg", - - repo: "vuepress-theme-hope/vuepress-theme-hope", - - docsDir: "src", - - // 导航栏 - navbar, - - // 侧边栏 - sidebar, - - // 页脚 - footer: "默认页脚", - displayFooter: true, - - // 加密配置 - encrypt: { - config: { - "/demo/encrypt.html": ["1234"], - }, - }, - - // 多语言配置 - metaLocales: { - editLink: "在 GitHub 上编辑此页", - }, - - // 如果想要实时查看任何改变,启用它。注: 这对更新性能有很大负面影响 - // hotReload: true, - - // 在这里配置主题提供的插件 - plugins: { - // 你应该自行生成自己的评论服务 - comment: { - provider: "Giscus", - repo: "vuepress-theme-hope/giscus-discussions", - repoId: "R_kgDOG_Pt2A", - category: "Announcements", - categoryId: "DIC_kwDOG_Pt2M4COD69", - }, - - components: { - components: ["Badge", "VPCard"], - }, - - // 此处开启了很多功能用于演示,你应仅保留用到的功能。 - mdEnhance: { - align: true, - attrs: true, - codetabs: true, - component: true, - demo: true, - figure: true, - imgLazyload: true, - imgSize: true, - include: true, - mark: true, - stylize: [ - { - matcher: "Recommended", - replacer: ({ tag }) => { - if (tag === "em") - return { - tag: "Badge", - attrs: { type: "tip" }, - content: "Recommended", - }; - }, - }, - ], - sub: true, - sup: true, - tabs: true, - vPre: true, - - // 在启用之前安装 chart.js - // chart: true, - - // insert component easily - - // 在启用之前安装 echarts - // echarts: true, - - // 在启用之前安装 flowchart.ts - // flowchart: true, - - // gfm requires mathjax-full to provide tex support - // gfm: true, - - // 在启用之前安装 katex - // katex: true, - - // 在启用之前安装 mathjax-full - // mathjax: true, - - // 在启用之前安装 mermaid - // mermaid: true, - - // playground: { - // presets: ["ts", "vue"], - // }, - - // 在启用之前安装 reveal.js - // revealJs: { - // plugins: ["highlight", "math", "search", "notes", "zoom"], - // }, - - // 在启用之前安装 @vue/repl - // vuePlayground: true, - - // install sandpack-vue3 before enabling it - // sandpack: true, - }, - - // 如果你需要 PWA。安装 @vuepress/plugin-pwa 并取消下方注释 - // pwa: { - // favicon: "/favicon.ico", - // cacheHTML: true, - // cachePic: true, - // appendBase: true, - // apple: { - // icon: "/assets/icon/apple-icon-152.png", - // statusBarColor: "black", - // }, - // msTile: { - // image: "/assets/icon/ms-icon-144.png", - // color: "#ffffff", - // }, - // manifest: { - // icons: [ - // { - // src: "/assets/icon/chrome-mask-512.png", - // sizes: "512x512", - // purpose: "maskable", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-mask-192.png", - // sizes: "192x192", - // purpose: "maskable", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-512.png", - // sizes: "512x512", - // type: "image/png", - // }, - // { - // src: "/assets/icon/chrome-192.png", - // sizes: "192x192", - // type: "image/png", - // }, - // ], - // shortcuts: [ - // { - // name: "Demo", - // short_name: "Demo", - // url: "/demo/", - // icons: [ - // { - // src: "/assets/icon/guide-maskable.png", - // sizes: "192x192", - // purpose: "maskable", - // type: "image/png", - // }, - // ], - // }, - // ], - // }, - // }, - }, -}); diff --git a/docs/demo/README.md b/docs/demo/README.md deleted file mode 100644 index 8d83ff52..00000000 --- a/docs/demo/README.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: 主要功能与配置演示 -index: false -icon: laptop-code -category: - - 使用指南 ---- - -a diff --git a/docs/demo/disable.md b/docs/demo/disable.md deleted file mode 100644 index ff54b571..00000000 --- a/docs/demo/disable.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: 布局与功能禁用 -icon: gears -order: 4 -category: - - 使用指南 -tag: - - 禁用 - -navbar: false -sidebar: false - -breadcrumb: false -pageInfo: false -contributors: false -editLink: false -lastUpdated: false -prev: false -next: false -comment: false -footer: false - -backtotop: false ---- - -你可以通过设置页面的 Frontmatter,在页面禁用功能与布局。 - - - -本页面就是一个示例,禁用了如下功能: - -- 导航栏 -- 侧边栏 -- 路径导航 -- 页面信息 -- 贡献者 -- 编辑此页链接 -- 更新时间 -- 上一篇/下一篇 链接 -- 评论 -- 页脚 -- 返回顶部按钮 diff --git a/docs/demo/encrypt.md b/docs/demo/encrypt.md deleted file mode 100644 index 20d8d23a..00000000 --- a/docs/demo/encrypt.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -icon: lock -category: - - 使用指南 -tag: - - 加密 ---- - -# 密码加密的文章 - -实际的文章内容。 - -段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字段落 1 文字。 - -段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字段落 2 文字。 diff --git a/docs/demo/layout.md b/docs/demo/layout.md deleted file mode 100644 index 123dc679..00000000 --- a/docs/demo/layout.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: 布局 -icon: object-group -order: 3 -category: 使用指南 -tag: - - 布局 ---- - -布局包括: - -- [导航栏](https://theme-hope.vuejs.press/zh/guide/layout/navbar.html) -- [侧边栏](https://theme-hope.vuejs.press/zh/guide/layout/sidebar.html) -- [页脚](https://theme-hope.vuejs.press/zh/guide/layout/footer.html) - -同时每个页面包含: - -- [路径导航](https://theme-hope.vuejs.press/zh/guide/layout/breadcrumb.html) -- [标题和页面信息](https://theme-hope.vuejs.press/zh/guide/feature/page-info.html) -- [TOC (文章标题列表)](https://theme-hope.vuejs.press/zh/guide/layout/page.html#标题列表) -- [贡献者、更新时间等页面元信息](https://theme-hope.vuejs.press/guide/feature/meta.html) -- [评论](https://theme-hope.vuejs.press/zh/guide/feature/comment.html) - -主题也带有以下元素: - -- [夜间模式按钮](https://theme-hope.vuejs.press/zh/guide/interface/darkmode.html) -- [返回顶部按钮](https://theme-hope.vuejs.press/guide/interface/others.html#返回顶部按钮) -- [打印按钮](https://theme-hope.vuejs.press/guide/interface/others.html#打印按钮) - -你可以在主题选项和页面的 frontmatter 中自定义它们。 diff --git a/docs/demo/markdown.md b/docs/demo/markdown.md deleted file mode 100644 index dd4e7c0e..00000000 --- a/docs/demo/markdown.md +++ /dev/null @@ -1,269 +0,0 @@ ---- -title: Markdown 展示 -icon: fab fa-markdown -order: 2 -category: - - 使用指南 -tag: - - Markdown ---- - -VuePress 主要从 Markdown 文件生成页面。因此,你可以使用它轻松生成文档或博客站点。 - -你应该创建和编写 Markdown 文件,以便 VuePress 可以根据文件结构将它们转换为不同的页面。 - - - -## Markdown 介绍 - -如果你是一个新手,还不会编写 Markdown,请先阅读 [Markdown 介绍](https://theme-hope.vuejs.press/zh/cookbook/markdown/) 和 [Markdown 演示](https://theme-hope.vuejs.press/zh/cookbook/markdown/demo.html)。 - -## Markdown 配置 - -VuePress 通过 Frontmatter 为每个 Markdown 页面引入配置。 - -::: info - -Frontmatter 是 VuePress 中很重要的一个概念,如果你不了解它,你需要阅读 [Frontmatter 介绍](https://theme-hope.vuejs.press/zh/cookbook/vuepress/page.html#front-matter)。 - -::: - -## Markdown 扩展 - -VuePress 会使用 [markdown-it](https://github.com/markdown-it/markdown-it) 来解析 Markdown 内容,因此可以借助于 markdown-it 插件来实现 [语法扩展](https://github.com/markdown-it/markdown-it#syntax-extensions) 。 - -### VuePress 扩展 - -为了丰富文档写作,VuePress 对 Markdown 语法进行了扩展。 - -关于这些扩展,请阅读 [VuePress 中的 Markdown 扩展](https://theme-hope.vuejs.press/zh/cookbook/vuepress/markdown.html)。 - -### 主题扩展 - -通过 [`vuepress-plugin-md-enhance`][md-enhance],主题扩展了更多 Markdown 语法,提供更加丰富的写作功能。 - -#### 提示容器 - -::: v-pre - -安全的在 Markdown 中使用 {{ variable }}。 - -::: - -::: info 自定义标题 - -信息容器,包含 `代码` 与 [链接](#提示容器)。 - -```js -const a = 1; -``` - -::: - -::: tip 自定义标题 - -提示容器 - -::: - -::: warning 自定义标题 - -警告容器 - -::: - -::: caution 自定义标题 - -危险容器 - -::: - -::: details 自定义标题 - -详情容器 - -::: - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/hint.html) - -#### 代码块 - -::: code-tabs - -@tab pnpm - -```bash -pnpm add -D vuepress-theme-hope -``` - -@tab yarn - -```bash -yarn add -D vuepress-theme-hope -``` - -@tab:active npm - -```bash -npm i -D vuepress-theme-hope -``` - -::: - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/code-tabs.html) - -#### 上下角标 - -19^th^ H~2~O - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/sup-sub.html) - -#### 自定义对齐 - -::: center - -我是居中的 - -::: - -::: right - -我在右对齐 - -::: - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/align.html) - -#### Attrs - -一个拥有 ID 的 **单词**{#word}。 - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/attrs.html) - -#### 脚注 - -此文字有脚注[^first]. - -[^first]: 这是脚注内容 - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/footnote.html) - -#### 标记 - -你可以标记 ==重要的内容== 。 - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/mark.html) - -#### 任务列表 - -- [x] 计划 1 -- [ ] 计划 2 - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/tasklist.html) - -### 图片增强 - -支持为图片设置颜色模式和大小 - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/image.html) - -#### 组件 - -```component VPCard -title: Mr.Hope -desc: Where there is light, there is hope -logo: https://mister-hope.com/logo.svg -link: https://mister-hope.com -background: rgba(253, 230, 138, 0.15) -``` - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/component.html) - -#### 导入文件 - - - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/include.html) - -#### 样式化 - -向 Mr.Hope 捐赠一杯咖啡。 _Recommended_ - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/stylize.html) - -#### Tex 语法 - -$$ -\frac {\partial^r} {\partial \omega^r} \left(\frac {y^{\omega}} {\omega}\right) -= \left(\frac {y^{\omega}} {\omega}\right) \left\{(\log y)^r + \sum_{i=1}^r \frac {(-1)^i r \cdots (r-i+1) (\log y)^{r-i}} {\omega^i} \right\} -$$ - -- [查看详情](https://theme-hope.vuejs.press/zh/guide/markdown/tex.html) - -#### 图表 - -