Repository navigation
feat(ui-plugins): add Help Center Builder (help-center-builder) - #248
Open
ppppp2005-p wants to merge 11 commits into
Open
ppppp2005-p wants to merge 11 commits into
ppppp2005-p wants to merge 11 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) help-center-builder-demo.mp4Flow shown:
演示流程:本地 marketplace 安装 → |
Collaborator
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
help-center-builder(UI Plugin, new)What / 改动内容
New community UI plugin Help Center Builder / 帮助中心制作: a folder of Markdown / HTML docs becomes a static help center with category navigation, breadcrumbs, a table of contents, related articles and offline full-text search (CJK too). Incremental builds rewrite only the affected pages and list them with the reason.
Tools:
hc_scan(read-only),hc_build.hc_preview,hc_state.How it works:
src/docs.ts):yaml; Markdown viamarked(GFM, tables wrapped).#/##/ setext heading, else the file name (with a warning).<main>/<article>/<body>, minus nav, header, footer and the first h1; meta description and tags are read.script/iframe/object/embed,on*=andjavascript:(author-content clean-up, reported as info).src/site.ts):category, orhelp-center.json, which also sets names, descriptions and order. Root files go to “General”;index.mdis the category or home intro.order, then title. Prev / next stay within the category.relatedfirst, then scored by shared tags ×3, same category ×1 and title / heading word overlap ×0.5 (threshold 2, at most 5).baseUrl, else/). Every other page uses relative URLs, sofile://and sub-paths work.baseUrl; English / Chinese UI strings, auto-detected; light / dark responsive CSS.tokenize.jsthe browser loads (Latin words, plus CJK single characters and bigrams).search-index.js(window.HC_SEARCH) so it also works fromfile://. The MiniSearch UMD build (MIT) is copied intoassets/..help-center/builds.json. A page is rewritten only when a part changed or the file is missing, and the changed parts are reported as reasons.search-index.jsand the sitemap are hash-compared. Outputs of deleted docs are removed (only files recorded in the manifest).name=in raw HTML), links outside the docs folder, output conflicts (a.md+a.html→ error, nothing written), missing or duplicate titles, empty articles, unknownrelated, drafts, empty configured categories.Panel:
Network / API / side effects: none, and no API keys. Writes the output folder and
.help-center/builds.json. No hooks. The generated site is fully self-contained.Testing:
##and setext titles, CJK slugs) and the tokenizer..md→.html, image copy, table wrap, TOC, sitemap (21 URLs), 404 base, and search ranking with the real MiniSearch.full.zh-CNUI, Unicode paths, CJK search.##/ setext headings; HTMLname=anchors resolve; the 2 real brokenCHANGELOG.mdlinks are reported.file://: “退款” finds and highlights the right article; related link works.A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。
Self-check / 自查清单
external_plugins/<name>/categoryis set (productivity)version0.1.0 in bothplugin.jsonandmarketplace.jsonREADME.md(EN) andREADME_CN.md(中文) both provided and equivalentdescription_i18nhas bothenandzh-CNpython3 scripts/validate.pyandpython3 scripts/build_dist.pypass locallyhelp/harborand build a static help center; the agent ranhc_scan(15 articles, 5 categories, 1 notice) →hc_build: 23 pages inhelp-center/, no broken links; demo video in the comments)