1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00
TiddlyWiki5/js/macros/tiddler.js
Jeremy Ruston 9a73b0a6aa Rejigged macro implementation
Now each macro is in a separate file, and is implemented as a function,
rather than being inlined into the compiled tiddler rendering function
2012-01-07 17:33:42 +00:00

26 lines
534 B
JavaScript

/*\
title: js/macros/tiddler.js
\*/
(function(){
/*jslint node: true */
"use strict";
var utils = require("../Utils.js");
exports.macro = {
name: "tiddler",
types: ["text/html","text/plain"],
cascadeParams: true, // Cascade names of named parameters to following anonymous parameters
params: {
target: {byName: "default", type: "tiddler", optional: false},
"with": {byName: true, type: "text", optional: true}
},
code: function(type,tiddler,store,params) {
return store.renderTiddler(type,params.target);
}
};
})();