1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/// Core trait for Markdown conversion.
///
/// This module defines the `ToMarkdown` trait that enables types to be
/// converted to Markdown format.
use crateResult;
use MarkdownOptions;
/// Core trait for types that can be converted to Markdown.
///
/// This trait is implemented for Document, Presentation, and their constituent
/// parts (paragraphs, runs, tables, etc.).
///
/// # Examples
///
/// ```rust,no_run
/// use litchi::{Document, markdown::ToMarkdown};
///
/// # fn main() -> Result<(), litchi::Error> {
/// let doc = Document::open("document.docx")?;
///
/// // Convert entire document
/// let markdown = doc.to_markdown()?;
///
/// // Or convert individual parts
/// for para in doc.paragraphs()? {
/// let para_md = para.to_markdown()?;
/// println!("{}", para_md);
/// }
/// # Ok(())
/// # }
/// ```