Expand description
Type-safe .docx template engine.
Use generate_templates! to scan a directory of .docx files at compile time
and generate a struct per template. See the README
for full usage instructions.
Macros§
- generate_
templates - Scans a directory for
.docxtemplate files and generates a typed struct for each one.
Traits§
- Docx
Template - Trait implemented by all generated template structs.
Functions§
- build_
docx_ bytes - Applies placeholder replacements to a
.docxtemplate and returns the result as bytes. - replace_
placeholders_ in_ xml - Replaces
{placeholder}patterns in raw Office Open XML. - save_
docx - Saves a filled-in template to a
.docxfile. Used internally by generatedsave()methods. - save_
docx_ bytes - Like
build_docx_bytes, but writes the result directly to a file atoutput_path. - save_
docx_ from_ file - Reads a template from disk and saves the filled-in result to
output_path.