Repository navigation
Conversation
|
Thank you, @shuff57, this is impressive work: a clean-room OMML editor with about 196 tests, no new external crates and no bundled fonts. It can't merge yet: #4 (UAX #9 bidi + Arabic shaping) landed and rewrote the paragraph cell model in Could you rebase onto main, add a test with an equation inside a right-to-left (Arabic) paragraph, and get If you're not on our Discord yet, come join us: https://discord.gg/artcraft |
7972cf5 to
06ff759
Compare
|
Thanks! Rebased onto current main (d556ff9) and squashed to 4 commits. Bidi integration. The equation atoms are re-slotted into the new paragraph cell model rather than merged mechanically: an equation is one U+FFFC object (a bidi neutral) followed by zero-width U+2060 joiners, one per remaining character of the run. It takes part in bidi and line breaking but is kept out of font shaping, only its first character is a caret stop or break point, and it is placed from the per-cell visual Tests added (
|
OMML tree, linear (LaTeX-ish) format, templates, bounded namespace handling and lossless round-trip of PowerPoint equations; pptx reader/writer keep Math runs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
insert.equation, equation.update/get/templates/fromLinear with strict param validation; Math runs are atomic for copy/cut/format and whole-run deletion. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fractions, roots, scripts, big operators with limits, delimiters and matrices, laid out as inline atoms that keep caret and character counts; drawn vector shapes for radicals, brackets and sum/product signs (Deco carries a path). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Palette dialog with live preview, a math editor model (caret, selection, structure typing, undo/redo, clipboard) and MathLive-style typing grammar. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…L, delimited LaTeX) edit.paste recognises clipboard text that is exactly one equation payload: an m:oMath / m:oMathPara (optional XML declaration), a presentation MathML <math> element, or LaTeX in $$..$$ / \[..\] (display) or $..$ / \(..\) (inline) delimiters spanning the whole text. It inserts a real equation in one undo step; markup that does not parse is pasted as text, as before, with a one-line status note. Keep Text Only / Paste and Match Formatting still paste the literal text. math crate: xml::well_formed (strict check before trusting the lenient reader), clip.rs (detection), mathml.rs (bounded presentation-MathML reader; a parallel implementation, equaSHion has no MathML reader yet). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…on; \bar macron is an accent A pasted HTML clipboard fragment (<!--StartFragment--> or <body>) whose only content is one <math> or <m:oMath> element reads like the bare element. MathML over-marks U+0305 and the macron become the \bar accent, matching equaSHion's to_mathml; checked against equaSHion's writer (19 of 19 sample equations read to the same linear form as its OMML). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…re ROADMAP) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
06ff759 to
f7f591f
Compare
…isuals Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@shuff57 @echelon I've submitted a follow-up that adds direct editing on the slide to this PR's equation editor: Follow-up: shuff57/deckcraft#1 Your PR already provides the structured math editor, fractions, roots, scripts, matrices, symbol shortcuts, layout, and native OMML/PPTX support. The follow-up reuses that work, including your existing The added interactions are:
The follow-up targets your Validation: 337 core tests, 32 UI tests, and all 23 wasm checks passed; synthetic UI previews were inspected. Regression coverage includes document undo/redo, native/PPTX saves, rotated/RTL placement, and table cells. Full CI stopped on existing Rust 1.95 Clippy diagnostics, documented in the follow-up. This does not include a rebase onto main or resolve this PR's merge conflicts. Happy to adapt the follow-up to your preferred integration approach. |
|
Pointing reviewers at #192, which is the successor to this PR. #192 replaces this branch's own I'm leaving both open so you can choose. If #192 is the direction you prefer, this one can be closed in its favour. If you'd rather keep this approach, it still needs the rebase onto the @hajdukste, thanks for the on-slide editing follow-up in shuff57#1. #192 already edits equations on the slide itself, so that work may overlap with it; I'll look at what is worth carrying over. |
|
@shuff57 @echelon An update to my earlier comment: I’ve also opened #778, combining the equaSHion work from #192 with my inline-editing additions, preserving the original commits and authorship. It was based on an earlier version of #192, before the latest updates. I’ve asked @shuff57 to look at it as a possible combined basis so we can agree which PR to carry forward. |
|
This PR conflicts with main ( What I ran, on Linux and Windows (copy of the PR head sources, scratch directory outside the repo,
What this does not cover: only these four equations were opened in PowerPoint; editing one there and saving it back, and reading an equation written by PowerPoint (the importer), were not tested. The editor dialog and in-place typing are UI code and were not run. macOS was not run. The ui-egui and engine suites were not run, and I did not run Notes:
|
|
Closing in favour of #192, which supersedes this PR. #192 replaces this branch's own |
Visual equation editor
Insert → Equation used to be a one-line text field that swapped a few tokens for Unicode and inserted an italic text box. This replaces it with a real equation object and an editor where you type into the formatted math (
x,^,2shows a raised exponent immediately).What it adds
deckcraft-math(new layer-1 crate): math tree, OMML reader/writer (unknown elements preserved as raw XML, bounded against hostile input), linear-text parser/exporter, template catalogue, and a caret/selection editing model.insert.equation,equation.update,equation.get,equation.templates,equation.fromLinear,equation.type. Equations are stored asRunKind::MathOMML and round-trip through PPTX. The importer now sets run text viato_linear(from_omml)and keeps run properties.deckcraft-text(fractions, roots, scripts, big operators with limits, delimiters, matrices); Math runs are inline atoms that keep character/caret counts.^ _ /,sqrt, Greek names, symbol shortcuts, auto-paired brackets), undo/redo, copy/cut, Tab between places. Double-click on an equation reopens it. The linear text field remains as a secondary path.Known limitations
mprefix to a non-OMML URI is mis-namespaced on rewrite (documented in code; Office does not produce this).Verification
cargo xtask ci(fmt, clippy, tests, assets, layers, wasm) passed on this branch. No Autodesk/Microsoft/Adobe assets or third-party math-editor code were used; MathLive and KaTeX were only observed in a browser as comparison references.Opened as a draft: this is a large change (about 40 commits) and I'm happy to squash or split it however you prefer.
🤖 Generated with Claude Code