diff --git a/.editorconfig b/.editorconfig index 1f62f555..3caeb590 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,11 @@ insert_final_newline = true charset = utf-8 indent_style = tab +[*.mustache] +charset = utf-8 +indent_style = space +indent_size = 2 + [{.travis.yml,package.json}] indent_style = space indent_size = 2 diff --git a/examples/favicon.ico b/examples/favicon.ico new file mode 100644 index 00000000..1d042457 Binary files /dev/null and b/examples/favicon.ico differ diff --git a/examples/index.mustache b/examples/index.mustache index b1512357..046f9771 100644 --- a/examples/index.mustache +++ b/examples/index.mustache @@ -7,6 +7,7 @@ + @@ -30,9 +31,11 @@
@@ -156,18 +159,21 @@The best way to get docxtemplater is via npm
npm install docxtemplater --save
+jszip version 2 is important !**, it won't work with version 3
+npm install jszip@2 --save
Then create "input.docx" file containing "Hello {firstname} {lastname} !"
And create the following index.js file:
-var fs=require('fs');
-Docxtemplater = require('docxtemplater');
+var fs = require('fs');
+var Docxtemplater = require('docxtemplater');
+var JSZip = require('jszip');
-content = fs
+var content = fs
.readFileSync(__dirname+"/input.docx","binary");
var zip = new JSZip(content);
-var doc=new Docxtemplater().loadZip(zip)
+var doc = new Docxtemplater().loadZip(zip);
doc.setData({
"firstname":"John",
@@ -199,6 +205,7 @@ fs.writeFileSync(__dirname+"/output.docx",buf);
docxtemplater has comprehensive documentation available at https://docxtemplater.readthedocs.io/en/latest/
If you have some general questions / bugs to report, please use the github issue tracker.
I also provide professional support for companies with an SLA (My email address can be found on this site: https://github.com/edi9999)
+ You can also find ready-made pro modules at : https://modules.docxtemplater.com