Skip to content

Commit

Permalink
#1 + clarity deliverable template
Browse files Browse the repository at this point in the history
  • Loading branch information
p-a-s-c-a-l committed Mar 26, 2020
1 parent b450d77 commit 442d86a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ dist
# data management plan

/output
*.wbk
~$*
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const carbone = require('carbone');
// Generate a report using the sample template provided by carbone module
// This LibreOffice template contains "Hello {d.firstname} {d.lastname} !"
// Of course, you can create your own templates!
carbone.render('./node_modules/carbone/examples/simple.odt', data, function(err, result){
//carbone.render('./scr/carbone/examples/simple.odt', data, function(err, result){
carbone.render('./templates/clarity-deliverable-template.docx', data, function(err, result){
console.log('Generate a report using the sample template provided by carbone module');
if (err) {
console.log(err);
Expand All @@ -19,5 +20,5 @@ const carbone = require('carbone');
console.log('Report successfully generated using the sample template provided by carbone module');
}
// write the result
fs.writeFileSync('output/result.odt', result);
fs.writeFileSync('output/result.docx', result);
});
Binary file added templates/clarity-deliverable-template.docx
Binary file not shown.

0 comments on commit 442d86a

Please sign in to comment.