jsonresume-theme-paper-plus-plus
Advanced tools
Comparing version 0.3.3 to 0.4.1
52
index.js
var fs = require("fs"); | ||
var Handlebars = require("handlebars"); | ||
var countries = require('country-data').countries; | ||
var countries = require('./resources/countryCodes.js'); | ||
@@ -13,18 +13,4 @@ function render(resume) { | ||
// Get a country from the country code | ||
resume.basics.location.country = countries[resume.basics.location.countryCode].name; | ||
resume.basics.location.country = countries[resume.basics.location.countryCode]; | ||
// http://stackoverflow.com/a/12002281/1263876 | ||
Handlebars.registerHelper("foreach",function(arr,options) { | ||
if(options.inverse && !arr.length) | ||
return options.inverse(this); | ||
return arr.map(function(item,index) { | ||
item.$index = index; | ||
item.$first = index === 0; | ||
item.$notfirst = index !== 0; | ||
item.$last = index === arr.length-1; | ||
return options.fn(item); | ||
}).join(''); | ||
}); | ||
// Remove http and www from url | ||
@@ -41,25 +27,11 @@ Handlebars.registerHelper('no-http', function(options) { | ||
// http://stackoverflow.com/a/16315366 | ||
Handlebars.registerHelper('ifCond', function (v1, operator, v2, options) { | ||
switch (operator) { | ||
case '==': | ||
return (v1 == v2) ? options.fn(this) : options.inverse(this); | ||
case '===': | ||
return (v1 === v2) ? options.fn(this) : options.inverse(this); | ||
case '<': | ||
return (v1 < v2) ? options.fn(this) : options.inverse(this); | ||
case '<=': | ||
return (v1 <= v2) ? options.fn(this) : options.inverse(this); | ||
case '>': | ||
return (v1 > v2) ? options.fn(this) : options.inverse(this); | ||
case '>=': | ||
return (v1 >= v2) ? options.fn(this) : options.inverse(this); | ||
case '&&': | ||
return (v1 && v2) ? options.fn(this) : options.inverse(this); | ||
case '||': | ||
return (v1 || v2) ? options.fn(this) : options.inverse(this); | ||
default: | ||
return options.inverse(this); | ||
} | ||
}); | ||
// http://stackoverflow.com/a/31632215/838789 | ||
Handlebars.registerHelper({ | ||
and: function (v1, v2) { | ||
return v1 && v2; | ||
}, | ||
or: function (v1, v2) { | ||
return v1 || v2; | ||
} | ||
}); | ||
@@ -71,3 +43,3 @@ // http://stackoverflow.com/a/18831911 | ||
//Uncomment this for printing as .pdf | ||
// Send all necessary resources to the handlebars template and compile it | ||
return Handlebars.compile(template)({ | ||
@@ -74,0 +46,0 @@ resume: resume, |
{ | ||
"name": "jsonresume-theme-paper-plus-plus", | ||
"version": "0.3.3", | ||
"version": "0.4.1", | ||
"description": "A theme for JSON Resume", | ||
@@ -12,4 +12,3 @@ "author": "Johan Lindell", | ||
"dependencies": { | ||
"country-codes": "0.0.3", | ||
"handlebars": "^2.0.0-alpha.4" | ||
"handlebars": ">=4.0.0" | ||
}, | ||
@@ -16,0 +15,0 @@ "homepage": "https://github.com/lindell/jsonresume-theme-paper", |
@@ -10,9 +10,9 @@ # JSON Resume Paper++ theme | ||
### Desktop | ||
![Desktop](http://i.imgur.com/YIkqf3w.png) | ||
![Desktop](http://i.imgur.com/k9qpO6U.png) | ||
### Phone | ||
![Desktop](http://i.imgur.com/YiVCi40.png) | ||
![Desktop](http://i.imgur.com/BBoDaI7.png) | ||
![Desktop](http://i.imgur.com/2cnlNPO.png) | ||
![Desktop](http://i.imgur.com/0JgaUWO.png) | ||
@@ -19,0 +19,0 @@ ## License |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
77205
1
12
676
+ Addedhandlebars@4.7.8(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedneo-async@2.6.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addeduglify-js@3.19.3(transitive)
+ Addedwordwrap@1.0.0(transitive)
- Removedcountry-codes@0.0.3
- Removedamdefine@1.0.1(transitive)
- Removedasync@0.2.10(transitive)
- Removedcountry-codes@0.0.3(transitive)
- Removedhandlebars@2.0.0(transitive)
- Removedoptimist@0.3.7(transitive)
- Removedsource-map@0.1.43(transitive)
- Removeduglify-js@2.3.6(transitive)
- Removedwordwrap@0.0.3(transitive)
Updatedhandlebars@>=4.0.0