Filter for cleaning the base, but keeping the basic settings.

136 views
Skip to first unread message

Mike Andyl

unread,
Jul 6, 2021, 6:58:04 AM7/6/21
to TiddlyWiki
Let's say I set everything up and want to make a new base. I want to remove only information posts, but keep all my own customizations, CSS and plugins.
Post with similar tags:
$:/tags/Stylesheet CSS
$:/tags/MenuBar
$:/tags/SideBar
...
etc

Am I thinking right? Or is it possible to clear the base faster?
And what filter is needed for this?
[all[tiddlers]] - ??? prefix[$:/]

I want to delete all my content posts, but not touch the "$:/*" tags.

David Gifford

unread,
Jul 6, 2021, 9:26:36 AM7/6/21
to TiddlyWiki
[!is[system]] in the filter tab of Advanced search. But make sure you don't have any regular tiddlers that are needed for your template (base).

Mike Andyl

unread,
Jul 6, 2021, 9:58:24 AM7/6/21
to TiddlyWiki
I tried it doesn't fit. Since many records are not related to the system. It is necessary to do on the tag, I think so. For example, new buttons with the tag  $:/tags/SideBar. This is not a system entry and it will disappear.

вторник, 6 июля 2021 г. в 16:26:36 UTC+3, David Gifford:

TW Tones

unread,
Jul 7, 2021, 4:31:29 AM7/7/21
to TiddlyWiki
I think  you are somewhat doing this around the wrong way.

Use a filter to list all your non-content tiddlers, eg the tiddler you use in the side bar etc... macros etc...
  • You may use a title prefix, tag or even a field with a value eg; project=setup then the filter [all[]project[setup]]
Then you can have a filter that lists every tiddler "[all[]!is[system]]" thing that is not in your above filter. eg; "[all[]!is[system]!project[setup]]"
Both sets of tiddlers can be exported separately and then imported into an empty.html

Regards
Tones

Mike Andyl

unread,
Jul 7, 2021, 8:13:59 AM7/7/21
to TiddlyWiki
This is understandable, but it requires additional actions. I can forget or miss something in a hurry, I cannot do it with someone else's databases or an old database, and so on. It's just that we already have the NECESSARY attribute - the beginning of the tag with "$:/".

How can I subtract all such entries from all[]!is[system] ?
It sounds very simple, can't filters really do that?

среда, 7 июля 2021 г. в 11:31:29 UTC+3, TW Tones:

TW Tones

unread,
Jul 7, 2021, 8:23:16 AM7/7/21
to TiddlyWiki
miket,

You can remove and add back

[all[]!is[system]] [tag[$:/tags/MenuBar]] [tag[$:/tags/SideBar]]

Thus above is all tiddlers except system, tiddlers adding back those tagged  $:/tags/MenuBaror  $:/tags/SideBar

Tones

Message has been deleted
Message has been deleted

Mike Andyl

unread,
Jul 7, 2021, 9:59:31 AM7/7/21
to TiddlyWiki
Ok, but I can skip and delete something I want anyway. Forget the important tag in a year or two :)

I have a list of tags [tags[]prefix[$:/]]
Can I wrap it like a <list>? Make a button action so it can process in a loop?
<$action-deletetiddler...

Something like this, but I'm confused about the variables again.
Why isn't -[tag[<<TagToDelete>>]] working?

<$list filter="[tags[]prefix[$:/]]" variable="TagToDelete">
  <br><<TagToDelete>><br>
  <$list filter="[all[]!is[system]] -[tag[<<TagToDelete>>]]" variable="tidToDelete">
    <<tidToDelete>><br>
  </$list>
</$list>


среда, 7 июля 2021 г. в 15:23:16 UTC+3, TW Tones:

Mike Andyl

unread,
Jul 8, 2021, 5:21:37 AM7/8/21
to TiddlyWiki
I realized that the task is more difficult. It is necessary not only to process it in a loop, but to form a new line with all the tags.
Can TiddlyWiki work with strings? I have not found such examples anywhere.
In another language, I would do this:

