ooxml_dml/lib.rs
1//! DrawingML (DML) support for the ooxml library.
2//!
3//! This crate provides shared DrawingML types used by Word (WML),
4//! Excel (SML), and PowerPoint (PML) documents.
5//!
6//! DrawingML is defined in ECMA-376 Part 4 and provides common
7//! elements for text formatting, shapes, images, and charts.
8//!
9//! # Text Content
10//!
11//! DrawingML text is structured as paragraphs containing runs. Use the
12//! extension traits from [`ext`] for convenient access:
13//!
14//! ```ignore
15//! use ooxml_dml::ext::{TextBodyExt, TextParagraphExt, TextRunExt};
16//! use ooxml_dml::types::TextBody;
17//!
18//! fn process_text(body: &TextBody) {
19//! for para in body.paragraphs() {
20//! println!("Paragraph: {}", para.text());
21//! for run in para.runs() {
22//! if run.is_bold() {
23//! println!(" Bold: {}", run.text());
24//! }
25//! }
26//! }
27//! }
28//! ```
29
30pub mod error;
31pub mod ext;
32
33/// Generated types from the ECMA-376 DrawingML schema.
34///
35/// These types map 1:1 to XML elements and attributes defined in ECMA-376 Part 4 §20–21.
36/// They are produced by `ooxml-codegen` from the RELAX NG schemas and committed to avoid
37/// requiring the schema files at build time. Use the extension traits in [`ext`] for
38/// ergonomic access rather than working with these types directly.
39///
40/// Re-exported as [`types`].
41#[allow(dead_code)]
42pub mod generated;
43/// Type aliases for the generated ECMA-376 types. See [`generated`] for details.
44pub use generated as types;
45
46/// Generated [`FromXml`](ooxml_xml::FromXml) parsers for all generated types.
47///
48/// Re-exported as [`parsers`].
49pub mod generated_parsers;
50/// Parsers for the generated ECMA-376 types. See [`generated_parsers`] for details.
51pub use generated_parsers as parsers;
52/// Generated [`ToXml`](ooxml_xml::ToXml) serializers for all generated types.
53///
54/// Re-exported as [`serializers`].
55pub mod generated_serializers;
56/// Serializers for the generated ECMA-376 types. See [`generated_serializers`] for details.
57pub use generated_serializers as serializers;
58
59pub use error::{Error, Result};
60#[cfg(feature = "dml-diagrams")]
61pub use ext::DataModelExt;
62#[cfg(feature = "dml-charts")]
63pub use ext::{ChartExt, ChartKind, ChartSpaceExt, ChartTitleExt, PlotAreaExt};
64#[cfg(feature = "dml-tables")]
65pub use ext::{TableCellExt, TableExt, TableRowExt};
66#[cfg(feature = "dml-text")]
67pub use ext::{TextBodyExt, TextParagraphExt, TextRunExt};