2012-12-29 23:17:09 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/rendertree/renderers/macrodef.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: wikirenderer
|
|
|
|
|
|
|
|
Macro definition renderer
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
Macro definition renderer
|
|
|
|
*/
|
2013-05-15 16:32:17 +00:00
|
|
|
var MacroDefRenderer = function(renderTree,parentRenderer,parseTreeNode) {
|
2012-12-29 23:17:09 +00:00
|
|
|
// Store state information
|
|
|
|
this.renderTree = renderTree;
|
2013-05-15 16:32:17 +00:00
|
|
|
this.parentRenderer = parentRenderer;
|
2012-12-29 23:17:09 +00:00
|
|
|
this.parseTreeNode = parseTreeNode;
|
2013-05-15 16:32:17 +00:00
|
|
|
// Save the macro definition into the context of the rendertree
|
|
|
|
this.renderTree.context.macroDefinitions = this.renderTree.context.macroDefinitions || {};
|
|
|
|
this.renderTree.context.macroDefinitions[this.parseTreeNode.name] = this.parseTreeNode;
|
2012-12-29 23:17:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exports.macrodef = MacroDefRenderer
|
|
|
|
|
|
|
|
})();
|