[tw5] is it possible to configure TiddlyWiki on Node.js to store tiddler files in the same directory as the wikifolder?

86 views
Skip to first unread message

ch

unread,
Oct 4, 2018, 12:33:37 PM10/4/18
to tiddl...@googlegroups.com
hi,

this is a feature i've wanted for a long time but never asked the friendly TiddlyWiki community for help, but i really need your help with this question - because i don't know how to accomplish this feature.

- if you already understand what i want to accomplish, you can stop reading here - if not, continue to read my elaborated example below:


so, the help option for running TiddlyWiki on Node.js gives you:

$ tiddlywiki --help
usage: tiddlywiki [<wikifolder>] [--<command> [<args>...]...]

...and once you have initialized your demo wiki with:

$ tiddlywiki demo --init server

...you can startup your new TiddlyWiki with:

$ tiddlywiki demo --server

...and visit http://127.0.0.1:8080/ in your favorite browser and start editing and creating tiddlers.

by default, the configuration for storing tiddlers are always in the "<wikifolder>/tiddlers", i.e. in this case "demo/tiddlers" - i want the tiddlers to be stored in the wikifolder (or another named directory, for example "src" or "doc"), i.e. in this case the "demo" directory - is that possible? i've never stumbled on any configuration option that makes this possible.

if this is an easy configuration option - i also want it to be compatible with customising tiddler file naming, i.e.



kind regards,

ch

Xavier Cazin

unread,
Oct 7, 2018, 6:12:38 AM10/7/18
to tiddl...@googlegroups.com
Hello ch,

Maybe you can try to set a default-tiddler-location configuration option to  ".." in the tiddlywiki.info file (see https://tiddlywiki.com//#tiddlywiki.info%20Files) ?

Regards,
-- Xavier Cazin


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/CALyWh22Khp2RJmTjAbF6PrJ4%2Bqyu34ReZLYKmgR3cnv5LiuuWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Xavier Cazin

unread,
Oct 7, 2018, 6:14:44 AM10/7/18
to tiddl...@googlegroups.com
Hi ch,

I meant to ".", not to "..", sorry.

-- Xavier

ch

unread,
Oct 8, 2018, 7:33:02 AM10/8/18
to tiddl...@googlegroups.com
hi xavier,

thanks for the pointer to the default-tiddler-location in the tiddlerwiki.info file (i didn't know it existed)... however, it that option doesn't work at all with Tiddlywiki on Node.js!

if a configure like this:

    "config": {
        "default-tiddler-location": "tiddlers"
    },

i.e. which is the "default" configuration - everything works as expected (with or without customising tiddler file naming)

so, then i tried to change from "tiddlers" to "tiddlers2" without "customising tiddler file naming":

i.e.

    "config": {
        "default-tiddler-location": "tiddlers2"
    },

then, the "story list" (i.e. "$__StoryList.tid") is not handled correctly, nor any other TiddlyWiki configurations you can do, like "default tiddlers" (i.e. "$__DefaultTiddlers.tid") once i refresh (or restart the Node.js session) - tiddlywiki doesn't seem to recognise the "story list", so it creates another one named "$__StoryList 1.tid"), and another file for the "default tiddlers" named "$__DefaultTiddlers 1.tid"...

so, the "default-tiddler-location" configuration option in the "tiddlywiki.info" file is sadly broken :-(

i've tested this with Node.js ver 8.11.1 on Tiddlywiki ver 5.1.17 for Windows 7 (the target platform i need to get this working on).

i also tried "customising tiddler file naming", but that's broken as well (the "$:/config/FileSystemPaths.tid" seem to be completely ignored).

but, if i put a "$:/config/FileSystemPaths.tid" file in directory "tiddlers/_system/config" with "default-tiddler-location" set to "tiddlers2", and the content of "FileSystemPaths.tid" is:

```
[is[system]removeprefix[$:/]addprefix[_system/]]
[!has[draft.of]]
```
the "customising tiddler file naming" seem to work (the tiddlers are stored in directory hierarchy as configured by the "$:/config/FileSystemPaths.tid" file), but suffers from the same problem as mentioned above with the "story list" - so that's broken, as well.

i didn't bother to get "default-tiddler-location" set to "." to work (which is what i want), since this configuration i've used in this example must work before i change the "default-tiddler-location" to the current directory...

cheers!


Jeremy Ruston

unread,
Oct 8, 2018, 7:43:01 AM10/8/18
to tiddl...@googlegroups.com
Hi ch

I’m afraid that default-tiddler-location only affects the location for saving new tiddlers; it doesn’t affect the location from which tiddlers are read at startup. The docs could perhaps be clearer:


I don’t think that the core currently supports what you’re trying to achieve, but there has been some recent discussion on GitHub that is relevant:


What is your motivation for the change?

Many thanks,

Jeremy.

Xavier Cazin

unread,
Oct 13, 2018, 2:02:12 PM10/13/18
to tiddl...@googlegroups.com
Hi ch, Jeremy,

Out of curiosity, I added a minimal tiddlywiki.files file in a tiddlers subfolder, in order to tell TiddlyWiki 5 that it can also find tiddlers in the alternate directory. Like so:

cat tiddlers/alternate/tiddlywiki.files
{
    "directories": [
        {
          "path": "../../tiddlers2",
          "isTiddlerFile": "true"
        }
    ]
}


This almost works as you wanted, but it still misses the ability to delete tiddlers in the alternate directory. You'll probably find that more frustrating than useful, sorry ;-)

-- Xavier Cazin


Mark S.

unread,
Oct 13, 2018, 4:09:12 PM10/13/18
to TiddlyWiki
I don't think it would be safe to wrap <dir>/tiddlers back to <dir>, but it might be possible to relocate <tiddlers> somewhere else using junctions under windows or symbolic links under linux (and I assume Mac).

-- Mark
Reply all
Reply to author
Forward
0 new messages