2014-11-10 20:59:15 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/macros/jsontiddlers.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: macro
|
|
|
|
|
|
|
|
Macro to output tiddlers matching a filter to JSON
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
Information about this macro
|
|
|
|
*/
|
|
|
|
|
|
|
|
exports.name = "jsontiddlers";
|
|
|
|
|
|
|
|
exports.params = [
|
2020-02-04 13:57:24 +00:00
|
|
|
{name: "filter"},
|
|
|
|
{name: "spaces"}
|
2014-11-10 20:59:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
/*
|
|
|
|
Run the macro
|
|
|
|
*/
|
2020-02-04 13:57:24 +00:00
|
|
|
exports.run = function(filter,spaces) {
|
2020-04-15 14:27:53 +00:00
|
|
|
return this.wiki.getTiddlersAsJson(filter,$tw.utils.parseInt(spaces));
|
2014-11-10 20:59:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
})();
|