📝 add asciinema svg to install doc

This commit is contained in:
yanyongyu
2022-01-27 21:24:56 +08:00
parent afea004421
commit 15d68706b3
9 changed files with 105 additions and 17 deletions

View File

@ -3,13 +3,15 @@ sidebar_position: 2
description: 通过脚手架, pip 安装适配器
---
import Asciinema from "@site/src/components/Asciinema";
# 安装协议适配器
## 查看
前往 [商店](/store) 即可查看所有协议适配器。
或者使用 `nb-cli` 命令行查看
或者使用 `nb-cli` 命令行查看:
```bash
nb adapter list
@ -19,13 +21,13 @@ nb adapter list
前往 [商店](/store) 点击复制 `nb-cli` 安装命令至命令行执行即可安装。
或者自行输入命令安装
或者自行输入命令安装:
```bash
nb adapter install <adapter-name>
```
或者使用交互模式安装
或者使用交互模式安装:
```bash
nb adapter install
@ -37,4 +39,7 @@ nb adapter install
pip install <adapter-name>
```
<!-- TODO: asciinema for install adapter -->
<Asciinema
url="https://asciinema.org/a/464727.cast"
options={{ theme: "monokai", poster: "npt:2.0" }}
/>

View File

@ -3,6 +3,8 @@ sidebar_position: 1
description: 通过脚手架, pip 安装驱动器
---
import Asciinema from "@site/src/components/Asciinema";
# 安装驱动器
NoneBot 在默认安装情况下内置了 `fastapi` 服务端驱动器,其他驱动器如 `httpx`, `aiohttp` 则需要额外安装。
@ -11,7 +13,7 @@ NoneBot 在默认安装情况下内置了 `fastapi` 服务端驱动器,其他
前往 [商店](/store) 即可查看所有驱动器。
或者使用 `nb-cli` 命令行查看
或者使用 `nb-cli` 命令行查看:
```bash
nb driver list
@ -21,13 +23,13 @@ nb driver list
前往 [商店](/store) 点击复制 `nb-cli` 安装命令至命令行执行即可安装。
或者自行输入命令安装
或者自行输入命令安装:
```bash
nb driver install <driver-name>
```
或者使用交互模式安装
或者使用交互模式安装:
```bash
nb driver install
@ -39,4 +41,7 @@ nb driver install
pip install <driver-name>
```
<!-- TODO: asciinema for install driver -->
<Asciinema
url="https://asciinema.org/a/464686.cast"
options={{ theme: "monokai", poster: "npt:2.8" }}
/>

View File

@ -3,13 +3,15 @@ sidebar_position: 3
description: 通过脚手架, pip 安装插件
---
import Asciinema from "@site/src/components/Asciinema";
# 安装第三方插件
## 查看
前往 [商店](/store) 即可查看所有发布的插件。
或者使用 `nb-cli` 命令行查看
或者使用 `nb-cli` 命令行查看:
```bash
nb plugin list
@ -19,13 +21,13 @@ nb plugin list
前往 [商店](/store) 点击复制 `nb-cli` 安装命令至命令行执行即可安装。
或者自行输入命令安装
或者自行输入命令安装:
```bash
nb plugin install <plugin-name>
```
或者使用交互模式安装
或者使用交互模式安装:
```bash
nb plugin install
@ -37,4 +39,7 @@ nb plugin install
pip install <plugin-name>
```
<!-- TODO: asciinema for install plugin -->
<Asciinema
url="https://asciinema.org/a/464735.cast"
options={{ theme: "monokai", poster: "npt:4.3" }}
/>

View File

@ -8,6 +8,8 @@ options:
category: guide
---
import Asciinema from "@site/src/components/Asciinema";
# 安装 NoneBot
:::warning 注意
@ -32,7 +34,10 @@ pip uninstall nonebot
pip install nb-cli
```
<!-- TODO: asciinema for installation -->
<Asciinema
url="https://asciinema.org/a/464654.cast"
options={{ theme: "monokai", poster: "npt:2.8" }}
/>
:::important 提示
`nb-cli` 的使用方法详见 [使用脚手架](./nb-cli.md)
@ -50,7 +55,7 @@ poetry add nonebot2
## 从 GitHub 安装
如果你需要使用最新的(可能**尚未发布**的)特性,可以直接从 GitHub 仓库安装
如果你需要使用最新的(可能**尚未发布**的)特性,可以直接从 GitHub 仓库安装:
:::warning 注意
直接从 Github 仓库中安装意味着你将使用最新提交的代码,它们并没有进行充分的稳定性测试
@ -65,7 +70,7 @@ poetry add git+https://github.com/nonebot/nonebot2.git#master
poetry add git+https://github.com/nonebot/nonebot2.git#dev
```
或者在克隆 Git 仓库后手动安装
或者在克隆 Git 仓库后手动安装:
```bash
git clone https://github.com/nonebot/nonebot2.git

View File

@ -8,14 +8,21 @@ options:
category: guide
---
import Asciinema from "@site/src/components/Asciinema";
# 创建项目
可以使用 `nb-cli` 或者自行创建完整的项目目录
可以使用 `nb-cli` 或者自行创建完整的项目目录:
```bash
nb create
```
<Asciinema
url="https://asciinema.org/a/464654.cast"
options={{ theme: "monokai", startAt: 4.5, poster: "npt:6.5" }}
/>
## 目录结构
```tree title=Project
@ -44,7 +51,7 @@ nb create
:::warning 提示
如果您使用如 `VSCode` / `PyCharm` 等 IDE 启动 nonebot请检查 IDE 当前工作空间目录是否与当前侧边栏打开目录一致。
> 注意在二者不一致的环境下可能导致 nonebot 读取配置文件和插件等不符合预期
> 注意: 在二者不一致的环境下可能导致 nonebot 读取配置文件和插件等不符合预期
:::
@ -56,6 +63,11 @@ nb create
其中 `--file` 参数可以指定 bot 入口文件,默认为 `bot.py``--app` 参数可以指定 asgi server默认为 `app`。
<Asciinema
url="https://asciinema.org/a/464654.cast"
options={{ theme: "monokai", startAt: 15.3, poster: "npt:20.3" }}
/>
2. 直接通过 `python` 启动
```bash