From 2684098be19ae8c68dbc6a7c83911183cb00d2a4 Mon Sep 17 00:00:00 2001 From: fujie Date: Tue, 6 Jan 2026 22:57:17 +0800 Subject: [PATCH] docs: update doc standards & reformat infographic readme; feat: default image mode --- .agent/workflows/plugin-development.md | 4 +- .github/copilot-instructions.md | 73 ++++++++++--------- docs/plugins/actions/smart-infographic.md | 2 +- docs/plugins/actions/smart-infographic.zh.md | 2 +- plugins/actions/infographic/README.md | 50 +++++-------- plugins/actions/infographic/README_CN.md | 50 +++++-------- plugins/actions/infographic/infographic.py | 4 +- plugins/actions/infographic/infographic_cn.py | 4 +- 8 files changed, 83 insertions(+), 106 deletions(-) diff --git a/.agent/workflows/plugin-development.md b/.agent/workflows/plugin-development.md index ce3a786..4e23e01 100644 --- a/.agent/workflows/plugin-development.md +++ b/.agent/workflows/plugin-development.md @@ -39,8 +39,8 @@ Every plugin **MUST** have bilingual versions for both code and documentation: When adding or updating a plugin, you **MUST** update the following documentation files to maintain consistency: ### Plugin Directory -- `README.md`: Update version, description, and usage. **Explicitly describe new features.** -- `README_CN.md`: Update version, description, and usage. **Explicitly describe new features.** +- `README.md`: Update version, description, and usage. **Explicitly describe new features in a prominent position at the beginning.** +- `README_CN.md`: Update version, description, and usage. **Explicitly describe new features in a prominent position at the beginning.** ### Global Documentation (`docs/`) - **Index Pages**: diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 0990bb2..fa0b4e5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -31,15 +31,42 @@ plugins/actions/export_to_docx/ - `README.md` - English documentation - `README_CN.md` - 中文文档 -README 文件应包含以下内容: -- 功能描述 / Feature description -- 配置参数及默认值 / Configuration parameters with defaults -- 安装和设置说明 / Installation and setup instructions -- 使用示例 / Usage examples -- 故障排除指南 / Troubleshooting guide -- 故障排除指南 / Troubleshooting guide -- 版本和作者信息 / Version and author information -- **新增功能 / New Features**: 如果是更新现有插件,必须明确列出并描述新增功能(发布到官方市场的重要要求)。/ If updating an existing plugin, explicitly list and describe new features (Critical for official market release). +### README 结构规范 (README Structure Standard) + +所有插件 README 必须遵循以下统一结构顺序: + +1. **标题 (Title)**: 插件名称 +2. **元数据 (Metadata)**: 作者、版本、许可证、项目链接 (一行显示) + - 格式: `**Author:** [Name](Link) | **Version:** x.x.x | **Project:** [Link](Link)` +3. **描述 (Description)**: 简短的功能介绍 +4. **最新更新 (What's New)**: **必须**放在描述之后,显著展示最新版本的变更点 +5. **核心特性 (Key Features)** +6. **使用方法 (Usage)** +7. **配置参数 (Configuration/Valves)** +8. **其他 (Others)**: 故障排除、示例等 + +示例 (Example): + +```markdown +# 📊 Smart Plugin + +**Author:** [Fu-Jie](https://github.com/Fu-Jie) | **Version:** 1.0.0 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) + +A powerful plugin for OpenWebUI. + +## 🔥 What's New in v1.0.0 + +- Feature A +- Feature B + +## ✨ Features +... +``` + +### 文档内容要求 (Content Requirements) + +- **新增功能**: 必须在 "What's New" 章节中明确列出。 +- **双语**: 必须提供 `README.md` (英文) 和 `README_CN.md` (中文)。 ### 官方文档 (Official Documentation) @@ -93,33 +120,7 @@ icon_url: data:image/svg+xml;base64,PHN2ZyB4bWxucz0i...(完整的 Base64 编 --- -## 👤 作者和许可证信息 (Author and License) - -所有 README 文件和主要文档必须包含以下统一信息: - -```markdown -## Author - -Fu-Jie -GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui) - -## License - -MIT License -``` - -中文版本: - -```markdown -## 作者 - -Fu-Jie -GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui) - -## 许可证 - -MIT License -``` +(Author info is now part of the top metadata section, see "README Structure Standard" above) --- diff --git a/docs/plugins/actions/smart-infographic.md b/docs/plugins/actions/smart-infographic.md index 031b96d..cfedff8 100644 --- a/docs/plugins/actions/smart-infographic.md +++ b/docs/plugins/actions/smart-infographic.md @@ -62,7 +62,7 @@ The Smart Infographic plugin uses AI to analyze text content and generate profes | `MIN_TEXT_LENGTH` | integer | `100` | Minimum characters required to trigger analysis | | `CLEAR_PREVIOUS_HTML` | boolean | `false` | Whether to clear previous charts | | `MESSAGE_COUNT` | integer | `1` | Number of recent messages to use for analysis | -| `OUTPUT_MODE` | string | `html` | `html` for interactive chart (default), `image` for static image embedding | +| `OUTPUT_MODE` | string | `image` | `image` for static image embedding (default), `html` for interactive chart | --- diff --git a/docs/plugins/actions/smart-infographic.zh.md b/docs/plugins/actions/smart-infographic.zh.md index c96159a..26b702a 100644 --- a/docs/plugins/actions/smart-infographic.zh.md +++ b/docs/plugins/actions/smart-infographic.zh.md @@ -62,7 +62,7 @@ Smart Infographic 使用 AI 分析文本,并基于 AntV 可视化引擎生成 | `MIN_TEXT_LENGTH` | integer | `100` | 触发分析的最小字符数 | | `CLEAR_PREVIOUS_HTML` | boolean | `false` | 是否清空之前生成的图表 | | `MESSAGE_COUNT` | integer | `1` | 参与分析的最近消息条数 | -| `OUTPUT_MODE` | string | `html` | `html` 为交互式图表(默认),`image` 为静态图片嵌入 | +| `OUTPUT_MODE` | string | `image` | `image` 为静态图片嵌入(默认),`html` 为交互式图表 | --- diff --git a/plugins/actions/infographic/README.md b/plugins/actions/infographic/README.md index fdd8d9a..a03cf59 100644 --- a/plugins/actions/infographic/README.md +++ b/plugins/actions/infographic/README.md @@ -1,7 +1,16 @@ # 📊 Smart Infographic (AntV) +**Author:** [jeff](https://github.com/Fu-Jie) | **Version:** 1.4.0 | **Project:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) + An Open WebUI plugin powered by the AntV Infographic engine. It transforms long text into professional, beautiful infographics with a single click. +## 🔥 What's New in v1.4.0 + +- ✨ **Default Mode Change**: Default output mode is now `image` (static image) for better compatibility and cleaner chat history. +- ✨ **New Image Output Mode**: Support embedding infographics as static images (SVG). +- 📱 **Responsive Sizing**: Images now auto-adapt to the chat container width. +- 🔧 **New Configuration**: `OUTPUT_MODE` valve to control output format. + ## ✨ Key Features - 🚀 **AI-Powered Transformation**: Automatically analyzes text logic, extracts key points, and generates structured charts. @@ -11,15 +20,6 @@ An Open WebUI plugin powered by the AntV Infographic engine. It transforms long - 🌈 **Highly Customizable**: Supports Dark/Light modes, auto-adapts theme colors, with bold titles and refined card layouts. - 📱 **Responsive Design**: Generated charts look great on both desktop and mobile devices. -## 🛠️ Supported Template Types - -| Category | Template Name | Use Case | -| :--- | :--- | :--- | -| **Lists & Hierarchy** | `list-grid`, `tree-vertical`, `mindmap` | Features, Org Charts, Brainstorming | -| **Sequence & Relation** | `sequence-roadmap`, `relation-circle` | Roadmaps, Circular Flows, Steps | -| **Comparison & Analysis** | `compare-binary`, `compare-swot`, `quadrant-quarter` | Pros/Cons, SWOT, Quadrants | -| **Charts & Data** | `chart-bar`, `chart-line`, `chart-pie` | Trends, Distributions, Metrics | - ## 🚀 How to Use 1. **Install**: Search for "Smart Infographic" in the Open WebUI Community and install. @@ -38,7 +38,16 @@ You can adjust the following parameters in the plugin settings to optimize the g | **Min Text Length (MIN_TEXT_LENGTH)** | `100` | Minimum characters required to trigger analysis, preventing accidental triggers on short text. | | **Clear Previous (CLEAR_PREVIOUS_HTML)** | `False` | Whether to clear previous charts. If `False`, new charts will be appended below. | | **Message Count (MESSAGE_COUNT)** | `1` | Number of recent messages to use for analysis. Increase this for more context. | -| **Output Mode (OUTPUT_MODE)** | `html` | `html` for interactive chart (default), `image` for static image embedding (useful for mobile/non-html clients). | +| **Output Mode (OUTPUT_MODE)** | `image` | `image` for static image embedding (default, better compatibility), `html` for interactive chart. | + +## 🛠️ Supported Template Types + +| Category | Template Name | Use Case | +| :--- | :--- | :--- | +| **Lists & Hierarchy** | `list-grid`, `tree-vertical`, `mindmap` | Features, Org Charts, Brainstorming | +| **Sequence & Relation** | `sequence-roadmap`, `relation-circle` | Roadmaps, Circular Flows, Steps | +| **Comparison & Analysis** | `compare-binary`, `compare-swot`, `quadrant-quarter` | Pros/Cons, SWOT, Quadrants | +| **Charts & Data** | `chart-bar`, `chart-line`, `chart-pie` | Trends, Distributions, Metrics | ## 📝 Syntax Example (For Advanced Users) @@ -55,24 +64,3 @@ data - label Beautiful Design desc Uses AntV professional design standards ``` - -## 👨‍💻 Author - -**jeff** -- GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui) - -## 📄 License - -MIT License - -## Changelog - -### v1.4.0 - -- ✨ Added **Image Output Mode**: Support embedding infographics as static images (SVG) for better compatibility. -- 📱 Added **Responsive Sizing**: Images now auto-adapt to the chat container width. -- 🔧 Added `OUTPUT_MODE` valve configuration. - -### v1.3.2 - -- Removed debug messages from output diff --git a/plugins/actions/infographic/README_CN.md b/plugins/actions/infographic/README_CN.md index 9160bae..c47f89d 100644 --- a/plugins/actions/infographic/README_CN.md +++ b/plugins/actions/infographic/README_CN.md @@ -1,7 +1,16 @@ # 📊 智能信息图 (AntV Infographic) +**作者:** [jeff](https://github.com/Fu-Jie) | **版本:** 1.4.0 | **项目:** [Awesome OpenWebUI](https://github.com/Fu-Jie/awesome-openwebui) + 基于 AntV Infographic 引擎的 Open WebUI 插件,能够将长文本内容一键转换为专业、美观的信息图表。 +## 🔥 v1.4.0 更新日志 + +- ✨ **默认模式变更**:默认输出模式调整为 `image`(静态图片),以获得更好的兼容性和更简洁的聊天记录。 +- ✨ **新增图片输出模式**:支持将信息图作为静态图片 (SVG) 嵌入。 +- 📱 **响应式尺寸**:图片模式下自动适应聊天容器宽度。 +- 🔧 **新增配置项**:`OUTPUT_MODE` 用于控制输出格式。 + ## ✨ 核心特性 - 🚀 **智能转换**:自动分析文本核心逻辑,提取关键点并生成结构化图表。 @@ -11,15 +20,6 @@ - 🌈 **高度自定义**:支持深色/浅色模式,自动适配主题颜色,主标题加粗突出,卡片布局精美。 - 📱 **响应式设计**:生成的图表在桌面端和移动端均有良好的展示效果。 -## 🛠️ 支持的模板类型 - -| 分类 | 模板名称 | 适用场景 | -| :--- | :--- | :--- | -| **列表与层级** | `list-grid`, `tree-vertical`, `mindmap` | 功能亮点、组织架构、思维导图 | -| **顺序与关系** | `sequence-roadmap`, `relation-circle` | 发展历程、循环关系、步骤说明 | -| **对比与分析** | `compare-binary`, `compare-swot`, `quadrant-quarter` | 优劣势对比、SWOT 分析、象限图 | -| **图表与数据** | `chart-bar`, `chart-line`, `chart-pie` | 数据趋势、比例分布、数值对比 | - ## 🚀 使用方法 1. **安装插件**:在 Open WebUI 插件市场搜索并安装。 @@ -38,7 +38,16 @@ | **最小文本长度 (MIN_TEXT_LENGTH)** | `100` | 触发分析所需的最小字符数,防止对过短的对话误操作。 | | **清除旧结果 (CLEAR_PREVIOUS_HTML)** | `False` | 每次生成是否清除之前的图表。若为 `False`,新图表将追加在下方。 | | **上下文消息数 (MESSAGE_COUNT)** | `1` | 用于分析的最近消息条数。增加此值可让 AI 参考更多对话背景。 | -| **输出模式 (OUTPUT_MODE)** | `html` | `html` 为交互式图表(默认),`image` 为静态图片嵌入(适合移动端或不支持 HTML 的客户端)。 | +| **输出模式 (OUTPUT_MODE)** | `image` | `image` 为静态图片嵌入(默认,兼容性好),`html` 为交互式图表。 | + +## 🛠️ 支持的模板类型 + +| 分类 | 模板名称 | 适用场景 | +| :--- | :--- | :--- | +| **列表与层级** | `list-grid`, `tree-vertical`, `mindmap` | 功能亮点、组织架构、思维导图 | +| **顺序与关系** | `sequence-roadmap`, `relation-circle` | 发展历程、循环关系、步骤说明 | +| **对比与分析** | `compare-binary`, `compare-swot`, `quadrant-quarter` | 优劣势对比、SWOT 分析、象限图 | +| **图表与数据** | `chart-bar`, `chart-line`, `chart-pie` | 数据趋势、比例分布、数值对比 | ## 📝 语法示例 (高级用户) @@ -55,24 +64,3 @@ data - label 视觉精美 desc 采用 AntV 专业设计规范 ``` - -## 👨‍💻 作者 - -**jeff** -- GitHub: [Fu-Jie/awesome-openwebui](https://github.com/Fu-Jie/awesome-openwebui) - -## 📄 许可证 - -MIT License - -## 更新日志 - -### v1.4.0 - -- ✨ 新增 **图片输出模式**:支持将信息图作为静态图片 (SVG) 嵌入,兼容性更好。 -- 📱 新增 **响应式尺寸**:图片模式下自动适应聊天容器宽度。 -- 🔧 新增 `OUTPUT_MODE` 配置项。 - -### v1.3.2 - -- 移除输出中的调试信息 diff --git a/plugins/actions/infographic/infographic.py b/plugins/actions/infographic/infographic.py index b8896d6..083c18b 100644 --- a/plugins/actions/infographic/infographic.py +++ b/plugins/actions/infographic/infographic.py @@ -822,8 +822,8 @@ class Action: description="Number of recent messages to use for generation. Set to 1 for just the last message, or higher for more context.", ) OUTPUT_MODE: str = Field( - default="html", - description="Output mode: 'html' for interactive HTML (default), or 'image' to embed as Markdown image.", + default="image", + description="Output mode: 'html' for interactive HTML, or 'image' to embed as Markdown image (default).", ) def __init__(self): diff --git a/plugins/actions/infographic/infographic_cn.py b/plugins/actions/infographic/infographic_cn.py index 1854708..50f5fbe 100644 --- a/plugins/actions/infographic/infographic_cn.py +++ b/plugins/actions/infographic/infographic_cn.py @@ -850,8 +850,8 @@ class Action: description="用于生成的最近消息数量。设置为1仅使用最后一条消息,更大值可包含更多上下文。", ) OUTPUT_MODE: str = Field( - default="html", - description="输出模式:'html' 为交互式HTML(默认),'image' 将嵌入为Markdown图片。", + default="image", + description="输出模式:'html' 为交互式HTML,'image' 将嵌入为Markdown图片(默认)。", ) def __init__(self):