Skip to main content

Crate docxide_template

Crate docxide_template 

Source
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 .docx template files and generates a typed struct for each one.

Traits§

DocxTemplate
Trait implemented by all generated template structs.

Functions§

build_docx_bytes
Applies placeholder replacements to a .docx template 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 .docx file. Used internally by generated save() methods.
save_docx_bytes
Like build_docx_bytes, but writes the result directly to a file at output_path.
save_docx_from_file
Reads a template from disk and saves the filled-in result to output_path.