Let project previews opt into the route-D core

This commit is contained in:
gloamxun committed 2026-10-20 23:09:32 +08:00
1 parent a8e7499ce3
commit fe7fd68321
5 files changed
+59 -7

No files matched your search

+9 -6
View File
@@ -237,7 +237,7 @@ for a later overlaid slash.
| M4 math | partial | atoms, scripts, fractions, roots, delimiters, accents, operators, classes, braces, boxed, negated; no math painter/shrink wrapping |
| M5 NFSS/TFM | partial | runtime `cmr10.tfm` widths/heights/depths/kern pairs and ff/fi/fl/ffi/ffl ligatures; text faces embed Liberation Serif/Mono as Type0 CID fonts with Identity-H, ToUnicode and width arrays; only faces used on a page are embedded, and ASCII documents use the 110-glyph minimal tier (one-page Roman PDF is about 21 KB); no Base-14 dependency; SVG carries family/weight/style |
| M6 specials/XObject | partial | raw specials, RGB image XObjects, URI link annotations; class/package execution absent |
| M7 incremental integration | partial | route-D preview/PDF/edit endpoints with content-based page hashes and section/emphasis/display-math/itemize/enumerate/description/quote/center/flushright mapping; editor integration and inline math pending |
| M7 incremental integration | partial | route-D preview/PDF/edit endpoints plus opt-in `?engine=route-d` project preview, content-based page hashes and section/emphasis/display-math/itemize/enumerate/description/quote/center/flushright mapping; editor toggle UI and inline math pending |
v1 remains the production renderer; the route-D core is additive and tested independently.
@@ -267,7 +267,7 @@ M3 (partial): `Unit::halign` normalizes column widths, intercolumn gaps, row hei
Math coverage includes fractions/roots, scripts, `\left...\right` with body-scaled delimiters, `\middle`, `\big`/`\Big`/`\bigg`/`\Bigg` and their `l`/`r` forms, control-sequence delimiters, accents (dot/check/breve/acute/grave/ring), `\text`/`\mathrm`, `\overbrace`/`\underbrace`, `\overset`/`\underset`, `\binom`, `\cancel`/`\bcancel`/`\xcancel`, `\bmod`/`\pmod`, fence symbols, `\operatorname*` and `\mathop` limits.
The crate currently has 142 unit tests plus one route-D integration test. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 237 tests (142 route-D unit, 1 route-D integration, 71 v1 integration, 18 server, 4 v1 unit, 1 doctest). v1 remains the live server path.
The crate currently has 142 unit tests plus one route-D integration test. Workspace verification: `cargo fmt --all -- --check`; `cargo test --workspace --offline` runs 238 tests (142 route-D unit, 1 route-D integration, 71 v1 integration, 18 server, 4 v1 unit, 1 doctest). v1 remains the live server path.
### M0 incremental demo
@@ -301,9 +301,12 @@ deliberately open rather than approximated:
metadata, so replaying an earlier page cannot change its hash merely by
re-attaching source hashes.
- **M7**: `POST /api/route-d/preview`, `/api/route-d/pdf` and
`/api/route-d/edit/{unit}` expose route-D pages, PDF export and edit diff; the preview path lays out
blank-line-separated plain text and returns route-D pages with SVG and page
hashes. It is not yet the editor preview: LaTeX-to-route-D semantic mapping and
edit-diff reuse inside the project preview remain open.
`/api/route-d/edit/{unit}` expose route-D pages, PDF export and edit diff. The
project preview can opt in with `POST /api/projects/{id}/preview?engine=route-d`;
`route_d::latex_preview_json` strips the preamble/body wrapper and hands the
document body to the same route-D paragraph parser. The v1 semantic pipeline
remains the default fallback. LaTeX-to-route-D semantic mapping is still a
subset, the project preview recomputes rather than reusing edit checkpoints,
and there is no editor toggle or pixel comparison yet.
- `\middle` does not scale with its enclosing delimiter; math delimiters are
scaled glyphs rather than TeX delimiter variants.