Common three character tiddler title prefix "$:/"

Something that’s bothered me for a while now.

Why do we have the three character prefix $:/ on so much of the workings ?

Jon

To make sure we can tell tiddlers wot does stuff apart from content!

I get that but why three characters that are always the same ?

If they’re always those three then why not one character instead ?

Just experiment with the setting at https://tiddlywiki.com/#%24%3A%2Fconfig%2FSearch%2FMinLength and see what happens???

For or against your needs?

Best, TT

In general, TiddlyWiki uses the dollar sign to loosely indicate “system”: areas of the syntax that are advanced or involved TiddlyWiki’s internals.

We use the three character sequence “$:/” to identify system tiddlers so as to reduce the likelihood of end users using the prefix by chance. Any single character that we chose instead would be liable to clash with some end user. For example, if we used slash “/” then we’d be getting in the way of anyone using TiddlyWiki to document Unix-like paths. Or if we used dollar “$” then we’d clash with people documenting Bash environment variables.

4 Likes

Tsk. Should have used $:@!@#THISISASYSTEMTIDDLER#@!@/ to really, really, REALLY make it clear.

(I’ll get my coat). :blush:

So it’s more an arbitrary choice and not in any way tied to the syntax of JavaScript allowing some sort of referencing expression doohickey.

I don’t think it is other than advisable?

@jeremyruston tends to be very on that ball on these kind of issues.

In the UK you’d say he is "conservative with a small ‘c’. "

I just think he is exceptionally astute and has protected TW from problems by guarding against all manner of other syntaxes.

Just a naïve comment
TT

That’s correct.

I chose $:/ primarily because I wanted to use / as a separator to make a hierarchy, and the resulting tiddler titles resemble old school DOS pathnames (eg $:/core/ui/PageTemplate vs. A:/core/ui/PageTemplate)

I only noticed later that $:/ can, to those determined enough, look like an emoticon of a person with curly hair and a lopsided mouth.

The only effect of naming a tiddler as a system tiddler is to hide it from the regular lists and searches, which is intended to help keep implementation details out of the way of casual users. It is a matter for the authors discretion whether or not to make a particular tiddler be a system tiddler.

2 Likes

I am always stuck by your foresight.
It seems exceptional?

Just saying, TT

When I was a tech trainer for a UK-based Wall St financial services company, I enjoyed hassling our UK trainers, that for the Unix (linux) shell and other scripting languages the dollar sign was the preferred preface for “the value of something”. This more than made up for certain spelling challenges. :grinning: This part of the reason why “a single character is never enough”

1 Like

Oh yeah! I’d not seen that! :smiley:

As @jeremyruston said the systems tiddlers start with the first, top or root item “/” and subtiddlers exist below that, just look under the Search Shadow tiddlers to see how that is put to use, and yes, be it windows, Dos or linux many of us are already familiar with file and folder structures like this even with the “/” delimiter. Because we also use $: we are free to create a tiddler called “/” if we wanted.

The thing about this three letter prefix is it has many values, first $ is an S for “system” without confusing it with tiddlers using “S” but because $ is followed by “:” we don’t confuse it with “$”.

An important point is this “$:/” represents a “name space” within which code, core, User interface, plugins etc… can be stored “just out of view”. However we can manufacture our own namespaces for whatever purpose we see fit. We could even hide them from the default search if we wanted.

$:/ reminds me of a shebang, a Linux command prompt, or a Windows path, so I intuitively think of it as something that has to do with the system itself.

For example, when I log into my Linux server and enter the “blog” directory, the prompt where I can enter commands looks like this:

cdaven@oasis:~/blog$

A path on Windows looks like C:\Users\Cdaven (on Linux it’s /home/cdaven instead).

And a shebang at the top of Bash scripts looks like this:

#!/bin/bash

Just saying, I think it works.

1 Like

Perhaps foresight in this context is relative. @jeremyruston might have had an issue prior to TW where he wished he had isolated systemic content from regular content. By the time he started TW, he was using hindsight as a way to handle it.

tldr: Young Jeremy’s hindsight equals older Jeremy’s foresight.

1 Like

It also allows the FileSystem plugin to cleanly separate these when saving as individual text-files on disk. Which can be VERY useful when you are hunting for an overridden shadow tiddler in the system namespace.