UNPKG

662 BJavaScriptView Raw
1var exports = module.exports;
2
3/**
4 * trigger the load of FIS, it means add a js/css file to the page.
5 *
6 * @alias require
7 *
8 * @example
9 * // if `namespace` = `user`
10 * // load mod.js
11 * {%require "user:static/mod.js"%}
12 *
13 * @param {string|var} id the resource `id` of the FIS system.
14 */
15exports.compile = function(compiler, args, content, parents, options, blockName) {
16 var code = '_ctx._yog.load(' + args.pop() + ');'
17 return code;
18};
19
20exports.parse = function(str, line, parser, types) {
21 parser.on(types.STRING, function (token) {
22 var self = this;
23 self.out.push(token.match);
24 });
25 return true;
26};
27
28exports.ends = false;
\No newline at end of file