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

20 lines
445 B
Rust
Raw Normal View History

2019-11-05 08:10:48 +02:00
mod documents;
2019-11-11 11:34:55 +02:00
mod errors;
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-11 11:34:55 +02:00
pub use errors::*;
2019-11-07 11:45:03 +02:00
pub use types::*;
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 06:05:07 +02:00
.add_paragraph(Paragraph::new().add_run(Run::new("Hello")))
.add_paragraph(Paragraph::new().add_run(Run::new(" World")))
2019-11-11 03:41:59 +02:00
.build()
.pack(file);
2019-09-11 21:28:14 +03:00
}