Add new [all[tags]] filter operator

This commit is contained in:
Jermolene 2016-11-28 19:04:04 +00:00
parent c02c3a06e0
commit a3dc3b4b98
2 changed files with 29 additions and 6 deletions

View File

@ -0,0 +1,22 @@
/*\
title: $:/core/modules/filters/all/tags.js
type: application/javascript
module-type: allfilteroperator
Filter function for [all[tags]]
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.tags = function(source,prefix,options) {
return Object.keys(options.wiki.getTagMap());
};
})();

View File

@ -1,13 +1,13 @@
caption: all
created: 20140410103123179
modified: 20150220160957000
modified: 20161128185445034
op-input: ignored, unless the parameter is empty
op-output: the titles that belong to all the specified categories
op-parameter: zero or more categories
op-purpose: find all titles of a fundamental category
tags: [[Filter Operators]] [[Common Operators]] [[Selection Constructors]]
title: all Operator
type: text/vnd.tiddlywiki
caption: all
op-purpose: find all titles of a fundamental category
op-input: ignored, unless the parameter is empty
op-parameter: zero or more categories
op-output: the titles that belong to all the specified categories
The parameter specifies zero or more fundamental categories using the following syntax:
@ -21,6 +21,7 @@ The parameter specifies zero or more fundamental categories using the following
|^`orphans` |all tiddlers to which there are <<.em no>> hard links |^by title |
|^`shadows` |all the [[shadow tiddlers|ShadowTiddlers]] that exist, including any that have been overridden with non-shadow tiddlers |^no |
|^`tiddlers` |all the non-shadow tiddlers that exist |no |
|^`tags` |all the tags in use on non-shadow tiddlers |no |
If the parameter specifies more than one category, they are processed from left to right. The overall output is initially empty, and each category's output is [[dominantly appended|Dominant Append]] to it in turn. Unrecognised categories contribute nothing to the output.