Skip to content

v0.1.10

Choose a tag to compare

@github-actions github-actions released this 30 Aug 18:17
· 7 commits to main since this release
v0.1.10
f7f157a

English

Added

  • --open for pdf: cargo fy-docs pdf --open opens the first generated release PDF, matching the option the README already documented for the other commands.

Changed

  • --lang is normalized and strict: ZH_CN, zh-cn and zh_CN now 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 zh does not select zh-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 family reports 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 own main.typ is 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 #import can no longer steer root detection to the wrong ancestor; it also skips docs/release/ alongside docs/target/.
  • The main.typ version fallback reads uncommented code only and skips a version: 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_*.html intermediates left by a killed compile.
  • extract_all_styles also captures <style> tags carrying attributes, which makes multi-language style merging a live path instead of dead code.
  • A failing --with-pdf stage 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::entry field and the superseded Project::pdf_file_name(), and gated the test-only AppState::new behind #[cfg(test)]. Internal items are now pub(crate), since the crate deliberately exposes no library API.

简体中文

新增

  • pdf 支持 --opencargo fy-docs pdf --open 打开首个生成的发行版 PDF,补齐 README 早已为其他子命令声明的选项。

变更

  • --lang 归一化且严格ZH_CNzh-cnzh_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。