jubarte_markdown/lib.rs
1// SPDX-FileCopyrightText: 2026 Jandira Technologies, LLC
2//
3// SPDX-License-Identifier: Apache-2.0
4
5//! # jubarte-markdown
6//!
7//! Markdown in and out of Word documents: `markdown::markdown_to_docx`
8//! writes CriticMarkup as tracked changes and comments,
9//! `markdown::docx_to_markdown` (with `markdown::MarkdownOptions`) projects
10//! a package to the agent view's Markdown, and `markdown::diff_markdown`
11//! diffs two documents as pandiff-style CriticMarkup. `legacy_doc` reads
12//! Word 97-2003 `.doc` files.
13//!
14//! The patch/redline/unified modules stay with the edit layer (T4.7);
15//! the facade composes them back into `jubarte::markdown`. With the
16//! `render` feature off, the layout-dependent items (`page_texts`,
17//! `with_page_markers`, page markers in reads) do not exist.
18//!
19//! # Example
20//!
21//! ```rust
22//! use jubarte_markdown::changes::list_changes;
23//! use jubarte_markdown::markdown::{DocxOptions, diff_markdown, markdown_to_docx};
24//!
25//! fn main() -> Result<(), Box<dyn std::error::Error>> {
26//! // CriticMarkup becomes Word tracked changes.
27//! let options = DocxOptions { author: "Reviewer".into(), ..DocxOptions::default() };
28//! let written = markdown_to_docx("The term is {--two--}{++three++} years.\n", &options)?;
29//! assert!(!list_changes(&written.docx)?.is_empty());
30//!
31//! // Two Markdown texts diffed as CriticMarkup.
32//! let diff = diff_markdown("The term is two years.\n", "The term is three years.\n");
33//! assert!(diff.contains("three"));
34//! Ok(())
35//! }
36//! ```
37
38#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
39#![forbid(unsafe_code)]
40#![warn(missing_docs)]
41
42// A5 shims: the floors', the compare product's and the doc layer's
43// modules under the names the moved code uses.
44pub use jubarte_doc::{changes, comments, debug, inspect, validate};
45pub(crate) use jubarte_dom::ooxml;
46pub use jubarte_dom::{ids, namespaces, util, xmllinq};
47pub use jubarte_opc::{admission, opc, settings, strict_translation};
48pub(crate) use jubarte_opc::{borders, markup_simplifier, numbering, word_default_theme};
49pub use jubarte_redlines::{comparer, document_comparer};
50
51/// Word 97-2003 `.doc` reading: text, headings and tables.
52pub mod legacy_doc;
53/// Markdown in and out of Word documents.
54pub mod markdown;