Work on replacer logic

This commit is contained in:
Dolan
2023-02-24 01:05:43 +00:00
parent a4d96bbf6e
commit f3dc1f0712
6 changed files with 91 additions and 15 deletions

View File

@ -9,6 +9,18 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
children: [new TextRun("John Doe")],
text: "{{ name }}",
},
{
children: [new TextRun("Heading wow!")],
text: "{{ table_heading_1 }}",
},
{
children: [new TextRun("#657")],
text: "{{ item_1 }}",
},
{
children: [new TextRun("Lorem ipsum paragraph")],
text: "{{ paragraph_replace }}",
},
],
}).then((doc) => {
fs.writeFileSync("My Document.docx", doc);