summaryrefslogtreecommitdiffstats
path: root/lib/models/templateEngine.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-04-25 12:24:59 +0200
committerSamy Pessé <samypesse@gmail.com>2016-04-25 12:24:59 +0200
commit244fb0ca28f29ac429f58e0e885d21cc6c40beba (patch)
tree0170dd48a50ad51b9ca949e3c9afca506bbe15e8 /lib/models/templateEngine.js
parentf6e123f1ed36019a2ec5da1f97b27d22352b689a (diff)
downloadgitbook-244fb0ca28f29ac429f58e0e885d21cc6c40beba.zip
gitbook-244fb0ca28f29ac429f58e0e885d21cc6c40beba.tar.gz
gitbook-244fb0ca28f29ac429f58e0e885d21cc6c40beba.tar.bz2
Replace shortcuts in templating
Diffstat (limited to 'lib/models/templateEngine.js')
-rw-r--r--lib/models/templateEngine.js24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/models/templateEngine.js b/lib/models/templateEngine.js
index aaa70fd..9a18bd4 100644
--- a/lib/models/templateEngine.js
+++ b/lib/models/templateEngine.js
@@ -1,8 +1,6 @@
var nunjucks = require('nunjucks');
var Immutable = require('immutable');
-var Promise = require('../utils/promise');
-
var TemplateEngine = Immutable.Record({
// List of {TemplateBlock}
blocks: Immutable.List(),
@@ -105,26 +103,4 @@ TemplateEngine.prototype.bindToContext = function(fn) {
return fn.bind(this.getContext());
};
-/**
- Render a template
-
- @param {String} filePath
- @param {String} content
- @param {Object} ctx
- @return {Promise<String>}
-*/
-TemplateEngine.prototype.render = function renderTemplate(filePath, content, context) {
- context = context || {};
- var env = this.toNunjucks();
-
- return Promise.nfcall(
- env.renderString.bind(env),
- content,
- context,
- {
- path: filePath
- }
- );
-};
-
module.exports = TemplateEngine;