📝 write start docs

This commit is contained in:
yanyongyu
2021-12-24 19:02:11 +08:00
parent 6ed87f1910
commit 75e2ca77df
9 changed files with 1496 additions and 1335 deletions

View File

@ -1,12 +1,7 @@
---
sidebar_position: 1
sidebar_position: 0
id: index
slug: /guide
options:
menu:
weight: 10
category: guide
---
# 概览

View File

@ -0,0 +1,4 @@
{
"position": 1,
"label": "开始"
}

View File

@ -1,18 +1,17 @@
---
sidebar_position: 2
sidebar_position: 0
description: 通过脚手架, PyPI, GitHub 安装 NoneBot
options:
menu:
weight: 20
weight: 10
category: guide
---
# 安装
## 安装 NoneBot
# 安装 NoneBot
:::warning 注意
请确保你的 Python 版本 >= 3.7。
请确保你的 Python 版本 >= 3.7.3
:::
:::warning 注意
@ -24,28 +23,20 @@ pip uninstall nonebot
:::
### (推荐安装方式)通过脚手架安装
## 通过脚手架安装 (推荐)
1. (推荐)使用你喜欢的 Python 环境管理工具(如 `poetry`)创建新的虚拟环境
1. (可选) 使用你喜欢的 Python 环境管理工具 (如 `poetry`, `venv`, `conda` 等) 创建新的虚拟环境
2. 使用 `pip` 或 其他包管理工具 安装 `nb-cli``nonebot2` 会作为其依赖被一起安装
```bash
pip install nb-cli
```
3. 点个 star 吧
<!-- asciinema for installation -->
nonebot2: [![nonebot2](https://img.shields.io/github/stars/nonebot/nonebot2?style=social)](https://github.com/nonebot/nonebot2)
## 不使用脚手架 (纯净安装)
nb-cli: [![nb-cli](https://img.shields.io/github/stars/nonebot/nb-cli?style=social)](https://github.com/nonebot/nb-cli)
4. 如果有疑问,可以加群交流(点击链接直达)
[![QQ Chat](https://img.shields.io/badge/QQ%E7%BE%A4-768887710-orange?style=social)](https://jq.qq.com/?_wv=1027&k=5OFifDh)
[![Telegram Chat](https://img.shields.io/badge/telegram-cqhttp-blue?style=social)](https://t.me/cqhttp)
### (纯净安装)不使用脚手架
如果你不想使用脚手架,可以直接安装 `nonebot2`,并自行完成开发配置。
```bash
pip install nonebot2
@ -53,14 +44,17 @@ pip install nonebot2
poetry add nonebot2
```
## 从 GitHub 安装
如果你需要使用最新的(可能**尚未发布**的)特性,可以直接从 GitHub 仓库安装:
:::warning 注意
直接从 Github 仓库中安装意味着你将使用最新提交的代码,它们并没有进行充分的稳定性测试
在任何情况下请不要将其应用于生产环境!
:::
```bash
```bash title="Install From Github"
# master分支
poetry add git+https://github.com/nonebot/nonebot2.git#master
# dev分支
@ -76,7 +70,7 @@ poetry install --no-dev # 推荐
pip install . # 不推荐
```
## 安装适配器
<!-- ## 安装适配器
适配器可以通过 `nb-cli` 在创建项目时根据你的选择自动安装,也可以自行使用 `pip` 安装
@ -121,4 +115,4 @@ nb plugin install <plugin-name>
NoneBot v2 全程使用 `VSCode` 搭配 `Pylance` 的开发环境进行开发在严格的类型检查下NoneBot v2 具有完善的类型设计与声明。
在围绕 NoneBot v2 进行开发时,使用 `VSCode` 搭配 `Pylance` 进行类型检查是非常推荐的。这有利于统一代码风格及避免低级错误的发生。
在围绕 NoneBot v2 进行开发时,使用 `VSCode` 搭配 `Pylance` 进行类型检查是非常推荐的。这有利于统一代码风格及避免低级错误的发生。 -->

View File

@ -0,0 +1,11 @@
---
sidebar_position: 1
description: 使用 nb-cli 帮助开发
options:
menu:
weight: 11
category: guide
---
# 使用脚手架

View File

@ -0,0 +1,26 @@
---
---
# 遇到问题
如果在安装或者开发过程中遇到了任何问题,可以通过以下方式解决:
1. 点击下方链接前往 GitHub ~~点击 star~~ ,前往 Issues 页面,在 `New Issue` Template 中选择 `Question`
[![nonebot2](https://img.shields.io/github/stars/nonebot/nonebot2?style=social)](https://github.com/nonebot/nonebot2)
2. 通过 QQ 群 (点击下方链接直达)
[![QQ Chat](https://img.shields.io/badge/QQ%E7%BE%A4-768887710-orange?style=social)](https://jq.qq.com/?_wv=1027&k=5OFifDh)
3. 通过 QQ 频道
前往 QQ 频道搜索 `NoneBot` 点击加入
4. 通过 Telegram 群 (点击下方链接直达)
[![Telegram Chat](https://img.shields.io/badge/telegram-cqhttp-blue?style=social)](https://t.me/cqhttp)
5. 通过 Discord 服务器 (点击下方链接直达)
[![Discord Server](https://discordapp.com/api/guilds/847819937858584596/widget.png?style=shield)](https://discord.gg/VKtE6Gdc4h)