docx-rs/docx-core/src/lib.rs

22 lines
449 B
Rust
Raw Normal View History

2019-11-05 08:10:48 +02:00
mod documents;
2019-11-07 09:08:59 +02:00
mod types;
2019-11-05 11:03:23 +02:00
mod xml_builder;
2019-11-07 10:31:04 +02:00
mod zipper;
2019-11-05 08:10:48 +02:00
2019-11-07 10:31:04 +02:00
pub use documents::*;
2019-11-07 11:45:03 +02:00
pub use types::*;
pub use zipper::*;
2019-09-13 13:41:05 +03:00
pub fn simple() {
2019-11-07 11:45:03 +02:00
let path = std::path::Path::new("./test.docx");
let file = std::fs::File::create(&path).unwrap();
2019-11-11 03:41:59 +02:00
Docx::new()
2019-11-11 04:10:33 +02:00
.add_paragraph(
Paragraph::new()
.add_run(Run::new("Hello"))
.add_run(Run::new(" World")),
)
2019-11-11 03:41:59 +02:00
.build()
.pack(file);
2019-09-11 21:28:14 +03:00
}