1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// SPDX-FileCopyrightText: 2026 Jandira Technologies, LLC
//
// SPDX-License-Identifier: AGPL-3.0-only
//! # jubarte
//!
//! Lossless DOCX redline engine: compare two Word documents and produce a
//! tracked-changes (redline) `.docx` — the original document with every
//! difference against the modified one expressed as Word revisions
//! (insertions, deletions, moves, and format changes) — that opens cleanly
//! in Microsoft Word. Also lists, accepts, and rejects tracked revisions.
//!
//! ## Example
//!
//! ```no_run
//! let original = std::fs::read("original.docx").unwrap();
//! let modified = std::fs::read("modified.docx").unwrap();
//! let redline =
//! jubarte::document_comparer::compare_documents(&original, &modified, "Reviewer")
//! .expect("compare");
//! std::fs::write("original_v_modified.docx", &redline).unwrap();
//! ```
//!
//! For author/date/detail-threshold control, build a
//! [`comparer::WmlComparerSettings`] and call
//! [`document_comparer::compare_documents_with_settings`]. To inspect a
//! redline, use [`document_comparer::get_revisions`]; to flatten one, use
//! [`document_comparer::accept_revisions`] / [`document_comparer::reject_revisions`].
//! Convert a document to PDF with [`convert::docx_to_pdf`].
//!
//! ## Provenance
//!
//! The comparer is a Rust port of the `WmlComparer`/`DocumentComparer` engine
//! from [Docxodus](https://github.com/JSv4/Docxodus) (MIT), itself a fork of
//! Microsoft's [Open-Xml-PowerTools](https://github.com/OfficeDev/Open-Xml-PowerTools)
//! (MIT). The repository itself is AGPL-3.0-only; `LICENSES/` preserves those
//! upstream attribution texts without changing the repository license.
/// Core WmlComparer engine (atomize → LCS → produce → finalize).
/// Structured comparison log (info / warning / error entries).
/// Independent DOCX → PDF conversion (not LibreOffice).
/// Byte-level package API: compare, list, accept, and reject revisions.
/// Markup simplification (PowerTools `MarkupSimplifier` port).
/// WordprocessingML and related namespace / `XName` constants.
/// Open Packaging Conventions adapter (`PartFs`).
/// P0-LAB-01 stage counters/timers — no-ops unless `perf-profile` is enabled.
/// Accept / reject tracked revisions across a package.
/// ISO Strict → Transitional package normalization.
/// Unique id helpers for revision markup.
/// Shared small utilities.
/// `WmlDocument` — document bytes + lazily parsed main part.
/// Arena DOM (`xmllinq`) used by the comparer.
/// [`WmlDocument`] re-export for the common library entry point.
pub use WmlDocument;