Skip to content
Open
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
58 changes: 58 additions & 0 deletions external_plugins/help-center-builder/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "help-center-builder",
"version": "0.1.0",
"description": "Turn a folder of Markdown / HTML docs into a static help center: home page with category cards, category pages, articles with breadcrumbs, sidebar, table of contents, related articles and previous / next, and instant full-text search that works offline (Chinese too). Incremental builds rewrite only the pages a change affects and list them with the reason. Broken links and anchors are reported. The output folder can be uploaded to any static host.",
"description_i18n": {
"en": "Turn a folder of Markdown / HTML docs into a static help center: home page with category cards, category pages, articles with breadcrumbs, sidebar, table of contents, related articles and previous / next, and instant full-text search that works offline (Chinese too). Incremental builds rewrite only the pages a change affects and list them with the reason. Broken links and anchors are reported. The output folder can be uploaded to any static host.",
"zh-CN": "把一个放 Markdown / HTML 文档的文件夹生成静态帮助中心:带分类卡片的首页、分类页,文章页有面包屑、侧边导航、目录、相关文章和上一篇 / 下一篇,还有离线可用的即时全文搜索(支持中文)。增量构建只重写受改动影响的页面,并列出原因;同时报告坏链和失效锚点。输出文件夹可直接上传到任意静态托管。"
},
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"keywords": [
"help center",
"knowledge base",
"documentation",
"static site",
"markdown",
"faq",
"search",
"support",
"帮助中心",
"知识库",
"文档站",
"常见问题"
],
"skills": "skills",
"mcpServers": {
"help-center-builder": {
"type": "stdio",
"command": "node",
"args": [
"${ZCODE_PLUGIN_ROOT}/dist/server.mjs"
],
"cwd": "${ZCODE_PROJECT_DIR}",
"timeoutMs": 900000,
"env": {
"ZCODE_WORKSPACE_ROOT": "${ZCODE_PROJECT_DIR}"
}
}
},
"ui": {
"surfaces": [
{
"id": "editor",
"title": {
"zh-CN": "帮助中心制作",
"en-US": "Help Center Builder"
},
"icon": "life-buoy",
"server": "help-center-builder",
"resourceUri": "ui://help-center-builder/panel.html",
"availability": "session"
}
]
}
}
21 changes: 21 additions & 0 deletions external_plugins/help-center-builder/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Penova

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
59 changes: 59 additions & 0 deletions external_plugins/help-center-builder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Help Center Builder

Turn a folder of **Markdown / HTML** docs into a **static help center** with category navigation, breadcrumbs, related articles and instant **full-text search** that works offline. When you edit docs, an **incremental build** rewrites only the pages the change affects and tells you why.

## What it does

