-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
31 lines (25 loc) · 871 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
var fs = require('fs')
var path = require('path')
var nunjucks = require('nunjucks')
var env = nunjucks.configure()
var filters = require('./nunjucksFilters.js')
var resumeLimits = require('./resumeLimits.js')
var legalNote = require('./legalNote.js')
env.addFilter('extractWords', filters.extractWords)
env.addFilter('skillRange', filters.skillRange)
env.addFilter('skillLevel', filters.skillLevel)
env.addFilter('humanizeDateMonth', filters.humanizeDateMonth)
function render(resume) {
var css = fs.readFileSync(path.join(__dirname, './css/css.css'), 'utf-8')
var cssPrint = fs.readFileSync(path.join(__dirname, './css/print.css'), 'utf-8')
return env.render(path.join(__dirname, './index.nunjucks'), {
css: css,
cssPrint: cssPrint,
resume: resume,
limits: resumeLimits,
legalNote: legalNote
});
}
module.exports = {
render: render
}