Skip to content

Commit

Permalink
Update main site
Browse files Browse the repository at this point in the history
  • Loading branch information
edi9999 committed Nov 26, 2016
1 parent f9ed771 commit c1c1026
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Expand Up @@ -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
Binary file added examples/favicon.ico
Binary file not shown.
17 changes: 12 additions & 5 deletions examples/index.mustache
Expand Up @@ -7,6 +7,7 @@
<meta name="keywords" content="docx templating, generate docx from the browser and nodejs">
<meta name="description" content="docxtemplater makes it very easy to generate docx without writing lots of code">
<meta name="author" content="Edgar Hipp">
<link rel="icon" href="/favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link href="style.css" rel="stylesheet">
</head>
Expand All @@ -30,9 +31,11 @@
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-right" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="https://docxtemplater.readthedocs.io/en/latest/">DOCS</a></li>
<li><a href="http://javascript-ninja.fr/docxtemplater/v1/examples/demo.html">DEMO</a></li>
<li><a href="#install">INSTALL</a></li>
<li><a href="https://docxtemplater.readthedocs.io/en/latest/">DOCS</a></li>
<li><a href="#support">SUPPORT</a></li>
<li><a href="https://modules.docxtemplater.com">PRO MODULES</a></li>
</ul>
</div>

Expand Down Expand Up @@ -156,18 +159,21 @@
<p>The best way to get docxtemplater is via npm</p>

<pre><code>npm install docxtemplater --save</code></pre>
<p><b>jszip version 2 is important !**, it won't work with version 3</b></p>
<pre><code>npm install jszip@2 --save</code></pre>

<p>Then create "input.docx" file containing "Hello {firstname} {lastname} !"</p>
<p>And create the following index.js file:</p>

<pre><code>var fs=require('fs');
Docxtemplater = require('docxtemplater');
<pre><code>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",
Expand Down Expand Up @@ -199,6 +205,7 @@ fs.writeFileSync(__dirname+"/output.docx",buf);
<p class="text-center">docxtemplater has comprehensive documentation available at <a href="https://docxtemplater.readthedocs.io/en/latest/">https://docxtemplater.readthedocs.io/en/latest/</a></p>
<p class="text-center">If you have some general questions / bugs to report, please use <a href="https://github.com/open-xml-templating/docxtemplater/issues/">the github issue tracker.</a></p>
<p class="text-center">I also provide professional support for companies with an SLA (My email address can be found on this site: https://github.com/edi9999)</p>
<p class="text-center">You can also find ready-made pro modules at : <a href="https://modules.docxtemplater.com">https://modules.docxtemplater.com</a></p>
</div>
</div>
</div>
Expand Down

0 comments on commit c1c1026

Please sign in to comment.