Releases: fengyangsi/fy-docs
Releases · fengyangsi/fy-docs
Release list
v0.1.10
English
Added
--openforpdf:cargo fy-docs pdf --openopens the first generated release PDF, matching the option the README already documented for the other commands.
Changed
--langis normalized and strict:ZH_CN,zh-cnandzh_CNnow select the same target, while a filter that matches no language fails with a non-zero exit code and lists the languages the project actually provides instead of quietly building the default target only. Matching stays exact:--lang zhdoes not selectzh-CN.- Typst warnings are surfaced: a successful compile forwards typst's stderr instead of discarding it, so font substitution and directives dropped by HTML export no longer hide behind a green build. The repeated
unknown font familyreports fold into one deduplicated line, and Windows verbatim path prefixes are stripped from forwarded diagnostics. - Language detection is rule-based: any
docs/subdirectory carrying its ownmain.typis a language target except the generated directories, so shared source folders no longer need an entry on a name denylist. - Debounced rebuilds are bounded: a save burst still folds into one rebuild, but the wait is capped at 2s from the first change, so a process writing sources continuously cannot postpone the rebuild forever.
Fixed
- The absolute-import scan honours both quote styles and
//comments, so a commented-out#importcan no longer steer root detection to the wrong ancestor; it also skipsdocs/release/alongsidedocs/target/. - The
main.typversion fallback reads uncommented code only and skips aversion:without a quoted value instead of abandoning the search. - Every build sweeps
docs/target/of artifacts fy-docs no longer writes (_poll.js,_build) and of_temp_*.htmlintermediates left by a killed compile. extract_all_stylesalso captures<style>tags carrying attributes, which makes multi-language style merging a live path instead of dead code.- A failing
--with-pdfstage still leaves the routing landing page in place for pure i18n projects, so the dev server keeps a route for/.
Removed
- Deleted the never-read
Project::entryfield and the supersededProject::pdf_file_name(), and gated the test-onlyAppState::newbehind#[cfg(test)]. Internal items are nowpub(crate), since the crate deliberately exposes no library API.
简体中文
新增
pdf支持--open:cargo fy-docs pdf --open打开首个生成的发行版 PDF,补齐 README 早已为其他子命令声明的选项。
变更
--lang归一化且严格:ZH_CN、zh-cn、zh_CN现在指向同一目标;而过滤值匹配不到任何语言时以非零码失败并列出项目实际提供的语言,不再静默退化为"只构建 default 目标"。匹配保持精确:--lang zh不会命中zh-CN。- 透传 typst 告警:编译成功时转发 typst 的 stderr,字体替换与 HTML 导出丢弃的排版指令不再藏身于绿色构建之后。重复上报的
unknown font family折叠为按字体族去重的一行,转发的诊断文本一并剥掉 Windows verbatim 路径前缀。 - 语言目录判定改为正向规则:
docs/下自带main.typ的子目录即为语言目标,仅生成目录除外;共享源目录不必再维护硬编码名单。 - 去抖重建设有上限:连续保存仍合并为一次构建,但等待自首次变更起最长 2 秒,持续写入源文件的进程无法再无限推迟重建。
修复
- 绝对导入扫描尊重单双引号与
//注释,被注释掉的#import不再把 root 拖到错误的祖先目录;该扫描同时跳过docs/release/。 main.typ版本回退只读未注释代码,且遇到无引号值的version:时继续查找而非直接放弃。- 每次构建清扫
docs/target/:移除 fy-docs 已不再写出的历史产物(_poll.js、_build)与被强制中断的编译残留的_temp_*.html。 extract_all_styles现可提取带属性的<style>标签,使多语言样式合并从死代码变为生效路径。--with-pdf阶段失败时仍为纯多语言项目保留语言路由分流页,开发服务器根路径不再无路由可用。
移除
- 删除零读取的
Project::entry字段与已被取代的Project::pdf_file_name(),并将仅供测试使用的AppState::new收进#[cfg(test)]。内部项可见性统一收窄为pub(crate)——本 crate 有意不公开任何库 API。
v0.1.9
English
Fixed
- Dev-mode live reload reacts to the first save again: the
/eventsstream sends the current build id once as the subscriber baseline (WatchStream::new), so opening a page and saving immediately reloads it instead of requiring a second rebuild. This reverts the 0.1.8WatchStream::from_changeschange, which suppressed every page's initial baseline frame; the duplicate seed frame it fixed stays fixed.
简体中文
修复
- dev 模式热重载恢复「首次保存即刷新」:
/events流以WatchStream::new在订阅时恰好推送一次当前构建编号作为基线帧,打开页面后第一次保存即触发重载,不再需要等第二次重建。此改动回退 0.1.8 的WatchStream::from_changes(它把每个页面的首个基线帧一并抑制了);0.1.8 修掉的重复种子帧问题依然不复存在。
v0.1.8
English
Fixed
- A partial-failure build no longer blanks
typst.css: error pages only seed the file when absent, so the combined styles of successfully built languages survive. - A multi-language project with one surviving language keeps its routing landing page instead of having that page copied to
index.html. - A failed build no longer logs "generated docs/target" before exiting non-zero.
- The SSE stream no longer sends a duplicate seed frame; only actual rebuilds are pushed (
WatchStream::from_changes).
简体中文
修复
- 部分失败的构建不再清空
typst.css:错误页仅在文件缺失时写入空样式,成功语言的合并样式得以保留。 - 多语言项目仅剩一个成功语言时,保留语言路由分流页,不再把该语言页面复制为
index.html。 - 构建失败时不再先打印 "generated docs/target" 再以非零码退出。
- SSE 流不再发送重复的种子帧,仅推送真正的重建事件(
WatchStream::from_changes)。
v0.1.7
English
Added
vendorSubcommand:cargo fy-docs vendor(re)writes the embedded fy-spec template intodocs/fy-spec/lib.typ;vendor --checkverifies without writing and exits non-zero on drift, so CI can pin the template version. Requires no typst binary.- SSE Live Reload: the dev server pushes build ids over a
/eventsServer-Sent-Events stream, replacing the 1.5-second polling loop. The singlelive.jsclient ships with static builds too and stays silent when no server answers. - Typst Precheck: every compiling command verifies up front that
typstexists and is at least 0.14, failing with an actionable message instead of a raw flag error. - Windows CI Job and a typst pinned to 0.15.1 in CI, so "tested against Typst 0.15" is enforced rather than implied.
- Real-Binary Integration Tests: fresh build, broken-source exit code, and vendor drift checks run against the actual executable, skipping gracefully where typst is absent.
- fy-spec Single Source of Truth: the template's
typst.tomlandexamples/basic.typmoved into this repository'sdocs/fy-spec/; the HTML class contract betweenlib.typandbase.cssis documented as a dogfood spec chapter.
Changed
- Exit Codes:
buildandhtmlnow exit non-zero when compilation fails (previously exit 0 after writing an error page), so CI pipelines catch broken documents. Thedevserver still survives failures and renders error pages. - Dev-mode rebuilds inherit the startup
--lang/--with-pdfoptions instead of silently rebuilding every language after the first save. - Compile failures write error pages per language (
index_<lang>.html); successfully built targets keep their fresh pages and the multi-language landing page is never overwritten by error output. - Output files are written atomically (sibling temp file + rename), so a dev-server reload can never serve a half-written page.
- The watcher excludes
docs/target/anddocs/release/by path, not only by file extension. - UI language derives from the document's language target instead of scanning for CJK characters (Japanese documents no longer get Chinese controls).
- Minimum Typst raised from 0.13 to 0.14: the
--pdf-standard 2.0flag fy-docs passes first shipped there. - README corrected: PDF filenames include the language suffix, the options table lists
--with-pdf/--no-open, and the version floor is stated accurately.
Fixed
- Redirect landing page values are escaped for JavaScript string contexts (backslash, control characters) and the default target is escaped in both its script and
<noscript>forms; an unusual language directory can no longer produce invalid JavaScript. - Compile-thread panics degrade to per-language error pages with a log line instead of aborting the whole process.
_temp_*.htmlintermediates are removed on every path, including extraction failures.<body>extraction tolerates attributes on the opening tag, so a typst export format drift cannot break page assembly.- Cargo.toml parsing is unified:
initnow resolvesworkspace = trueinherited versions likebuilddoes, and the two duplicate.gitignorehelpers collapsed into one.
Removed
- Retired the standalone
fy-specrepository; every project vendors its template copy viacargo fy-docs vendor, and this repository is the template's only home.
简体中文
新增
vendor子命令:cargo fy-docs vendor将内嵌的 fy-spec 模板(重)写入docs/fy-spec/lib.typ;vendor --check只读校验、漂移即非零退出,供 CI 锁定模板版本。该命令无需 typst。- SSE 热重载:dev 服务器通过
/events(Server-Sent Events)流推送构建编号,取代 1.5 秒轮询;单轨live.js客户端随静态构建一同分发,无服务器应答时静默关闭。 - typst 预检:所有编译类命令启动即校验
typst存在且不低于 0.14,以可操作的信息报错,而非裸露的参数错误。 - Windows CI 测试任务,并在 CI 中将 typst 锁定到 0.15.1,让「基于 Typst 0.15 测试」成为强制事实而非口头声明。
- 真实二进制集成测试:全新构建、损坏源码退出码、vendor 漂移校验均对真实可执行文件运行;无 typst 环境自动跳过。
- fy-spec 唯一真身:模板的
typst.toml与examples/basic.typ迁入本仓库docs/fy-spec/;lib.typ与base.css之间的 HTML 类名契约以自食文档章节固化。
变更
- 退出码:
build与html在编译失败时以非零退出码结束(此前写完错误页后仍退出 0),CI 流水线得以拦截损坏文档;dev服务器依旧存活并将失败渲染为错误页。 - dev 模式重建继承启动时的
--lang/--with-pdf选项,不再在首次保存后悄悄全量重建。 - 编译失败按语言写入错误页(
index_<lang>.html);成功的语言保留最新产物,多语言分流页绝不被错误输出覆盖。 - 产物原子写入(同目录临时文件 + rename),dev 服务器重载期间不可能读到半截页面。
- watcher 按路径排除
docs/target/与docs/release/,不再仅依赖扩展名过滤。 - UI 语言改由文档语言目标推导,弃用 CJK 字符嗅探(日文文档不再误判为中文)。
- 最低 Typst 版本由 0.13 提升至 0.14:fy-docs 传入的
--pdf-standard 2.0自该版本起才受支持。 - 修正 README:PDF 文件名补语言后缀、参数表补全
--with-pdf/--no-open、版本下限如实标注。
修复
- 重定向分流页的取值按 JavaScript 字符串上下文转义(反斜杠、控制字符),默认跳转目标在脚本与
<noscript>两处均过转义;异常语言目录不再可能产出非法 JS。 - 编译线程 panic 降级为该语言的错误页与一行日志,不再中止整个进程。
_temp_*.html中间文件在所有路径(含提取失败)下均被删除。<body>提取容忍开始标签带属性,typst 导出格式演进不再破坏页面拼装。- Cargo.toml 解析统一:
init现与build一样解析workspace = true继承版本;两处重复的.gitignorehelper 合一。
移除
- 独立仓库
fy-spec退役;各项目经cargo fy-docs vendor自持模板副本,本仓库成为模板唯一真身。
v0.1.6
English
Added
- Multilingual (i18n) Support: Automatically detect single-language and multi-language specification folders (
docs/<lang>/main.typlikedocs/zh-CN/,docs/en/). - Interactive Language Switcher: Added top toolbar
🌐 Language Switcherdropdown with smooth in-page navigation betweenindex_<lang>.htmlpages. - CLI Commands Reorganized:
cargo fy-docs(andcargo fy-docs build): Idempotent, non-blocking full build for HTML and PDF 2.0 (CI-safe).cargo fy-docs html: Compile offline HTML documentation only.cargo fy-docs dev: Interactive development server with live reload and browser auto-opening.- Added
--lang <LANG>parameter to target specific language documentation.
- Multilingual Dogfood Specifications: Full bilingual specification books (English and Simplified Chinese) with interactive architecture DAG diagrams (powered by Fletcher).
- CI Chinese Fonts: Added Google Noto CJK fonts installation in GitHub Actions workflows to guarantee zero
.notdefbox artifacts on headless Linux runners.
Changed
- Template Decoupling: Fully decoupled
fy-spectemplate fonts with safe fallback across Linux, macOS, and Windows. Fonts can be overridden viafontsparameter. - Dynamic Cover Metadata: Generic
title,lang,regiondefaults without hardcoded ecosystem assumptions;author,subtitle, andmethodologyrender dynamically only when provided.
Removed
- Removed redundant
fy-docs/fy-specroot directory, embedding directly fromdocs/fy-spec/lib.typ.
简体中文
新增
- 多语言(i18n)原生支持:自动探测单语言与多语言规格目录(
docs/<lang>/main.typ如docs/zh-CN/、docs/en/等),分别生成index_<lang>.html与对应语言的规格书 PDF。 - 顶栏交互式语言切换下拉框:在多语言文档顶栏右侧新增
🌐 语言切换下拉菜单,点击可在多语言页面间同级顺畅跳转;单语言项目自动隐藏。 - CLI 命令体系正交重构:
cargo fy-docs(及cargo fy-docs build):安全全量构建(HTML + PDF 2.0),执行完毕后以退出码0退出,彻底消除 CI 挂起风险。cargo fy-docs html:仅构建离线 HTML 网页包。cargo fy-docs dev:交互开发工作台,启动本地 Web 服务,自动打开浏览器并监听源码热重载。- 新增
--lang <LANG>参数以定向编译指定语言文档。
- 双语 Dogfood 规格说明书:为
fy-docs自身建立完整的中英双语规格说明书,并使用 Fletcher 绘制 5 大核心模块交互式架构 DAG 图(支持在网页端点击节点直接跳转)。 - CI 中文字体保障:在 GitHub Actions 流水线中预装 Google Noto 思源中文字体包,彻底根除 Linux 无头 Runner 上编译中文 PDF 出现
.notdef豆腐块方格的缺陷。
变更
- 模板字体与语言解耦:彻底解耦
fy-spec模板字体,内置覆盖 Linux、macOS 与 Windows 的全平台安全回退栈,并支持调用方通过fonts参数自由覆盖。 - 封面元数据动态渲染:去除强加的生态私货与写死默认值;
author、subtitle、methodology等字段仅在调用方显式传入时才动态渲染。
移除
- 彻底移除根目录下冗余的
fy-docs/fy-spec目录,统一直接从docs/fy-spec/lib.typ进行编译期内嵌。
v0.1.5
English
Added
- Enabled one-click return to cover by clicking toolbar title or sidebar project brand.
- Enabled sequential page navigation and arrow key paging back to cover as Chapter 0.
Changed
- Upgraded PDF compilation target to modern PDF 2.0 (
--pdf-standard 2.0/ ISO 32000-2:2020) for enhanced tag semantics, accessibility, and color management.
Fixed
- Fixed Typst HTML export container dropping issue (typst/typst#5512) by introducing
centeredhelper and structural semanticfy-coverbranches (.fy-cover-chip,.fy-cover-metawith<dl>/<dt>/<dd>). - Updated
base.csswith dark/light theme styling for.fy-coverclasses and completed.fy-badge-donestyling. - Fixed pager "Previous" link ignoring clicks on returning to cover due to missing anchor ID registration.
简体中文
新增
- 支持点击顶部工具栏标题或侧栏项目名称一键返回封面。
- 支持翻页导航(“上一页”按钮与键盘左右方向键)平滑退回封面(封面作为第 0 节参与有序翻页)。
变更
- 全面升级 PDF 编译规格至最新的 PDF 2.0 标准(
--pdf-standard 2.0/ ISO 32000-2:2020),显著增强标签语义、无障碍访问(Accessibility)及色彩渲染一致性。
修复
- 修复 Typst HTML 导出丢弃
align/rect/line/grid容器导致封面、目录标题与居中内容空白的问题(typst/typst#5512):引入centered辅助函数并重构封面为双分支语义结构(.fy-cover-chip与.fy-cover-meta<dl>/<dt>/<dd>)。 - 升级
base.css样式表,适配.fy-cover类族的明暗主题,并补齐.fy-badge-done状态徽章样式。 - 修复封面因未分配锚点 ID 导致点击“上一页”按钮返回封面无响应的问题。
v0.1.4
English
Added
- Automated multi-platform binary releases across 9 architectures (Linux GNU/musl x86_64/ARM64, macOS Apple Silicon/Intel, Windows x86_64/ARM64, FreeBSD x86_64).
- Automated build and attachment of versioned specification PDF documents (
fy-docs_v<version>_specification.pdf) directly to GitHub Releases.
Testing
- Expanded test coverage across all modules (server endpoints, project detection, watcher, compiler, scaffold, and CLI dispatcher), raising code line coverage to 92%+.
简体中文
新增
- 支持 9 大平台架构预编译二进制程序全自动构建与发布(Linux GNU/musl x86_64/ARM64、macOS Apple Silicon/Intel、Windows x86_64/ARM64、FreeBSD x86_64)。
- GitHub Release 自动编译并发布版本对应的官方规格说明书 PDF 文档(
fy-docs_v<版本>_specification.pdf)。
测试
- 扩充全模块测试套件(服务器端点、工程探测、文件监听、编译器、脚手架与命令行调度),单测覆盖率大幅提升至 92%+。