Repository navigation
feat(ui-plugins): add Offline Site Packer (offline-site-packer) - #244
Open
ppppp2005-p wants to merge 10 commits into
Open
ppppp2005-p wants to merge 10 commits into
ppppp2005-p wants to merge 10 commits into
Conversation
Author
|
ZCode desktop demo (ZCode 4.0.0, macOS arm64) offline-site-packer-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) / 涉及的插件名称:
offline-site-packer(UI Plugin, new)What / 改动内容
New community UI plugin Offline Site Packer / 网站离线打包: a built static site becomes an offline copy that works from
file://, with offline full-text search and a link report.Tools:
site_check: crawl only; writes nothing.site_pack: writes<site>-offline/and a.zip.site_state,site_dirs.How it works:
index.htmlovera/area/iframe(pages) andlink/script/img/source/video/audio(src,href,srcset,poster,data-src), inlinestyleand<style>, and CSSurl()/@import(CSS files are crawled too). Script bodies and comments are left untouched.?queryis dropped and#hashkept.dir/resolves todir/index.html;xresolves tox, thenx.html, thenx/index.html.baseUrl, absolute URLs on the same origin and path are treated as internal.mailto/tel/javascript/datalinks are skipped. Paths escaping the site root are reported as broken.includeUnlinkedadds the rest).<base href>is removed with a warning.fetch()/ XHR in JS files triggers a warning._offline/search-index.js, together with the MiniSearch UMD build and a small vanilla widget (button, ⌘K / Ctrl+K and/, keyboard navigation, highlighted snippets, zh/en labels).Panel:
Network / API / side effects: none. No API keys. Writes the output folder, the zip and
.offline-site-packer/last.json. No hooks.Third-party: minisearch (MIT; also shipped inside the offline output), fflate (MIT), MCP SDK / ext-apps (MIT), zod (MIT).
Tests: the sample is a fictional "Lumen Lamp — Docs" site generated by
samples/site/make-site.mjs. It has root-relative assets, pretty and extension-less URLs, CSS@import+url(), srcset and a same-site absolute URL. The planted problems are 1 broken link, 1 missing image, 3 external links + mailto, 1 orphan page and 1 unused image.resolveRefcases: pretty and extension-less URLs, hash, query, percent-encoding, baseUrl with a path, protocol-relative URLs, path escape, and skipped schemes.@import/url().includeUnlinkedandsearch: false; the fetch() warning; refusal to overwrite a folder the plugin did not create; output inside the source; a folder without index.html.validate.py,build_dist.py,git diff --checkandtscpass.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 locally