mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 12:07:19 +00:00
Refactored renderTiddler() to create macro node directly
This is so that we can get rid of the Renderer() wrapper class entirely
This commit is contained in:
parent
36f61b4321
commit
b1a96d8bf5
@ -14,6 +14,7 @@ WikiStore uses the .cache member of tiddlers to store the following information:
|
|||||||
|
|
||||||
var Tiddler = require("./Tiddler.js").Tiddler,
|
var Tiddler = require("./Tiddler.js").Tiddler,
|
||||||
Renderer = require("./Renderer.js").Renderer,
|
Renderer = require("./Renderer.js").Renderer,
|
||||||
|
Dependencies = require("./Dependencies.js").Dependencies,
|
||||||
utils = require("./Utils.js");
|
utils = require("./Utils.js");
|
||||||
|
|
||||||
/* Creates a new WikiStore object
|
/* Creates a new WikiStore object
|
||||||
@ -271,9 +272,16 @@ Render a tiddler to a particular MIME type
|
|||||||
title: title of the tiddler to render
|
title: title of the tiddler to render
|
||||||
template: optional title of the tiddler to use as a template
|
template: optional title of the tiddler to use as a template
|
||||||
*/
|
*/
|
||||||
WikiStore.prototype.renderTiddler = function(targetType,title,templateTitle) {
|
WikiStore.prototype.renderTiddler = function(targetType,tiddlerTitle,templateTitle) {
|
||||||
var r = new Renderer(title,templateTitle,this);
|
// Construct the tiddler macro
|
||||||
return r.render(targetType);
|
var macro = Renderer.MacroNode(
|
||||||
|
"tiddler",
|
||||||
|
{target: tiddlerTitle, template: templateTitle},
|
||||||
|
null,
|
||||||
|
new Dependencies([],[tiddlerTitle,templateTitle]),
|
||||||
|
this);
|
||||||
|
macro.execute();
|
||||||
|
return macro.render(targetType);
|
||||||
};
|
};
|
||||||
|
|
||||||
WikiStore.prototype.installMacro = function(macro) {
|
WikiStore.prototype.installMacro = function(macro) {
|
||||||
|
Loading…
Reference in New Issue
Block a user