t = "[all[]!is[system]]"

<$list filter="[tags[]prefix[$:/]]" variable="TagToDelete">
    t = t + " -[tag[" + <<TagToDelete>> + "]]"
</$list>

<$list filter= t variable="tidToDelete">
    <$action-deletetiddler $tiddler=<<tidToDelete>>/>
</$list>

среда, 7 июля 2021 г. в 16:59:31 UTC+3, Mike Andyl:

Eric Shulman

unread,
Jul 8, 2021, 6:08:17 AM7/8/21
to TiddlyWiki
On Thursday, July 8, 2021 at 2:21:37 AM UTC-7 miket...@gmail.com wrote:
I realized that the task is more difficult. It is necessary not only to process it in a loop, but to form a new line with all the tags.

If I understand your goal, you want to identify all tiddlers that are not system tiddlers, excluding those that have a tag that starts with $:/
Here's the filter syntax that does that:

[all[]!is[system]] -[tags[]prefix[$:/]tagging[]]

Then, you want to delete all tiddlers matching that filter.
You can do this directly using the filter tab in $:/AdvancedSearch.
Just enter the filter syntax as shown above and then press the delete button (trash can icon)

You can also do this by defining a $button that triggers $action-deletetiddler using a $filter parameter rather than a $tiddler parameter, like this:
<$button> delete content
   <$action-deletetiddler $filter="[all[]!is[system]] -[tags[]prefix[$:/]tagging[]]" />
</$button>

enjoy,
-e

Eric Shulman

unread,
Jul 8, 2021, 6:22:52 AM7/8/21
to TiddlyWiki
On Thursday, July 8, 2021 at 3:08:17 AM UTC-7 Eric Shulman wrote:
Then, you want to delete all tiddlers matching that filter.
You can do this directly using the filter tab in $:/AdvancedSearch.
Just enter the filter syntax as shown above and then press the delete button (trash can icon)

Addendum: You can also save the desired filter syntax and re-use it later:
1) Create a tiddler tagged with $:/tags/Filter
2) Add a field named "description" with a value of: All Content Tiddlers
3) Add a field named "filter" with a value of: [all[]!is[system]] -[tags[]prefix[$:/]tagging[]]
4) Add a field named "list-before" with a blank field value

Then, in the $:/AdvancedSearch filter tab, you can press the "down arrow" next to the filter edit field to see
a list of pre-defined filters and select "All Content Tiddlers" which will appear as the first item in the list.

-e

Mike Andyl

unread,
Jul 8, 2021, 10:09:08 AM7/8/21
to TiddlyWiki
This looks just what it needs! This is what I meant at the beginning.

But for the sake of curiosity 🤓 . I tried to do through the list.

filter="[tags[]prefix[$:/]]"

Is it possible to make a variable in a list that will collect all the values?
[all[]!is[system]] + '-[tag[*list result*]]'
+ '-[tag[*list result*]]'
+ '-[tag[*list result*]]'
...


And you get something like
<<myVar>>  = [all[]!is[system]] -[tag[$:/tags/Stylesheet]] -[tag[$:/tags/PluginLibrary]] -[tag[$:/tags/Macro]] -[tag[$:/tags/Palette]]
And <$list filter=<<myVar>>

-----
Or in another way. I can do tiddler "Sys Tag" only with a filter

[all[]!is[system]]
<$set name="myVar" filter="[tags[]prefix[$:/]]">
<$list filter=<<myVar>>> -[tag[<$link/>]]</$list>
</$set>


And one more with a button. Can I link to text from another post as a filter?

<$button>
  <$list filter={{Sys Tag}} variable="tidToDelete">

    <$action-deletetiddler $tiddler=<<tidToDelete>>/>
  </$list>
  DEL!
</$button>


четверг, 8 июля 2021 г. в 13:22:52 UTC+3, Eric Shulman:
Reply all
Reply to author
Forward
0 new messages