Skip to main content

ppt_rs/web2ppt/
mod.rs

1//! Web2PPT - Convert webpages to PowerPoint presentations
2//!
3//! This module provides functionality to fetch webpages, extract content,
4//! and generate PowerPoint presentations from the extracted content.
5
6#[cfg(feature = "web2ppt")]
7mod fetcher;
8#[cfg(feature = "web2ppt")]
9mod parser;
10#[cfg(feature = "web2ppt")]
11mod converter;
12#[cfg(feature = "web2ppt")]
13mod config;
14
15#[cfg(feature = "web2ppt")]
16pub use fetcher::WebFetcher;
17#[cfg(feature = "web2ppt")]
18pub use parser::{WebParser, WebContent, ContentBlock, ContentType};
19#[cfg(feature = "web2ppt")]
20pub use converter::{Web2Ppt, ConversionOptions, url_to_pptx, url_to_pptx_with_options, html_to_pptx, html_to_pptx_with_options};
21#[cfg(feature = "web2ppt")]
22pub use config::Web2PptConfig;
23
24/// Error types for web2ppt operations
25#[derive(Debug, thiserror::Error)]
26pub enum Web2PptError {
27    #[error("Failed to fetch URL: {0}")]
28    FetchError(String),
29    
30    #[error("Failed to parse HTML: {0}")]
31    ParseError(String),
32    
33    #[error("Failed to generate presentation: {0}")]
34    GenerationError(String),
35    
36    #[error("Invalid URL: {0}")]
37    InvalidUrl(String),
38    
39    #[error("No content found on page")]
40    NoContent,
41    
42    #[error("IO error: {0}")]
43    IoError(#[from] std::io::Error),
44}
45
46pub type Result<T> = std::result::Result<T, Web2PptError>;