I’m having some difficulty with $:/config/FileSystemPaths - maybe someone can help. The background:
-
I use the node.js
tiddlywiki ... --listen
server mechanism with lots (1000+) of individual tiddler files. I have for many years used separate collections of TiddlyWikis; call them Home, Work, Shared, Common, Projects, … -
an example of how I use these: at home I’ll run a tiddlywiki server with a
tiddlywiki.info
file in the directory named Home that has
"includeWikis": [
{"path": "../Common", "read-only": false},
{"path": "../Shared", "read-only": false}
],
-
I’ll do the same at the office with a tiddler collection in the directory named Work, and so forth: a collection of related tiddlers that I want to keep separate; and a couple of collections I want to integrate into those but in a way that I can make updates to occasionally.
-
The Shared directory hierarchy has tiddlers that I intend to be able to access from the Home, Work, or Project servers. The Common directory hierarchy has tiddlywiki macros, plugins, and such: TW configuration that change rarely but kept in one separate collection so things work the same in other collections that share Common. Any conflicts that I cause in Shared and Common I resolve via git repo conflict resolution. All this to to live by the Don’t Repeat Yourself (DRY) principle.
Here is the issue: when I make changes in Shared tiddlers the tiddler file gets removed from Shared and a new, modified version ends up in Home; or Work, etc… Similarly with configuration tiddlers in Common. I want existing tiddlers in Shared or Common, on the rare occasions when they get modified, to stay rooted in those collections.
I believe this happens because I have a $:/config/FileSystemPaths with contents
[split[ ]join[_]]
The purpose of that is so that I do not end up with tiddler filenames with spaces - which ends up happening much more frequently and is annoying in other ways.
The FileSystemPaths rule that “the first output of the first filter to produce any output is taken as a logical path to be used for the tiddler file. If the logical path has changed a new file is created and the old file is deleted.” accounts for the collection renaming. This happens, I presume, because FileSystemPath’s filter produces output even when tiddlers’ file names have already been modified, though the titles still contain (desirable) blanks.
All of this started back when TW 5.1.14 stopped automatically replacing spaces with ‘_’ characters. Some other growing pains occurred until TW 5.2.1 finally fixed some other issues and now I’m back to this last, changing root, issue.
The rule that the “first filter to produce any output” wins seems overly constraining. However, given that changing the rule is likely to be a non-starter
- is there anything I can add to $:/config/FileSystemPaths to restore the collection root?
- Is there some smarter FileSystemPaths filter I can use to see if the filename needs adjusting, not the title?
- Otherwise something like this old solution from Jeremy, which is the only comparable issue I’ve come across, might be adapted by adding a field to the many Shared and Common tiddlers; though I’m not sure how to make that abide by the first filter rule and yet leave the replace blanks filter to do its job.
Thanks for any other ideas, sorry this got so long.