From e179ac80033986183dcd4779631837d33c3c0b36 Mon Sep 17 00:00:00 2001 From: bokuweb Date: Sat, 18 Jan 2020 00:19:07 +0900 Subject: [PATCH] Update README.md --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3b6dce5..1c55413 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,22 @@ [![GitHub Actions Status](https://github.com/bokuweb/docx-rs/workflows/Continuous%20Integration/badge.svg)](https://github.com/bokuweb/docx-rs/actions) -# Features +## Example + +``` rust +use docx_core::*; + +pub fn hello() -> Result<(), DocxError> { + let path = std::path::Path::new("./tests/output/hello.docx"); + let file = std::fs::File::create(&path).unwrap(); + Docx::new() + .add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello"))) + .build() + .pack(file)?; + Ok(()) +} +``` + +## Features - [x] Paragraph