Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 添加Bison流程图 #280

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import { defineUserConfig, defaultTheme } from "vuepress";
import { mdEnhancePlugin } from "vuepress-plugin-md-enhance";

export default defineUserConfig({
lang: "zh-CN",
title: "Nonebot Bison",
description: "Docs for Nonebot Bison",
plugins: [
mdEnhancePlugin({
mermaid: true,
}),
],
theme: defaultTheme({
navbar: [
{ text: "主页", link: "/" },
Expand Down
31 changes: 31 additions & 0 deletions docs/dev/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
sidebar: auto
next: /dev/workflow
---

# 基本开发须知
Expand Down Expand Up @@ -257,3 +258,33 @@ CustomPost 的可选参数及作用与上文中的[Post](#什么是nonebot-bison
```

:::

## Bison 的工作流程

```mermaid
flowchart TB
init[初始化] --> schedule_pool[调度池]

schedule_pool((调度池)) --> choose_platform[选择Platform]
choose_platform --> get_targets[获取Target列表]
get_targets --> get_rawposts[获取Target的RawPost列表]
get_rawposts --> compare_with_old[(与上次状态对比)]

compare_with_old -- 有新增 --> dispatch[分发到对应用户]
compare_with_old -- 无新增 --> schedule_pool

dispatch --> user_filter[用户订阅过滤]

user_filter -- 不匹配 --> schedule_pool
user_filter -- 匹配 --> parse[选择Post解析方式]

parse -.-> to_text((文本Post))
parse -.-> to_pic((图片Post))
parse -.-> to_other((...))

to_text -.-> message_render[消息渲染]
to_pic -.-> message_render
to_other -.-> message_render

message_render --> send_to[发送到对应用户]
```
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
"license": "MIT",
"private": false,
"devDependencies": {
"@vuepress/client": "2.0.0-beta.60",
"vue": "^3.2.45",
"vuepress": "2.0.0-beta.60"
"@vuepress/client": "2.0.0-beta.66",
"vue": "^3.3.4",
"vuepress": "2.0.0-beta.66",
"vuepress-plugin-md-enhance": "2.0.0-beta.233"
},
"scripts": {
"docs:dev": "vuepress dev docs",
Expand Down
Loading