Doubts regarding framing of tiddler titles without spaces

I have some doubts regarding framing of tiddler titles.

  1. Should space be avoided in tiddler titles.
    Recently following a discussion with @Mark_S I started avoiding spaces within tiddler titles, mainly because my local media files are named based on the corresponding tiddler titles. I had got advice from @Mark_S and previously from @buggyj to avoid space within file-names. For the sake of uniformity I tried to avoid spaces in all of my tiddler titles.
  2. If spaces are to be avoided in tiddler-titles, how to make the titles readable.
    I was using hyphen and underscore for this purpose after reading through an article shared in this discussion. Is underscore safe to be used in tiddler titles ?
  3. Will this PR affect my tiddler naming pattern once it is merged ?

I don’t see any issue with spaces in tiddler titles—for one thing, it’s extremely common on tiddlywiki.com.

If you want to avoid spaces in local file names, it shouldn’t be too difficult to convert a tiddler title (with spaces) to a file name (without spaces). For instance, if you wanted to use hyphens in place of spaces:

\function fileName() [<currentTiddler>search-replace:g[ ],[-]]

You could use the same strategy to replace spaces with underscores, or just eliminate them entirely (or to make the title lowercase, or sentence-case, or whatever other transformations you like.)

The characters you should avoid in tiddler titles are listed in the warning message that comes up in edit view when you attempt to add one of them to a title: | [ ] { } I’d probably also include < >, just to be safe.

2 Likes

We backed this out because it had problems exactly in the case of the use of underscores in titles and at that point it was too close to the release. After 5.3.2, I will fix it up to work either way.

They aren’t, and haven’t been for a long time.

1 Like

They’re not to be avoided. I think you should read Mark’s point again. If anything, he’s talking about your use of Markdown.

Thank you all for clearing my doubts.

I think Mark was referring to avoiding spaces in filenames (of my local media files).
I use tiddlyclip for adding local images to my wiki from screenshots. Naming of these image files occurs automatically while clipping and saving using the rule I have set (its a great time saver for me). This naming rule is set such that filename of the images will be based on the title of the tiddler into which the images are being embedded as external images. That’s why I thought of avoiding spaces in the tiddler titles. I will have to check whether tiddlyclip rule for naming of image files can be modified such that spaces in the tiddler title will be removed and replaced with hyphen or underscore when its used for naming of the image file. Since this rule was created sometime back, I don’t exactly remember the details. I will have to check that out.

I am actually liking this approach of replacing spaces in tiddler titles with hyphen or underscores after using it for some months. Especially for compound titles.

Now I will re-frame my question like this - Will hyphens and underscores in tiddler titles create problems in the future if used instead of spaces?

No.     

1 Like

They shouldn’t. But if my Permalink PR gets completed and included, the hyphens will have slightly nicer Permalink URLs than ones with underscores.

1 Like

If you’re converting images into external tiddlers via BJ’s clipper, then the question would be, how are you using those external tiddlers (presumably canonical uri), and what happens to them after markdown conversion? That wasn’t a scenario we discussed in the prior thread. It would be worth a quick test.

On the disk, unless the converter or the markdown parser is improved, you kind of need to eliminate spaces. I usually use hyphens, because an underlined text with an underscore hides the underscore, and because a hyphen is 40% easier to type.

Once you bring the file into TW (assuming as a canonical uri tiddler) then you can change the title into whatever you want, just as long as the _canonical_uri field stays the same. I think. Once again, it depends how you’re using the tiddler.

  • I am using hyphen instead of spaces if the tiddler title is simple
  • If tiddler title is compound / complex, I am adding underscore to connect unrelated words and hyphen to connect related words.

Here is an example of a compound title - subependymal-enhancement_tweet_daniel_gewolb - here subependymal-enhancement is the topic, daniel_gewolb is the tweet author and tweet to denote that this note was taken from a tweet.

You can see that I am using [img[] format to show external images in my wiki using relative path.

On pressing the md-conversion button - this happens

You can see that since I have no space in filename of my external images, conversion happens correctly. It is for this conversion that I am avoiding spaces in tiddler titles - see that my images have filenames based on the tiddler titles. I don’t use separate tiddlers for each images. But i will try that approach also when I get time because I will have to modify the tiddlyclip rules accordingly. Currently I am not saving any metadata for images. So this approach is fine for me.

But the fact is that I haven’t used markdown much after our previous discussion because

  1. I had issue with conversion of images due to space in filenames
  2. some issues with markdown editor autolist plug-in
  3. since section editor won’t work with markdown.
  4. one more reason which I don’t remember correctly now.

But I had changed my approach to naming of tiddler from that time itself. Yesterday when you reminded only I went back to my old wiki to try the wikitext-md-conversion and wikitext-md conversion buttons. I am happy that both buttons are working perfectly now as shown in the screenshots given above.

Thanks @Mark_S for creating that wikitext-md-conversion button based on cdavens plug in. I don’t think you are using markdown now, because you are usng section-editor now.

Oh, I wasn’t aware. But it makes sense – there’s a special template for sections. There would have to be a another template for markdown sections. Not to mention changing the indenture to recognize # symbols. Which gets back to the sectionizer project, I think.

I had problems with the auto-list I was using. Think it interfered with codemirror. Having all the features of codemirror seemed more important than auto-list. I can type - or * easily enough.

FWIW I.use.decimals.instead.of.hyphens.