Skip to content

Commit

Permalink
Add new [all[tags]] filter operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Jermolene committed Nov 28, 2016
1 parent c02c3a0 commit a3dc3b4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
22 changes: 22 additions & 0 deletions core/modules/filters/all/tags.js
@@ -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());
};

})();
13 changes: 7 additions & 6 deletions editions/tw5.com/tiddlers/filters/all.tid
@@ -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:

Expand All @@ -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.

Expand Down

0 comments on commit a3dc3b4

Please sign in to comment.