Repository navigation
docs: migrate documentation site to levimc-kit (Impression, Craft) - #398
Conversation
Replace MkDocs Material with levimc-kit (Vite + React 19 + react-router 7 + TypeScript + Tailwind CSS v4, statically prerendered), the shared "Impression, Craft" design system used by every LeviMC site. - vendor levimc-kit 1.0.0 into kit/ and add package.json, package-lock.json, docs.config.ts, vite.config.ts and tsconfig.json at the repository root - port nav, nav_translations (Home/Tutorials/APIs), suffix i18n (zh under /zh/), directory URLs, pymdownx heading ids, logo/favicon, edit links and last-updated dates 1:1 from mkdocs.yml; keep h2-h6 in the page outline - remove mkdocs.yml, requirements.txt and docs/overrides/ (the language redirect is handled by the kit) - build_docs workflow: Node 24, npm ci, typecheck, build, internal link check, upload-pages-artifact@v5, deploy-pages@v5 (deploy condition unchanged), fetch-depth 0 for last-updated dates - fix broken and redirecting links (link text unchanged)
- nav: API sub-groups start collapsed except the one holding the current page, like MkDocs Material; the active sidebar/drawer link and the active "On this page" entry are scrolled into view - python-markdown compat: lazy blockquote continuation after an empty '>' line, 5+ spaces after a list marker are not indented code, and code spans pair backticks like Python-Markdown (reverts the NBTValue source edit) - Python-Markdown footnote ids (fn:1 / fnref:1), MkDocs home and 404 titles, sitemap.xml.gz, no empty dist/kit folder, full project name in the 390px header - zh particle link points at the Bedrock particle page (old page is now a disambiguation page without #类型) - CI: drop the duplicate pull_request trigger; deploy job gets the github-pages environment and a pages concurrency group
Review round 1: fixes (commit f752a88)Fixed
Not fixed
Code review (/code-review) findings
Re-verified from a clean
The content HTML changed on exactly 7 pages compared with the previous build, all of them intended. Kit patches (all listed in the PR body for upstreaming): Screenshots:
🤖 Generated with Claude Code |
f752a88 to
dc4e10d
Compare
Summary
This PR moves the LegacyScriptEngine docs (https://docs.levimc.org/LegacyScriptEngine/) from MkDocs Material 9.3 to levimc-kit 1.0.0. levimc-kit is the shared "Impression, Craft" design system (Monet colour fields + Minecraft pixel UI) and static docs engine that every LeviMC site now uses: Vite 8 + React 19 + react-router 7 + TypeScript + Tailwind CSS v4. Every URL is prerendered to real HTML for GitHub Pages and then hydrated.
#headingdeep link and the old#fn:N/#fnref:Nfootnote links still answer 200 with no redirect.What changed
mkdocs.yml):kit/(vendored levimc-kit 1.0.0, patches listed below),package.json+package-lock.json(npm),docs.config.ts,vite.config.ts,tsconfig.json.contentDir: 'docs'. The content is unchanged: 92 pages (46 enx.md+ 46 zhx.zh.md), plusimg/logo.pngandimg/ColorLog.png.mkdocs.yml:apis/README.md→/LegacyScriptEngine/apis/, and the zhnav_translations(Home 主页, Tutorials 教程, APIs 接口). The seven API sub-groups use the{ text, collapsed: true, items }form. Like Material withoutnavigation.expand, only the group that holds the current page is open, so the current page is always visible in the sidebar./zh/, directory URLs, and pymdownx heading ids (#-sql数据库,_1duplicates).<details>,<u>,~~.navigation.tabs) and logo/faviconimg/logo.png.edit/develop/docs/:path, and last-updated dates.<title>:Page - LegacyScriptEngine, and justLegacyScriptEngineon the English home page, as on MkDocs.mkdocs.yml,requirements.txt,docs/overrides/main.html. The kit's root-only language redirect, which respects a stored choice, replaces the old redirect script..github/workflows/build_docs.yml:workflow_dispatch. The path list now coversdocs/**,kit/**and the app files instead ofmkdocs.yml.refs/heads/develop && push.fetch-depth: 0, Node 24 +npm ci→typecheck→build→ internallinkcheck→upload-pages-artifact@v5(dist/) →deploy-pages@v5.github-pagesenvironment (its branch policy allowsdevelop) and in apagesconcurrency group (cancel-in-progress: false)..gitignore:/dist/,/.kit/.README.md/README.zh.md: the docs links use the canonical trailing-slash URL.Verification
All numbers come from the clean CI sequence (
npm ci && npm run typecheck && npm run build), served withkit/scripts/serve-pages.mjs(GitHub Pages semantics).sitemap.xml+sitemap.xml.gz, and search indexes. There is one expected warning, for the escaped pseudo-tag<NBT object>(see below).find dist -type d -emptyprints nothing.tsc --noEmitclean.--external: 143 unique URLs, 0 broken. Everything that is not plainlyok:ok-auth(51): GitHub edit links behind the sign-in wall.blocked429 (42): GitHub, rate-limited through the shared proxy. 41 of them are edit links to files that exist ondevelop.python/cpython/issues/83526exists (checked via the API).blocked403:dev.mysql.com×3. These are bot walls; all three load with 200 in headless Chromium with a browser User-Agent.ok-redirect: thediscord.gginvite (allowed).redirect:https://bedrock.dev/zh/docs/stable/Molanganswers 302 (temporary) →nextjs.bedrock.dev. All ofbedrock.dev/zhdoes this. I left it on the canonical bedrock.dev URL on purpose: a temporary redirect to anextjs.host is not a permanent move, and the English page would change the language of the link.--anchors: 92/92 live sitemap URLs answer 200 with 0 redirects, and every live heading id exists locally. These also answer 200/0 both live and locally:sitemap.xml,sitemap.xml.gz,img/logo.png,img/ColorLog.png,index.html,zh/index.html.https://docs.levimc.org/LegacyScriptEngine/apis/ScriptAPI/Logger/is hard-coded insrc/legacy/api/LoggerAPI.cpp. It answers 200 with 0 hops, so the C++ code is unchanged.fn:1,fnref:1, …).**typo. There is no empty blockquote and no extra code block.article.md-content__inner): 92 pages, 83 identical, 99.986 % word similarity. Every remaining difference is listed under Known renderer differences./home/futri/levimc-work/u4-lse/screens/:fix-r1/, light + dark at 1440 and 390:home,home-zh,scripthelp,tutorial-zh,systeminfo,player-zh,nbtvalue,command, plusdrawer-systeminfo-{light,dark}-390.pngandtoc-follow-player-light-1440.png.home-*,zh-home-*,zh-blockevents-*,player-*,database-*command-tip-*,languagesupport-tip-*,gameutils-*,gameutils-format-*blockevents-details-*,i18n-footnotes-*,file-toc-*,scripthelp-img-*,notfound-*live-home-light-1440.png,live-database-light-1440.pngLink fixes
Link text is unchanged everywhere; only the targets below changed.
apis/DataAPI/DataBase.mdhttps://www.google.com/search?q=https://gitee.com/Y_oyo→https://gitee.com/Y_oyoapis/DataAPI/DataBase.mdhttps://www.google.com/search?q=%23connection-parameters→#connection-parameters#连接参数.apis/DataAPI/DataBase.mdhttps://www.google.com/search?q=%23execute-sql-and-get-result-set→#execute-sql-and-get-result-setapis/ScriptAPI/i18n(.zh).md×4https://fmt.dev/latest/syntax.html→https://fmt.dev/latest/syntax/apis/GameAPI/Player.md×13,Player.zh.md×13https://docs.microsoft.com/{en-us,zh-cn}/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#x→https://learn.microsoft.com/{en-us,zh-cn}/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#x#respawn/#rotatebodylinks. All 13 anchors were verified on both locale pages.apis/GameAPI/Block.zh.mdhttps://zh.minecraft.wiki/w/粒子#类型→https://zh.minecraft.wiki/w/基岩版粒子#类型粒子is now a disambiguation page without#类型.基岩版粒子answers 200 with 0 hops, hasid="类型"and listsheart_particle, the example the text cites. The en link (Particles#Types_of_particles) is still valid.tutorials/create_your_first_plugin(.zh).mdhttps://atom.io/→https://github.blog/news-insights/product-news/sunsetting-atom/apis/LanguageSupport(.zh).mdhttps://docs.levimc.org/LeviLamina→https://docs.levimc.org/LeviLamina/apis/SystemAPI/Network.zh.mdhttps://github.com/LiteLDev/LiteLoaderBDSv2/blob/v2/main/test/UnitTest.js→https://github.com/LiteLDev/LiteLoaderBDS/blob/v2/main/test/UnitTest.jsv2/main.README.md,README.zh.mdhttps://docs.levimc.org/LegacyScriptEngine→https://docs.levimc.org/LegacyScriptEngine/No other markdown edits: the earlier NBTValue backtick edit was reverted, and the kit now reproduces Python-Markdown's code-span pairing.
Known renderer differences
Text (the 9 text-parity pages). Each one is a source quirk that MkDocs rendered lossily; the kit shows what the author wrote.
Array<NBT object>/Array<NBT 对象>(NBTList) andObject<string, NBT Object>(NBTCompound), en + zh: MkDocs let the browser swallow these pseudo-tags, so it showed only "Array" / "Object". The kit escapes them and shows the full type (build warningescaped non-HTML tags).hh:mm:ss(Economy, en + zh): pymdownx.emoji turned:mm:into an emoji image on the live site, which therefore shows "hhss". The kit showshh:mm:ss.**:**N**amed … **T**ags**)**and**NBT标签 **are source typos. pymdownx.betterem showedTags)and*NBT标签 *; CommonMark showsTags**)**and**NBT标签 **.Structure only (same text). In these places Python-Markdown's list quirks re-nest a line, or move it out of its list. The kit follows the authored indentation:
- Return value…/- Intercept eventitems after a nested parameter list:AAbb/aaBBitems: these stay inside the list locally; live breaks out of it.> Only complete top-level…directly follows a list item without a blank line. Live puts the quote inside the<li>; the kit renders it right after the list.Other:
<title>: "This page wandered off - LegacyScriptEngine" (Material used the bare site name).search/search_index.jsonandassets/images/favicon.png. The favicon isimg/logo.png, as before.Kit patches
All are in the vendored
kit/and are generic; please upstream them. Every one is covered by the verification above.kit/docs/app/docs.css.kit-toc-list li[data-level="3"|"4"] aoutline: [2, 6](MkDocs' h5 entries) went past the styled depths 0–2.kit/docs/app/docs.css(≤420 px header)kit/docs/app/components/reveal.ts(new),Sidebar.tsx,MobileDrawer.tsx,Toc.tsxrevealIn()scrolls only the given scroll container (never the page), instantly, so there is no motion. Sidebar and drawer centre the active link on load, after navigation and when the drawer opens. The TOC keeps the highlighted entry inside the sticky column.toc.follow).kit/docs/node/markdown/preprocess.ts>line, the rest of the block stays in the quote, but headings, rules and containers split it; (c) on lines with a 2+ backtick run, code spans are paired with Python-Markdown's BACKTICK_RE and re-emitted as equivalent CommonMark spans, only when the result verifiably matches. Indented-code lines are skipped.Number` `` without a source edit. All three now match the live HTML structure.kit/docs/node/markdown/render.tscompatis python-markdown, footnote ids and hrefs use Python-Markdown's form:fn:N,fnref:N,fnrefK:N.#fn:1deep links keep working.kit/docs/shared/head.tsurlStyle: 'directory', the site-root page gets the bare site title (Material'sis_homepage). The 404 title usestitleTemplate. Function replacers prevent$expansion.<title>parity with MkDocs. LeviLamina has the same home-title difference.kit/docs/node/vite.tssitemap.xml.gz.kit/docs/prerender.mjsrmdirSyncinstead ofrmSync, which threw EISDIR.dist/kit/docs/app/was shipped in the Pages artifact.Follow-ups
tabsmode. Its ownSidebarData.expanddocs say MkDocs opens only the active path. Defaulting MkDocs-mode groups to collapsed would let LeviLamina (same Material features) drop the per-sitecollapsed: true.index(.zh).mdrender with the doc layout, like LeviLamina's port. Alayout: homePaintedHero would mean restructuring the home markdown (H1 and lead move into frontmatter), so I did not do it here.bedrock.dev/zh/...currently answers 302 tonextjs.bedrock.dev. Revisit if bedrock.dev makes that permanent.🤖 Generated with Claude Code