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;
33pub mod cli;
34pub mod exc;
35pub mod opc;
36pub mod oxml;
37pub mod parts;
38pub mod api;
39pub mod prelude;
40pub mod helpers;
41pub mod templates;
42pub mod export;
43pub mod import;
44
45#[cfg(feature = "mcp")]
46pub mod mcp;
47
48#[cfg(feature = "web2ppt")]
49pub mod web2ppt;
50
51pub use api::Presentation;
52pub use core::{ToXml, escape_xml};
53pub use elements::{Color, RgbColor, SchemeColor, Position, Size, Transform};
54pub use exc::{PptxError, Result};
55pub use generator::{
56    create_pptx, create_pptx_with_content, create_pptx_with_settings,
57    create_pptx_to_writer, create_pptx_with_content_to_writer, create_pptx_lazy_to_writer,
58    LazySlideSource,
59    SlideContent, SlideLayout,
60    TextFormat, FormattedText,
61    Table, TableRow, TableCell, TableBuilder,
62    Shape, ShapeType, ShapeFill, ShapeLine,
63    Image, ImageBuilder, ImageSource,
64    Chart, ChartType, ChartSeries, ChartBuilder,
65    BulletStyle, BulletPoint,
66    TextDirection, RtlLanguage, RtlTextProps,
67    Comment, CommentAuthor, CommentAuthorList, SlideComments,
68    SlideSection, SectionManager,
69    DigitalSignature, SignerInfo, HashAlgorithm, SignatureCommitment,
70    InkAnnotations, InkStroke, InkPen, InkPoint, PenTip,
71    SlideShowSettings, ShowType, PenColor, SlideRange,
72    PrintSettings, HandoutLayout, PrintColorMode, PrintWhat, Orientation,
73    TableMergeMap, MergeRegion, CellMergeState,
74    EmbeddedFontList, EmbeddedFont, FontStyle, FontCharset,
75    PresentationSettings,
76    Connector, ConnectorType, ConnectorLine, ArrowType, ArrowSize, ConnectionSite, LineDash,
77    Hyperlink, HyperlinkAction,
78    GradientFill, GradientType, GradientDirection, GradientStop, PresetGradients,
79    Video, Audio, VideoFormat, AudioFormat, VideoOptions, AudioOptions,
80};
81pub use oxml::repair::{PptxRepair, RepairIssue, RepairResult};
82
83// Export convenience types for new capabilities
84pub use import::html::{parse_html, parse_html_with_options, HtmlParseOptions, Html2Ppt};
85pub use export::md::{MarkdownOptions, export_to_markdown, export_to_markdown_with_options};
86pub use export::image_export::{
87    ImageExportOptions, ImageFormat,
88    export_to_images, export_slide_to_image, render_thumbnail
89};
90pub use opc::compress::{
91    CompressionOptions, CompressionLevel, CompressionResult,
92    compress_pptx, compress_pptx_in_memory, analyze_pptx
93};
94
95pub use parts::{
96    Part, PartType, ContentType,
97    PresentationPart, SlidePart, SlideLayoutPart, LayoutType,
98    SlideMasterPart, ThemePart, NotesSlidePart,
99    ImagePart, MediaPart, MediaFormat, ChartPart,
100    TablePart, TableRowPart, TableCellPart,
101    CorePropertiesPart, AppPropertiesPart,
102    ContentTypesPart, Relationships,
103};
104
105#[cfg(feature = "web2ppt")]
106pub use web2ppt::{
107    Web2Ppt, WebFetcher, WebParser, WebContent, ContentBlock,
108    ContentType as WebContentType,
109    Web2PptConfig, ConversionOptions, Web2PptError,
110    html_to_pptx, html_to_pptx_with_options, url_to_pptx, url_to_pptx_with_options,
111};
112
113pub const VERSION: &str = "0.2.13";