@jsreport/jsreport-pug
v5.0.1
Published
Use pug templating engine in jsreport
Downloads
44
Readme
@jsreport/jsreport-pug
Use pug templating engine in jsreport and jsreport-core
npm install @jsreport/jsreport-pug
You can access the input data through pug locals and you can find helpers on templateHelpers
doctype html
html(lang="en")
head
body
p Hello from helper: #{templateHelpers.hello()}
p Hello from input data: #{hello}
Guide: jsreport-cli with pug template engine instalation
- Create a local folder that will hold the server, i.e. (~/myTools/jsreport)
- Go to that directory (cd ~/myTools/jsreport)
- Do
yarn global add @jsreport/jsreport-cli
(you can also usenpm install -g @jsreport/jsreport-cli
) - Execute
jsreport init
(this will create folder structure) - Add this template engine or anyother (i.e. ejs) this command:
yarn add @jsreport/jsreport-pug
- Start the server with this command
jsreport start
When jsreport starts, it looks for engines in node_modules folder and if it founds any it loads them with no extra configuration.
See the playground example