{"repo":"xamgore/docx-template","free":true,"listed":false,"github":"https://github.com/xamgore/docx-template","clone":"git clone https://github.com/xamgore/docx-template.git","description":"Replace {placeholders} and manage content inside .docx files","language":"Rust","stars":16,"topics":["docx","microsoft-word","template"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"docx-template Replace {placeholders} and manage content inside .docx files. --- --- - Primitive : not a template engine, but can do quite a few transformations Replace text, swap images, delete comments , flip checkboxes , insert custom markup - Fast : single-pass, avoids recompression, uses Aho-Corasick internally, almost O(n) No long time read issues like docx&#x2011;rs has - Not memory-efficient (yet) : operates on a byte stream without DOM tree allocation Keeps the whole text in&#x2011;memory Example Why A naive approach to the problem is just calling xml.replace(\"{placeholder}\", \"🦀\") . Which isn't 100% accurate, as placeholders can reside in multiple adjacent XML nodes like in the example below. That's why this crate was made. It reads XML nodes, detects patterns, and applies transformations keeping the structural integrity. Features - serde (default) — use json! macro & Serialize structs to create templates - docx-rs — insert markup defined by @bokuweb/docx&#x2011;rs - docx-rust — insert markup defined by @cstkingkey/docx&#x2011;rust Ecosystem name description :-----------------------------------------------------------------------------------------------------: ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------","default_branch":null,"files":null,"tree":[],"storefront":"/r/xamgore","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xamgore/docx-template/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}