- **Reads your docs**:
- Sub-folders become categories; files at the top level go to “General”.
- Front matter: `title`, `description`, `order`, `tags`, `related`, `updated`, `category`, `draft`. Without a title, a leading `#` / `##` / setext heading is used.
- An `index.md` in a folder becomes that category's intro; a top-level `index.md` becomes the home page's.
- HTML files (for example CMS exports) are supported: title, meta description and tags are read; navigation, scripts and inline handlers are removed.
- **Optional `help-center.json`** in the docs folder: `title`, `description`, `accent` colour, `logo`, `footer`, `baseUrl`, `lang`, and category names, descriptions and order.
- **Generates** `help-center/`:
- Home page with a search hero and category cards; category pages with article lists.
- Article pages: breadcrumbs, sidebar (the category's articles plus all categories), “On this page” table of contents, related articles (your `related` first, then shared tags and similar titles), and previous / next.
- Search page and 404 page; `sitemap.xml` and canonical links when `baseUrl` is set.
- Responsive, light and dark themes. English or Chinese interface, detected automatically.
- Images and other files are copied, and `.md` links are rewritten to `.html`.
- **Search**: built with [MiniSearch](https://github.com/lucaong/minisearch) at build time and shipped as a script.
- Works on any static host and straight from disk (`file://`), with no server or external service.
- Prefix and fuzzy matching; titles, tags and headings weigh more; Chinese / Japanese / Korean are split into characters and pairs.
- Live dropdown with keyboard navigation (`/` focuses the box), plus a results page.
- **Incremental builds**:
- Each page records what it depends on: its content, its category's article list, the categories, its related articles, previous / next, site settings and the template.
- Only pages whose dependencies changed are rewritten, each listed with the reason (for example “related articles changed”). Deleted articles are removed, and changed images re-copied.
- Use **Full rebuild** to rewrite everything.
- **Checks**: broken links to articles or files, missing `#anchors`, links outside the docs folder, two files producing the same page, missing or duplicate titles, empty articles, unknown `related`, drafts.

## Usage

Ask the agent in ZCode Desktop:

- "Build a help center from the docs folder"
- "I edited a few articles; update the help center"
- "Check the help docs for broken links"

Or use the panel: choose the docs folder, then **Build help center**; later, **Build changes**. Browse the site map and preview any page, and see which pages were rewritten and why. Open `help-center/index.html` in a browser, or upload the folder to a static host (Cloudflare Pages, Netlify, GitHub Pages, S3…).

## Tools

| Tool | Purpose |
|---|---|
| `hc_scan` | Categories, articles and problems in a docs folder (writes nothing) |
| `hc_build` | Build or update the site (incremental; `full` to rewrite everything) |

## Scope (v0.1)

- Hosting is up to you: the output is a plain static folder. Deploying it (for example to Cloudflare Pages) is a separate step.
- No feedback buttons, analytics, comments or login-protected articles (they need a backend).
- One language per site. Code blocks aren't syntax-highlighted. MDX, Liquid and other templating aren't run.

## Privacy, network and files

- Runs locally with no network access and no API keys. The generated site loads nothing from other servers.
- Reads the docs folder. Writes the output folder and `.help-center/builds.json`, and deletes only pages it wrote earlier.

## License

MIT. Uses [marked](https://github.com/markedjs/marked) (MIT), [MiniSearch](https://github.com/lucaong/minisearch) (MIT; also shipped in each generated site) and [yaml](https://github.com/eemeli/yaml) (ISC).
59 changes: 59 additions & 0 deletions external_plugins/help-center-builder/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 帮助中心制作

把一个放 **Markdown / HTML** 文档的文件夹生成 **静态帮助中心**:分类导航、面包屑、相关文章,以及离线可用的即时 **全文搜索**。改了文档后,**增量构建** 只重写受影响的页面,并告诉你原因。

## 功能

- **读取文档**:
- 子文件夹就是分类;放在根目录的文件归入“常规”。
- 支持 front matter:`title`、`description`、`order`、`tags`、`related`、`updated`、`category`、`draft`。没写标题时,用开头的 `#` / `##` / setext 标题。
- 文件夹里的 `index.md` 作为该分类的介绍;根目录的 `index.md` 作为首页介绍。
- 支持 HTML 文件(例如从 CMS 导出的):读取标题、meta 描述和标签,去掉导航、脚本和内联事件。
- **可选的 `help-center.json`**(放在文档目录里):`title`、`description`、主题色 `accent`、`logo`、`footer`、`baseUrl`、`lang`,以及分类名称、说明和顺序。
- **生成** `help-center/`:
- 首页:搜索大框加分类卡片;分类页:文章列表。
- 文章页:面包屑、侧边栏(本分类文章加全部分类)、“本页内容”目录、相关文章(先用你写的 `related`,再按共同标签和相近标题补足)、上一篇 / 下一篇。
- 搜索页和 404 页;设置了 `baseUrl` 时生成 `sitemap.xml` 和 canonical 链接。
- 响应式布局,支持浅色 / 深色主题;界面中英文自动识别。
- 图片等文件原样复制,`.md` 链接改写成 `.html`。
- **搜索**:构建时用 [MiniSearch](https://github.com/lucaong/minisearch) 生成索引,以脚本形式随站点发布。
- 任何静态托管都能用,直接双击打开(`file://`)也能用,不需要服务器或外部服务。
- 支持前缀和模糊匹配;标题、标签、小标题权重更高;中日韩文字按单字和双字切分。
- 输入时实时下拉,可用键盘选择(按 `/` 聚焦搜索框);另有搜索结果页。
- **增量构建**:
- 每个页面记录它依赖的内容:正文、同分类文章列表、分类列表、相关文章、上一篇 / 下一篇、站点设置、模板。
- 只重写依赖有变化的页面,并逐页列出原因(例如“相关文章变了”)。删掉的文章会被移除,改过的图片会重新复制。
- 点“全量重建”可重写全部页面。
- **检查**:指向文章或文件的坏链、失效的 `#锚点`、指向文档目录外的链接、两个文件生成同一个页面、缺失或重复的标题、空文章、无效的 `related`、草稿。

## 使用

在 ZCode Desktop 里对 Agent 说:

- “用 docs 文件夹生成帮助中心”
- “我改了几篇文章,更新一下帮助中心”
- “检查帮助文档里有没有坏链”

也可以用面板:选择文档目录 → **生成帮助中心**;以后改了文档点 **增量构建**。面板里能浏览站点结构、预览任意页面,并查看哪些页面被重写及原因。用浏览器打开 `help-center/index.html`,或把整个文件夹上传到静态托管(Cloudflare Pages、Netlify、GitHub Pages、S3 等)。

## 工具

| 工具 | 用途 |
|---|---|
| `hc_scan` | 查看文档目录的分类、文章和问题(不写文件) |
| `hc_build` | 生成或更新站点(默认增量,`full` 为全量重建) |

## 范围(v0.1)

- 托管由你决定:输出是普通的静态文件夹,部署(例如到 Cloudflare Pages)是另外一步。
- 不含“是否有帮助”反馈、统计、评论、需要登录的文章(这些需要后端)。
- 一个站点一种语言;代码块不做语法高亮;不执行 MDX、Liquid 等模板语法。

## 隐私、网络与文件

- 在本地运行,不联网,不需要 API Key。生成的站点不从其他服务器加载任何东西。
- 读取文档目录;写入输出目录和 `.help-center/builds.json`;只删除自己以前生成的页面。

## 许可

MIT。使用 [marked](https://github.com/markedjs/marked)(MIT)、[MiniSearch](https://github.com/lucaong/minisearch)(MIT,也随每个生成的站点发布)和 [yaml](https://github.com/eemeli/yaml)(ISC)。
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: help-center-builder
description: 把 Markdown / HTML 文档文件夹生成静态帮助中心(分类导航、全文搜索、面包屑、目录、相关文章),支持增量构建(只重写受影响的页面并列出原因)和坏链检查。用户提到“帮助中心 / 知识库 / 文档站 / FAQ 网站 / 把这些文档做成网站”时使用。
---

# 帮助中心制作

1. 找到文档目录(通常是 docs/、help/、articles/)。先用 `hc_scan({docs})` 看分类、文章数和问题,把坏链、失效锚点、缺标题这类问题告诉用户。
2. 如果用户想定站点名称、主题色、分类顺序或说明,在文档目录里写 `help-center.json`:`{ "title", "description", "accent": "#rrggbb", "baseUrl", "footer", "categories": [{ "folder", "name", "description" }] }`。单篇文章的标题、排序、标签、相关文章写在 front matter 里(`title`、`order`、`tags`、`related`)。
3. 用 `hc_build({docs, out?})` 生成(默认输出到 help-center/)。之后用户改了文档,再调用一次就是增量构建:只重写受影响的页面,返回结果里有每个页面被重写的原因,挑重点告诉用户。改了模板或想全部重新生成时加 `full: true`。
4. 告诉用户怎么看:用浏览器打开 `help-center/index.html`(离线可用,搜索也能用);要上线的话,把整个文件夹上传到静态托管(Cloudflare Pages、Netlify、GitHub Pages 等)。设置了 `baseUrl` 才会生成 sitemap.xml 和 canonical 链接。
5. 不在范围内的需求直接说明:反馈按钮、统计、评论、需要登录才能看的文章(需要后端)、多语言切换、代码高亮。
50 changes: 50 additions & 0 deletions marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,56 @@
"把上一个 Hi3D 任务生成的模型按角色拆分成部件"
]
}
},
{
"name": "help-center-builder",
"componentTypes": [
"ui"
],
"source": "./external_plugins/help-center-builder",
"displayName": "Help Center Builder",
"displayName_i18n": {
"en": "Help Center Builder",
"zh-CN": "帮助中心制作"
},
"description": "Turn a folder of Markdown / HTML docs into a static help center: home page with category cards, category pages, articles with breadcrumbs, sidebar, table of contents, related articles and previous / next, and instant full-text search that works offline (Chinese too). Incremental builds rewrite only the pages a change affects and list them with the reason. Broken links and anchors are reported. The output folder can be uploaded to any static host.",
"description_i18n": {
"en": "Turn a folder of Markdown / HTML docs into a static help center: home page with category cards, category pages, articles with breadcrumbs, sidebar, table of contents, related articles and previous / next, and instant full-text search that works offline (Chinese too). Incremental builds rewrite only the pages a change affects and list them with the reason. Broken links and anchors are reported. The output folder can be uploaded to any static host.",
"zh-CN": "把一个放 Markdown / HTML 文档的文件夹生成静态帮助中心:带分类卡片的首页、分类页,文章页有面包屑、侧边导航、目录、相关文章和上一篇 / 下一篇,还有离线可用的即时全文搜索(支持中文)。增量构建只重写受改动影响的页面,并列出原因;同时报告坏链和失效锚点。输出文件夹可直接上传到任意静态托管。"
},
"version": "0.1.0",
"author": {
"name": "Penova",
"url": "https://github.com/ppppp2005-p"
},
"license": "MIT",
"category": "productivity",
"keywords": [
"help center",
"knowledge base",
"documentation",
"static site",
"markdown",
"faq",
"search",
"support",
"帮助中心",
"知识库",
"文档站",
"常见问题"
],
"examplePrompts": [
"Build a help center from the docs folder",
"I edited a few articles; update the help center",
"Check the help docs for broken links"
],
"examplePrompts_i18n": {
"zh-CN": [
"用 docs 文件夹生成帮助中心",
"我改了几篇文章,更新一下帮助中心",
"检查帮助文档里有没有坏链"
]
}
}
]
}
Loading