jubarte-edit
The edit product of the jubarte DOCX engine: an edit plan in, a tracked-changes redline and a clean copy out. A plan names exact, uniquely anchored operations against one snapshot of a document (optionally bound to its SHA-256): rewrites, insertions, tables, lists, run formatting, footnotes, images, page setup, content controls, watermarks, redaction, settings and field updates. Every operation is resolved before any is applied, so a plan applies whole or not at all.
Where it sits
jubarte-dom → jubarte-opc → jubarte-redlines / jubarte-render →
jubarte-doc / jubarte-markdown / jubarte-edit → jubarte-cli → jubarte
jubarte-edit sits on jubarte-dom, jubarte-opc, jubarte-redlines,
jubarte-doc and jubarte-markdown, and on jubarte-render behind its
render feature. jubarte-cli builds on it.
When to use this crate
Depend on jubarte-edit to apply edit plans or Markdown patches as tracked
changes, for example from an agent. Plans use the paragraph ids (p12) that
jubarte read and the inspect views print. For the whole suite in one
dependency, depend on the facade crate jubarte.
Install
or in Cargo.toml:
[]
= "0.20.0"
The jubarte crates are released together at one version and pin each other exactly, so depend on the same version of every jubarte crate you use. Minimum supported Rust version: 1.94.
Cargo features
None is on by default.
| Feature | What it adds |
|---|---|
render |
Field updates through jubarte-render (and jubarte-doc/render, jubarte-markdown/render): a plan's update_fields refreshes PAGEREF, REF, NUMPAGES, SEQ and TOC results, and the report lists them. Without it no field is updated. |
perf-profile |
Forwards to jubarte-opc/perf-profile: stage counters and timers. Diagnostic only. |
test-support |
Hidden helpers for jubarte's own tests; not a public API. |
Example
use apply_plan_json;
Modules
edit: edit plans (EditPlan, the v2PlanV2) and applying them (apply_plan,apply_plan_json) to a redline and a clean copy.markdown: thejubarte-markdownreader and writer, plus Markdown patches applied as tracked changes, the redline view and unified diffs.text_diff: unified and other review diffs of whole-document text.expect: checks an edited document against a source-bound expectation contract (jubarte check).capabilities: what this build can do, for agents choosing an operation.result: the machine result envelope and its stable codes.publication: staged, capability-confined writes of output files (not onwasm32).- Re-exported from the layers below:
changes,comments,comment_settlement,validate,inspectanddebug(jubarte-doc);comparer,document_comparerandrevision_processor(jubarte-redlines);opc,admission,settingsandstrict_translation(jubarte-opc);xmllinq,namespaces,idsandutil(jubarte-dom).
License
Apache-2.0. NOTICE carries the attributions of the projects this code derives from.
Links
- API reference: docs.rs/jubarte-edit
- Guide: jubarte-edit on ReadTheDocs, part of the jubarte documentation
- Repository: github.com/jandira-tech/jubarte (this crate)
- Command line: the CLI reference of the root README
- Changes: CHANGELOG.md