String replace in Filter chain, for Tiddler File Naming?

84 views
Skip to first unread message

MidnightLightning

unread,
Mar 26, 2019, 10:16:10 AM3/26/19
to TiddlyWiki
I'm attempting to create a $:/config/FileSystemPaths entry to set up my Tiddler file naming the way I want. The example config has [is[system]removeprefix[$:/]addprefix[_system/]] as a way to cluster all system Tiddlers together under a folder, but that config creates a series of nested folders under the "_system" folder based on the name of the tiddler (so the $:/config/FileSystemPaths entry itself gets saved under "_system/config/FileSystemPaths.tid").

What I'm wanting to do is have $:/config/FileSystemPaths end up under "_system/config_FileSystemPaths.tid". Meaning, have all of them one folder deeper (to get them out of the way when editing other tiddlers manually), but not have a deeply-nested tree, since that gets hard to find things, when you're dealing with parameters like $:/config/PageControlButtons/Visibility/$:/core/ui/Buttons/home.

The documentation of the FileSystemPaths config says that the default action is to have Tiddlers' "/" characters replaced with "_", but it doesn't do that string replacement if one of the filter rules matches. I can't seem to find a way to replicate that default behavior using filters? I think I need something like:

[is[system]removeprefix[$:/]replaceslashes[_]addPrefix[_system/]]

But nothing like "replaceslashes" or other "replace in string" modifiers seem to exist?

Leander

unread,
May 29, 2020, 5:29:04 PM5/29/20
to tiddl...@googlegroups.com
Kind of a late reply, but what you're looking for is

[is[system]removeprefix[$:/]split[/]join[_]addprefix[_system/]]
Reply all
Reply to author
Forward
0 new messages