From 1f0149c78573a16149538dd163eefc94b18a5903 Mon Sep 17 00:00:00 2001 From: linonetwo Date: Wed, 17 Apr 2024 19:46:54 +0800 Subject: [PATCH] fix: add in-tagtree-of for FileSystemPaths --- tiddlers/$__plugins_linonetwo_in-tagtree-of.json | 16 ++++++++++++++++ tiddlers/FileSystemPaths.tid | 3 --- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tiddlers/$__plugins_linonetwo_in-tagtree-of.json delete mode 100644 tiddlers/FileSystemPaths.tid diff --git a/tiddlers/$__plugins_linonetwo_in-tagtree-of.json b/tiddlers/$__plugins_linonetwo_in-tagtree-of.json new file mode 100644 index 0000000..fcfad4e --- /dev/null +++ b/tiddlers/$__plugins_linonetwo_in-tagtree-of.json @@ -0,0 +1,16 @@ +[ + { + "author": "LinOnetwo", + "core-version": ">=5.1.22", + "dependents": "", + "description": "Finds out where a tiddler originates from, is it in a tag tree with xxx as root?", + "list": "readme", + "plugin-type": "plugin", + "text": "{\"tiddlers\":{\"$:/plugins/linonetwo/in-tagtree-of/readme\":{\"title\":\"$:/plugins/linonetwo/in-tagtree-of/readme\",\"creator\":\"LinOnetwo\",\"type\":\"text/vnd.tiddlywiki\",\"text\":\"A very fast version of `kin::to[xxx]`.\\n\\n> Finds out where a tiddler originates from, is it in a tag tree with xxx as root?\\n\\n!! Usage\\n\\nSee [[demo site|https://tiddly-gittly.github.io/in-tagtree-of/]] for interactive examples.\\n\\n!!! Normal usage\\n\\n`[[Ling]in-tagtree-of[Clancy]]` : check if `Ling` is ''in a tag tree'' with `Clancy` as root.\\n\\n`[all[tiddlers]!in-tagtree-of[Clancy]]` : with `!` prefix, get all tiddlers that are ''not'' in a tag tree with `Clancy` as root.\\n\\n!!! Advanced usage\\n\\n`[all[tiddlers]in-tagtree-of:inclusive[Clancy]]` : with `inclusive` suffix, get all tiddlers that are ''in a tag tree'' with `Clancy` as root, ''including `Clancy` himself''\\n\\n!!! With macro\\n\\n```tw5\\n\\n\\\\define get-non-completed-leaf-tasks() [in-tagtree-of!filterfilter]\\n\\n\\\\define caption() ToDos <$count filter=<> />\\n<$macrocall $name=aggregation caption=<> filter=<> defaultFields=\\\"title tags\\\" class=\\\"w-100\\\" state=\\\"ITKG-TaskDynamicTable-state\\\" />\\n```\\n\\n!! Difference from taggingtree\\n\\n[[taggingtree|https://talk.tiddlywiki.org/t/recursive-filter-operators-to-show-all-tiddlers-beneath-a-tag-and-all-tags-above-a-tiddler/3814]] is a [[Selection Constructors|https://tiddlywiki.com/#Selection%20Constructors]], thus can not be used in cascade or FileSystemPaths. See [[How to test filesystempath easily|https://talk.tiddlywiki.org/t/how-to-test-filesystempath-easily/6353]] for details.\"},\"$:/plugins/linonetwo/in-tagtree-of/index.js\":{\"creator\":\"LinOnetwo\",\"title\":\"$:/plugins/linonetwo/in-tagtree-of/index.js\",\"type\":\"application/javascript\",\"module-type\":\"filteroperator\",\"Modern.TiddlyDev#Origin\":\"index.ts\",\"text\":\"\\\"use strict\\\";function getTiddlersRecursively(e,i){const t=new Set($tw.wiki.getTiddlersWithTag(e));0{t.has(e)&&t[\\\"delete\\\"](e)}):t.forEach(e=>{i.has(e)&&t[\\\"delete\\\"](e)})),t.forEach(e=>i.add(e)),t.forEach(e=>{getTiddlersRecursively(e,i)}))}exports[\\\"in-tagtree-of\\\"]=function inTagTreeOfFilterOperator(e,i){var t;const r=i.operand;var s=\\\"inclusive\\\"===i.suffix,a=\\\"!\\\"===i.prefix;const l=new Set;let n;if(e((e,i)=>{l.add(i),void 0===n&&(n=e)}),1===l.size&&!a){var[d]=l;if(!0===(null==(t=null==(t=null==n?void 0:n.fields)?void 0:t.tags)?void 0:t.includes(r)))return[d];if(s&&d===r)return[d]}const o=$tw.wiki.getGlobalCache(\\\"in-tagtree-of-\\\"+r,()=>{var e=new Set;return getTiddlersRecursively(r,e),e});return s&&o.add(r),a?[...l].filter(e=>!o.has(e)):[...l].filter(e=>o.has(e))};\"}}}", + "title": "$:/plugins/linonetwo/in-tagtree-of", + "type": "application/json", + "version": "0.2.0", + "Modern.TiddlyDev#SHA256-Hashed": "2da9b66ac9b7fd8d4bfe5aa16a2ad40d7069e403027ccf090648584b467b183c", + "name": "in-tagtree-of" + } +] \ No newline at end of file diff --git a/tiddlers/FileSystemPaths.tid b/tiddlers/FileSystemPaths.tid deleted file mode 100644 index 04d8492..0000000 --- a/tiddlers/FileSystemPaths.tid +++ /dev/null @@ -1,3 +0,0 @@ -tags: $:/plugins/linonetwo/sub-wiki/readme -title: $:/config/FileSystemPaths -type: text/vnd.tiddlywiki