1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-10-05 18:30:46 +00:00
TiddlyWiki5/rabbithole/core/modules/macros/include.js

38 lines
711 B
JavaScript
Raw Normal View History

/*\
2012-05-05 10:57:08 +00:00
title: $:/core/modules/macros/include.js
type: application/javascript
module-type: macro
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
exports.info = {
2012-05-05 10:57:08 +00:00
name: "^",
params: {
filter: {byPos: 0, type: "filter"},
2012-05-05 10:57:08 +00:00
as: {byPos: 1, as: "text"}
}
};
exports.executeMacro = function() {
var as = this.params.as || "text/plain";
if(this.hasParameter("filter")) {
var titles = this.wiki.filterTiddlers(this.params.filter),
result = [];
for(var t=0; t<titles.length; t++) {
result.push(this.wiki.serializeTiddler(this.params.filter,as));
2012-05-05 10:57:08 +00:00
}
return [$tw.Tree.Element("pre",{},[
$tw.Tree.Text(result.join("\n"))
])];
2012-05-05 10:57:08 +00:00
}
return [];
};
})();