[TW5] TiddlyWikiFolder segregation on Node.js

148 views
Skip to first unread message

jwd

unread,
Oct 9, 2016, 6:24:35 PM10/9/16
to TiddlyWiki
Over the years of using TiddlyWiki I have used a single file TW for each of a number of work projects - they are my "engineering notebooks" for those efforts. Having used the Node.js TW5 server version for a couple of months for my general purpose daylog I would like to evolve my usage and have just one Projects server; or one general purpose + projects server. My plan would be to convert the individual single project files into separate sets of tiddlers using tiddlywiki -- load. Ideally I'd like to make each into a TiddlyWikiFolder to maintain some ability to separate/organize them.  A brute force test sort of does what I want:

mkdir Projects
tiddlywiki Projects --init server
mkdir FirstProject
tiddlywiki FirstProject --init server
tiddlywiki FirstProject --load FirstProject.html
mv FirstProject Projects
mkdir SecondProject
tiddlywiki SecondProject --init server
tiddlywiki SecondProject --load SecondProject.html
mv SecondProject Projects
mkdir ThirdProject
tiddlywiki ThirdProject --init server
tiddlywiki ThirdProject --load ThirdProject.html
mv ThirdProject Projects
edit Projects/tiddlywiki.info and add
    "includeWikis": [
        "FirstProject",
        "SecondProject",
        "ThirdProject"
    ],
tiddlywiki Projects --server 8888


But I have some questions:
  1. Is there some way from the browser to differentiate which wiki the tiddlers belong to? Ideally I'd like to browse to http://localhost:8888/FirstProject for FirstProject's content; http://localhost:8888/SecondProject would have the next, etc. For the server as a whole I can set up a pathprefix; I'd like to be able to do that per TiddlyWikiFolder along with the associated $:/config/tiddlyweb/host tiddler. But those don't seem to be documented options for TiddlyWikiFolder's tiddlywiki.info files.

  2. Related, if I have tiddlers with the same title, journal entries for example, can I differentiate/access them?

  3. Is there some way to have a default-tiddler-location associated with each project? I know that seems like a stretch; but perhaps a default-tiddler-location associated with each pathprefix.

  4. Alternately, if the separate projects TiddlyWikiFolders is not going to work I suppose I could tag each tiddler to identify which wiki it originally belonged with and sort / present them post-creation by tag if need be. Any suggestions for how to accomplish that initial bulk tagging as I tiddlywiki --load them into separate tiddlers? (Hmm; maybe I need to explore tiddlywiki --setfield.)
Or maybe I am missing the intended use case for TiddlyWikiFolders? I don't think my JavaScript abilities are up to implementing these so I am hoping they align with someone's existing notions of using TW5.

Thanks for you suggestions!
Jonathan

Tobias Beer

unread,
Oct 10, 2016, 12:44:40 PM10/10/16
to TiddlyWiki
Hi Jonathan,

1) Is there some way from the browser to differentiate which wiki the tiddlers belong to? Ideally I'd like to browse to http://localhost:8888/FirstProject for FirstProject's content; http://localhost:8888/SecondProject would have the next, etc.

I think the only way to serve different wiki folders at the same time is by using multiple --server commands on different ports via tiddlywiki.info. Otherwise you have to serve them one by one. Perhaps, TiddlyDesktop can handle multiple wiki folders simultaneously.
 
2) For the server as a whole I can set up a pathprefix; I'd like to be able to do that per TiddlyWikiFolder along with the associated $:/config/tiddlyweb/host tiddler. But those don't seem to be documented options for TiddlyWikiFolder's tiddlywiki.info files.
 
Simply start your server right from the edition folder via commandline, then you don't need to specify full paths.

3) Related, if I have tiddlers with the same title, journal entries for example, can I differentiate/access them?
 
Depending on your inclusion pattern, only one will survive. Currently, afaik, the simple node.js server cannot handle multiple instances of the same tiddler (title), unfortunately... and show you that for wiki folder A) you have this version and for wiki folder B) another.

4) Is there some way to have a default-tiddler-location associated with each project? I know that seems like a stretch; but perhaps a default-tiddler-location associated with each pathprefix.

Simply create a $:/DefaultTiddlers tiddler somewhere in the tiddlers folder of your edition.

5) Alternately, if the separate projects TiddlyWikiFolders is not going to work I suppose I could tag each tiddler to identify which wiki it originally belonged with and sort / present them post-creation by tag if need be. Any suggestions for how to accomplish that initial bulk tagging as I tiddlywiki --load them into separate tiddlers? (Hmm; maybe I need to explore tiddlywiki --setfield.)

Or maybe I am missing the intended use case for TiddlyWikiFolders? I don't think my JavaScript abilities are up to implementing these so I am hoping they align with someone's existing notions of using TW5.

I would not use tagging but rather some otherwise hidden field called "origin" and then set that for all tiddlers that don't have it when importing each wiki via a some button, a list widget and action-setfield.

Best wishes,

Tobias.

Arlen Beiler

unread,
Oct 10, 2016, 9:16:17 PM10/10/16
to TiddlyWiki
I've done it, and it works fairly well. Just takes a few seconds to start the server.



--
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+unsubscribe@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/477e006a-54a2-4fdb-b688-547237dc4aa6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

jwd

unread,
Oct 10, 2016, 9:24:51 PM10/10/16
to TiddlyWiki

Thanks Tobias,

Running multiple --server commands on different ports is what I've done to a lesser degree so far: one for my general purpose work daylog and another for my 'home' collection. I was hoping there was a way to use the TiddlyWikiFolder concept as a way to avoid that and provide a middle ground between complete integration and complete separation of the work-related project tiddler collections.

I will occasionally reference one project's lessons observed in another's TiddlyWiki. But permalinks that refer to whatever port I happen to use for separate project servers is going to lead to poor URIs.

Guess I will have to roll up my JavaScript sleeves and look at an Express.js-based solution.  Thanks for the pointer Arlen!
Reply all
Reply to author
Forward
0 new messages