guigrpa / docx-templates

Template-based docx report creation
MIT License
882 stars 145 forks source link

Improve documentation on templates #356

Closed koosvanderkolk closed 5 months ago

koosvanderkolk commented 6 months ago

Thanks for the great module, checking it out.

I think the documentation on "Writing templates" can be improved.

For me, I just wanted to know what the docx template would look like for e.g.

 const report = await createReport({
    template,
    data: { name: 'John', surname: 'Appleseed' },
    cmdDelimiter: ['{', '}'],
  });

It is just:

{name} {surname}

It would be great if this is just documented, instead of a referral to an example.

juw177 commented 5 months ago

Just want to say that I had the same experience having just come across this project, looked through the node examples folder and could not find one example that would simply show John Appleseed.

jjhbw commented 5 months ago

Good points! I have simplified the docs based on your suggestions. ac2e4aeaf291c21149d53b2ba502d44e4c1897c3