Skip to main content

pptx_to_md/
lib.rs

1mod constants;
2mod container;
3mod markdown;
4mod metadata;
5mod odp;
6pub mod parse_rels;
7pub mod parse_xml;
8mod parser_config;
9mod presentation;
10mod slide;
11mod types;
12mod xml;
13
14pub use container::PptxContainer;
15pub use metadata::PresentationMetadata;
16pub use parser_config::{ImageHandlingMode, ParserConfig};
17pub use presentation::{PresentationContainer, PresentationFormat, PresentationSlideIterator};
18pub use slide::Slide;
19pub use types::*;
20
21#[derive(Debug, thiserror::Error)]
22pub enum Error {
23    #[error("Zip error: {0}")]
24    Zip(#[from] zip::result::ZipError),
25
26    #[error("XML parse error in {part}: {source}")]
27    Xml {
28        part: String,
29        #[source]
30        source: quick_xml::Error,
31    },
32
33    #[error("UTF-8 conversion error: {0}")]
34    Utf8(#[from] std::str::Utf8Error),
35
36    #[error("Slide not found")]
37    SlideNotFound,
38
39    #[error("IO error: {0}")]
40    Io(#[from] std::io::Error),
41
42    #[error("Parse error: {0}")]
43    ParseError(&'static str),
44
45    #[error("Image not found")]
46    ImageNotFound,
47
48    #[error("Relationship not found")]
49    RelationshipNotFound,
50
51    #[error("Conversion was not possible")]
52    ConversionFailed,
53
54    #[error("Conversion was not possible")]
55    MultiThreadedConversionFailed,
56
57    #[error("Unknown Error")]
58    Unknown,
59}
60
61pub type Result<T> = std::result::Result<T, Error>;