Skip to main content

ppt_rs/
lib.rs

1//! PowerPoint (.pptx) file manipulation library
2//!
3//! A comprehensive Rust library for creating, reading, and updating PowerPoint 2007+ (.pptx) files.
4//!
5//! # Quick Start
6//!
7//! ```rust,no_run
8//! use ppt_rs::{create_pptx_with_content, SlideContent};
9//!
10//! let slides = vec![
11//!     SlideContent::new("Welcome")
12//!         .add_bullet("First point")
13//!         .add_bullet("Second point"),
14//! ];
15//! let pptx_data = create_pptx_with_content("My Presentation", slides).unwrap();
16//! std::fs::write("output.pptx", pptx_data).unwrap();
17//! ```
18//!
19//! # Module Organization
20//!
21//! - **core** - Core traits (`ToXml`, `Positioned`) and utilities
22//! - **elements** - Unified element types (Color, Position, Size, Transform)
23//! - **generator** - PPTX file generation with ZIP packaging and XML creation
24//! - **parts** - Package parts (SlidePart, ImagePart, ChartPart)
25//! - **integration** - High-level builders for presentations
26//! - **opc** - Open Packaging Convention (ZIP) handling
27//! - **oxml** - Office XML parsing and manipulation
28//! - **exc** - Error types
29
30pub mod core;
31pub mod elements;
32pub mod generator;
33#[cfg(feature = "cli")]
34pub mod cli;
35pub mod exc;
36pub mod opc;
37pub mod oxml;
38pub mod parts;
39pub mod api;
40pub mod prelude;
41pub mod helpers;
42pub mod templates;
43pub mod export;
44pub mod import;
45
46#[cfg(feature = "mcp")]
47pub mod mcp;
48
49#[cfg(feature = "web2ppt")]
50pub mod web2ppt;
51
52pub use api::Presentation;
53pub use core::{ToXml, escape_xml};
54pub use elements::{Color, RgbColor, SchemeColor, Position, Size, Transform};
55pub use exc::{PptxError, Result};
56pub use generator::{
57    create_pptx, create_pptx_with_content, create_pptx_with_settings,
58    create_pptx_to_writer, create_pptx_with_content_to_writer, create_pptx_lazy_to_writer,
59    LazySlideSource,
60    SlideContent, SlideLayout,
61    TextFormat, FormattedText,
62    Table, TableRow, TableCell, TableBuilder,
63    Shape, ShapeType, ShapeFill, ShapeLine,
64    Image, ImageBuilder, ImageSource,
65    Chart, ChartType, ChartSeries, ChartBuilder,
66    BulletStyle, BulletPoint,
67    TextDirection, RtlLanguage, RtlTextProps,
68    Comment, CommentAuthor, CommentAuthorList, SlideComments,
69    SlideSection, SectionManager,
70    DigitalSignature, SignerInfo, HashAlgorithm, SignatureCommitment,
71    InkAnnotations, InkStroke, InkPen, InkPoint, PenTip,
72    SlideShowSettings, ShowType, PenColor, SlideRange,
73    PrintSettings, HandoutLayout, PrintColorMode, PrintWhat, Orientation,
74    TableMergeMap, MergeRegion, CellMergeState,
75    EmbeddedFontList, EmbeddedFont, FontStyle, FontCharset,
76    PresentationSettings,
77    Connector, ConnectorType, ConnectorLine, ArrowType, ArrowSize, ConnectionSite, LineDash,
78    Hyperlink, HyperlinkAction,
79    GradientFill, GradientType, GradientDirection, GradientStop, PresetGradients,
80    Video, Audio, VideoFormat, AudioFormat, VideoOptions, AudioOptions,
81};
82pub use oxml::repair::{PptxRepair, RepairIssue, RepairResult};
83
84// Export convenience types for new capabilities
85pub use import::html::{parse_html, parse_html_with_options, HtmlParseOptions, Html2Ppt};
86pub use export::md::{MarkdownOptions, export_to_markdown, export_to_markdown_with_options};
87pub use export::image_export::{
88    ImageExportOptions, ImageFormat,
89    export_to_images, export_slide_to_image, render_thumbnail
90};
91pub use opc::compress::{
92    CompressionOptions, CompressionLevel, CompressionResult,
93    compress_pptx, compress_pptx_in_memory, analyze_pptx
94};
95
96pub use parts::{
97    Part, PartType, ContentType,
98    PresentationPart, SlidePart, SlideLayoutPart, LayoutType,
99    SlideMasterPart, ThemePart, NotesSlidePart,
100    ImagePart, MediaPart, MediaFormat, ChartPart,
101    TablePart, TableRowPart, TableCellPart,
102    CorePropertiesPart, AppPropertiesPart,
103    ContentTypesPart, Relationships,
104};
105
106#[cfg(feature = "web2ppt")]
107pub use web2ppt::{
108    Web2Ppt, WebFetcher, WebParser, WebContent, ContentBlock,
109    ContentType as WebContentType,
110    Web2PptConfig, ConversionOptions, Web2PptError,
111    html_to_pptx, html_to_pptx_with_options, url_to_pptx, url_to_pptx_with_options,
112};
113
114pub const VERSION: &str = "0.2.13";