mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-27 12:22:04 -08: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
1 changed files with 12 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue