diff --git a/demo/89-template-document.ts b/demo/89-template-document.ts
new file mode 100644
index 0000000000..547c77404d
--- /dev/null
+++ b/demo/89-template-document.ts
@@ -0,0 +1,29 @@
+// Patch a document with patches
+// Import from 'docx' rather than '../build' if you install from npm
+import * as fs from "fs";
+import { IPatch, patchDocument, PatchType, TextRun } from "../build";
+
+export const font = "Trebuchet MS";
+export const getPatches = (fields: { [key: string]: string }) => {
+ const patches: { [key: string]: IPatch } = {};
+
+ for (const field in fields) {
+ patches[field] = {
+ type: PatchType.PARAGRAPH,
+ children: [new TextRun({ text: fields[field], font })],
+ };
+ }
+
+ return patches;
+};
+
+const patches = getPatches({
+ salutation: "Mr.",
+ "first-name": "John",
+});
+
+patchDocument(fs.readFileSync("demo/assets/simple-template-3.docx"), {
+ patches,
+}).then((doc) => {
+ fs.writeFileSync("My Document.docx", doc);
+});
diff --git a/demo/assets/simple-template-3.docx b/demo/assets/simple-template-3.docx
new file mode 100644
index 0000000000..8d8fa9aacf
Binary files /dev/null and b/demo/assets/simple-template-3.docx differ
diff --git a/docs/index.html b/docs/index.html
index 73978e40a5..44c52c0c82 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -38,6 +38,7 @@
+