From 6d3548120997fed5eba76b943e5852d5396fc70f Mon Sep 17 00:00:00 2001 From: StarHeart Date: Tue, 17 Jun 2025 17:03:06 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20Docs:=20=E6=8F=92=E4=BB=B6=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E8=A1=A8=E5=8D=95=E6=8F=8F=E8=BF=B0=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20(#3520)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/adapter_publish.yml | 7 +++++++ .github/ISSUE_TEMPLATE/bot_publish.yml | 7 +++++++ .github/ISSUE_TEMPLATE/plugin_publish.yml | 14 ++++++++++--- website/src/components/Form/Plugin.tsx | 24 ++++++++++++++++++++-- website/src/components/Form/index.tsx | 6 +++++- 5 files changed, 52 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/adapter_publish.yml b/.github/ISSUE_TEMPLATE/adapter_publish.yml index 759d138c..a9181623 100644 --- a/.github/ISSUE_TEMPLATE/adapter_publish.yml +++ b/.github/ISSUE_TEMPLATE/adapter_publish.yml @@ -3,6 +3,13 @@ title: "Adapter: {name}" description: 发布适配器到 NoneBot 官方商店 labels: ["Adapter", "Publish"] body: + - type: markdown + attributes: + value: | + # 发布须知 + + 非特殊情况下,请通过 [NoneBot 适配器商店](https://nonebot.dev/store/adapters) 的发布表单进行插件发布信息填写。 + - type: input id: name attributes: diff --git a/.github/ISSUE_TEMPLATE/bot_publish.yml b/.github/ISSUE_TEMPLATE/bot_publish.yml index 14ae7513..fdd4de66 100644 --- a/.github/ISSUE_TEMPLATE/bot_publish.yml +++ b/.github/ISSUE_TEMPLATE/bot_publish.yml @@ -3,6 +3,13 @@ title: "Bot: {name}" description: 发布机器人到 NoneBot 官方商店 labels: ["Bot", "Publish"] body: + - type: markdown + attributes: + value: | + # 发布须知 + + 非特殊情况下,请通过 [NoneBot 机器人商店](https://nonebot.dev/store/bots) 的发布表单进行插件发布信息填写。 + - type: input id: name attributes: diff --git a/.github/ISSUE_TEMPLATE/plugin_publish.yml b/.github/ISSUE_TEMPLATE/plugin_publish.yml index b1a2f13f..0b2f8d25 100644 --- a/.github/ISSUE_TEMPLATE/plugin_publish.yml +++ b/.github/ISSUE_TEMPLATE/plugin_publish.yml @@ -3,6 +3,14 @@ title: "Plugin: {name}" description: 发布插件到 NoneBot 官方商店 labels: ["Plugin", "Publish"] body: + - type: markdown + attributes: + value: | + # 发布须知 + + 非特殊情况下,请通过 [NoneBot 插件商店](https://nonebot.dev/store/plugins) 的发布表单进行插件发布信息填写。 + 在发布前请阅读 [NoneBot 插件发布流程指导](https://nonebot.dev/docs/developer/plugin-publishing) 并确保满足其中所述条件。 + - type: input id: pypi attributes: @@ -15,9 +23,9 @@ body: - type: input id: module attributes: - label: 插件 import 包名 - description: 插件 import 包名 - placeholder: e.g. nonebot_plugin_xxx + label: 插件模块名 + description: 加载插件时所使用的模块名称 + placeholder: e.g. nonebot_plugin_apscheduler validations: required: true diff --git a/website/src/components/Form/Plugin.tsx b/website/src/components/Form/Plugin.tsx index 068c975a..33e6b653 100644 --- a/website/src/components/Form/Plugin.tsx +++ b/website/src/components/Form/Plugin.tsx @@ -1,5 +1,7 @@ import React from "react"; +import Link from "@docusaurus/Link"; + import { Form } from "."; export default function PluginForm(): React.ReactNode { @@ -8,7 +10,7 @@ export default function PluginForm(): React.ReactNode { name: "包信息", items: [ { type: "text", name: "pypi", labelText: "PyPI 项目名" }, - { type: "text", name: "module", labelText: "插件 import 包名" }, + { type: "text", name: "module", labelText: "插件模块名" }, ], }, { @@ -29,7 +31,25 @@ export default function PluginForm(): React.ReactNode { ); }; + const description = ( +

+ 请在发布前阅读{" "} + + NoneBot 插件发布流程指导 + + ,并确保满足其中所述条件。 +

+ ); + return ( -
+ ); } diff --git a/website/src/components/Form/index.tsx b/website/src/components/Form/index.tsx index cda5e498..8d56e27f 100644 --- a/website/src/components/Form/index.tsx +++ b/website/src/components/Form/index.tsx @@ -24,6 +24,7 @@ export type FormItemGroup = { export type Props = { children?: React.ReactNode; + description?: React.ReactNode; type: Resource["resourceType"]; formItems: FormItemGroup[]; handleSubmit: (result: Record) => void; @@ -32,6 +33,7 @@ export type Props = { export function Form({ type, children, + description, formItems, handleSubmit, }: Props): React.ReactNode { @@ -65,7 +67,6 @@ export function Form({ ); if (currentStepNames.every((name) => result[name])) { setCurrentStep(currentStep + 1); - } else { } }; const onPrev = () => currentStep > 0 && setCurrentStep(currentStep - 1); @@ -86,6 +87,9 @@ export function Form({ ))} + {description && currentStep === 0 && ( +
{description}
+ )}
{children || formItems[currentStep].items.map((item) => (