mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-11 09:50:27 +00:00
Add "transclude" format for the view macro
Uses the value of the field as the title of a tiddler to transclude
This commit is contained in:
parent
c73dee51e8
commit
1d6eba3071
@ -64,6 +64,18 @@ exports.executeMacro = function() {
|
||||
return link;
|
||||
}
|
||||
break;
|
||||
case "transclude":
|
||||
if(tiddler && this.params.field && (this.params.field in tiddler.fields)) {
|
||||
children = this.wiki.parseTiddler(tiddler.fields[this.params.field]).tree;
|
||||
for(t=0; t<children.length; t++) {
|
||||
childrenClone.push(children[t].clone());
|
||||
}
|
||||
for(t=0; t<childrenClone.length; t++) {
|
||||
childrenClone[t].execute(parents,this.tiddlerTitle);
|
||||
}
|
||||
return $tw.Tree.Element(this.isBlock ? "div" : "span",{},childrenClone);
|
||||
}
|
||||
break;
|
||||
case "wikified":
|
||||
if(tiddler && this.params.field === "text") {
|
||||
if(parents.indexOf(tiddler.fields.title) !== -1) {
|
||||
|
Loading…
Reference in New Issue
Block a user