From cacbea2302a53a914239e4b407f9ca8673ac6211 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Sat, 14 Dec 2024 19:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=BB=93=E6=9E=84=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=BC=80=E5=8F=91=E5=92=8C=E6=89=A9=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8C=87=E5=8D=97=EF=BC=9B=E4=BF=AE=E6=94=B9=E4=BE=A7?= =?UTF-8?q?=E8=BE=B9=E6=A0=8F=E9=85=8D=E7=BD=AE=E4=BB=A5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=96=B0=E7=AB=A0=E8=8A=82=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-docs.sh | 4 ++-- docs/.vitepress/config/common.ts | 8 ++++--- docs/en/start/index.md | 0 docs/en/start/install.md | 0 docs/zh/dev/api/index.md | 1 + docs/zh/dev/extension.md | 5 ++++ docs/zh/dev/index.md | 1 - docs/zh/dev/project.md | 41 ++++++++++++++++++++++++++++++++ docs/zh/start/index.md | 0 docs/zh/start/install.md | 0 10 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 docs/en/start/index.md create mode 100644 docs/en/start/install.md create mode 100644 docs/zh/dev/extension.md create mode 100644 docs/zh/dev/project.md create mode 100644 docs/zh/start/index.md create mode 100644 docs/zh/start/install.md diff --git a/build-docs.sh b/build-docs.sh index 8c84d1fa..9f75c5eb 100755 --- a/build-docs.sh +++ b/build-docs.sh @@ -1,2 +1,2 @@ -litedoc nonebot_plugin_marshoai -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -f title=%filetitle% -bu https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/ -litedoc nonebot_plugin_marshoai -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -f title=%filetitle% -bu https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/ \ No newline at end of file +litedoc nonebot_plugin_marshoai -o docs/zh/dev/api -l zh-Hans -cd class -fd func -md func -vd var -f title=%filetitle%,order=100 -bu https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/ +litedoc nonebot_plugin_marshoai -o docs/en/dev/api -l en -cd class -fd func -md func -vd var -f title=%filetitle%,order=100 -bu https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/ \ No newline at end of file diff --git a/docs/.vitepress/config/common.ts b/docs/.vitepress/config/common.ts index 372af041..cfb1cd6b 100644 --- a/docs/.vitepress/config/common.ts +++ b/docs/.vitepress/config/common.ts @@ -6,18 +6,20 @@ export const gitea = { export const defaultLang = 'zh' -const commonSidebarOptions = { +const commonSidebarOptions: VitePressSidebarOptions = { collapsed: true, convertSameNameSubFileToGroupIndexPage: true, useTitleFromFrontmatter: true, useFolderTitleFromIndexFile: false, useFolderLinkFromIndexFile: true, - includeFolderIndexFile: true, + useTitleFromFileHeading: true, rootGroupText: 'MARSHOAI', + includeFolderIndexFile: true, + sortMenusByFrontmatterOrder: true, } export function generateSidebarConfig(): VitePressSidebarOptions[] { - let sections = ["dev"] + let sections = ["dev", "start"] let languages = ['zh', 'en'] let ret: VitePressSidebarOptions[] = [] for (let language of languages) { diff --git a/docs/en/start/index.md b/docs/en/start/index.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/en/start/install.md b/docs/en/start/install.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/zh/dev/api/index.md b/docs/zh/dev/api/index.md index a2d896d5..faccf456 100644 --- a/docs/zh/dev/api/index.md +++ b/docs/zh/dev/api/index.md @@ -1,4 +1,5 @@ --- +order: 100 title: index collapsed: true --- diff --git a/docs/zh/dev/extension.md b/docs/zh/dev/extension.md new file mode 100644 index 00000000..68865217 --- /dev/null +++ b/docs/zh/dev/extension.md @@ -0,0 +1,5 @@ +--- +order: 2 +--- + +# 扩展开发 diff --git a/docs/zh/dev/index.md b/docs/zh/dev/index.md index 54909ff9..e69de29b 100644 --- a/docs/zh/dev/index.md +++ b/docs/zh/dev/index.md @@ -1 +0,0 @@ -# DEV \ No newline at end of file diff --git a/docs/zh/dev/project.md b/docs/zh/dev/project.md new file mode 100644 index 00000000..7968a797 --- /dev/null +++ b/docs/zh/dev/project.md @@ -0,0 +1,41 @@ +--- +order: 1 +--- + +# 项目开发 + +## 先决条件 + +- `Git` +- `Python3.10+` + +## 准备工作 + +- 克隆仓库 + +```bash +git clone https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git # 克隆仓库 +cd nonebot-plugin-marshoai # 切换目录 +``` + +- 安装依赖 +项目使用pdm作为依赖管理 + +```bash +python3 -m venv venv # 或创建你自己的环境 +source venv/bin/activate # 激活虚拟环境 +pip install pdm # 安装依赖管理 +pdm install # 安装依赖 +pre-commit install # 安装 pre-commit 钩子 +``` + +## 代码规范 + +主仓库需要遵循以下代码规范 + +- [`PEP8`](https://peps.python.org/pep-0008/) 代码风格 +- [`Black`](https://black.readthedocs.io/en/stable/index.html) 代码格式化 +- [`mypy`](https://www.mypy-lang.org/) 静态类型检查 +- [`Google Docstring`](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html) 文档规范 + +可以在编辑器中安装相应的插件进行辅助 diff --git a/docs/zh/start/index.md b/docs/zh/start/index.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/zh/start/install.md b/docs/zh/start/install.md new file mode 100644 index 00000000..e69de29b