mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
Storing these in Git seems kind of weird, but seems to be [1] the done thing. I have to say, it's a lot more appealing than getting 3 packages from npm installed globally on every prod and dev machine -- we already have too much of that with 'pip install'. We can upgrade these in the future by running 'npm update' in the repo root directory. [1] http://www.futurealoof.com/posts/nodemodules-in-git.html (imported from commit 60a9d6a7cafe742442d87e9f3abc25750e179780)
25 lines
517 B
JavaScript
25 lines
517 B
JavaScript
var handlebars = require("./parser");
|
|
|
|
exports.attach = function(Handlebars) {
|
|
|
|
// BEGIN(BROWSER)
|
|
|
|
Handlebars.Parser = handlebars;
|
|
|
|
Handlebars.parse = function(input) {
|
|
|
|
// Just return if an already-compile AST was passed in.
|
|
if(input.constructor === Handlebars.AST.ProgramNode) { return input; }
|
|
|
|
Handlebars.Parser.yy = Handlebars.AST;
|
|
return Handlebars.Parser.parse(input);
|
|
};
|
|
|
|
Handlebars.print = function(ast) {
|
|
return new Handlebars.PrintVisitor().accept(ast);
|
|
};
|
|
// END(BROWSER)
|
|
|
|
return Handlebars;
|
|
};
|