Passing variables containing spaces

140 views
Skip to first unread message

Dan Fjerstad

unread,
Jul 28, 2017, 3:25:41 PM7/28/17
to TiddlyWikiDev
Hi all,

I've used TW on and off for a few years now. Fairly new to tooling around in the backend, however.

My question is this:

I'm trying to make a custom new journal button. I can't seem to figure out how to pass a tiddler name containing a space in the macro.

For example: Take the core new-journal button macro, which gets the journal tags from $:/config/NewJournal/Tags. So I want to put a tag in there that contains a space, as opposed to a one-word tag like "Journal". Anything I put there, the macro will automatically interpret the spaces as delineating a separate tag. I've tried putting it in quotes ("a tag"), single quotes ('a tag'), and triple quotes ("""a tag"""). The macro never makes a tag with a space, instead making separate tags, even with quotation marks hanging off them.

Can anyone help with this? I've searched a lot, both here and in the official documentation. Unfortunately I don't find the TW documentation to be especially helpful -- it doesn't go deep enough into the myriad special formatting rules and tons of options I seemingly have to just know... For example: did you know that the list macro requires a trailing carriage return to put newlines in between each list item? That's something totally arcane I had to figure out on my own, that is nowhere to be found in the official documentation! Very weird.

Anyways, thanks in advance to anyone nice enough to give me the time of day!

Eric Shulman

unread,
Jul 28, 2017, 4:07:27 PM7/28/17
to TiddlyWikiDev
On Friday, July 28, 2017 at 12:25:41 PM UTC-7, Dan Fjerstad wrote:
I'm trying to make a custom new journal button. I can't seem to figure out how to pass a tiddler name containing a space in the macro.

For example: Take the core new-journal button macro, which gets the journal tags from $:/config/NewJournal/Tags. So I want to put a tag in there that contains a space, as opposed to a one-word tag like "Journal". Anything I put there, the macro will automatically interpret the spaces as delineating a separate tag. I've tried putting it in quotes ("a tag"), single quotes ('a tag'), and triple quotes ("""a tag"""). The macro never makes a tag with a space, instead making separate tags, even with quotation marks hanging off them.

The contents of $:/config/NewJournal/Tags is a space-separated list (a common syntax in TiddlyWiki, used in many places).  This syntax uses "doubled-square brackets" (another common TiddlyWiki syntax) to enclose titles that contain spaces.  Thus, to enter a tag value that contains a space, you would enter something like this:

SomeTag [[A Tag With Spaces]] AnotherTag

note: tag values are case sensitive

Here's a PermaLink to some of the relevant documentation on TiddlyWiki.com:



enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

Dan Fjerstad

unread,
Jul 31, 2017, 5:31:02 PM7/31/17
to TiddlyWikiDev
Thank you very much for the tips, Eric. Highly appreciated. 

P.S. Amazing site, & thanks for all you do for the TW community!
Reply all
Reply to author
Forward
0 new messages