Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjrmatos/jsreport-pug
Use pug templating engine in jsreport
https://github.com/bjrmatos/jsreport-pug
jade jsreport reporting template-engine
Last synced: 3 months ago
JSON representation
Use pug templating engine in jsreport
- Host: GitHub
- URL: https://github.com/bjrmatos/jsreport-pug
- Owner: bjrmatos
- License: mit
- Created: 2015-10-17T21:53:17.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-24T23:09:55.000Z (over 5 years ago)
- Last Synced: 2024-10-07T00:35:21.859Z (3 months ago)
- Topics: jade, jsreport, reporting, template-engine
- Language: JavaScript
- Homepage: https://jsreport.net/
- Size: 370 KB
- Stars: 5
- Watchers: 5
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsreport-pug
[![Build Status](https://travis-ci.org/bjrmatos/jsreport-pug.png?branch=master)](https://travis-ci.org/bjrmatos/jsreport-pug)
**Use [pug](https://pugjs.org) templating engine in [jsreport](https://github.com/jsreport/jsreport) and [jsreport-core](https://github.com/jsreport/jsreport-core)**
```bash
npm install jsreport-pug
```You can access the input data through pug locals and you can find helpers on `templateHelpers`
```html
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**
1. Create a local folder that will hold the server, i.e. (~/myTools/jsreport)
2. Go to that directory (cd ~/myTools/jsreport)
3. Do ```yarn global add jsreport-cli``` (you can also use ```npm install -g jsreport-cli```)
4. Execute ```jsreport init``` (this will create folder structure)
5. Add this template engine or anyother (i.e. ejs) this command: ```yarn add jsreport-pug```
6. 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](https://playground.jsreport.net/studio/workspace/Vy9Y0fHz-/3)**