Automatic creating of tiddlers if missing?

225 views
Skip to first unread message

David Gifford

unread,
Feb 2, 2020, 11:23:29 AM2/2/20
to TiddlyWiki
Hi all

Is there a way to configure TiddlyWiki or a plugin, so that when closing a link (]]), if the tiddler does not exist, one is automatically created? Of course I am thinking of TiddlyBlink - this would replicate a very handy, time-saving feature of Roam. There would be no need to click edit then click save changes for each tiddler.

Mat

unread,
Feb 2, 2020, 2:33:31 PM2/2/20
to TiddlyWiki
IF what you mean is to click a missing title and that action makes the tiddler exist, then maybe you'll find the NewTids relevant. It is intended as a way to easily create multiple tiddlers from e.g a list and as such it also shows a small settings "panel". This could be remade to not show any panel above the missing tiddler/s but to only have the missing tiddler show its title like normal, i.e when clicking the missing title it comes to into existance. It would however in edit mode require you to write the missing name like so <<create "MyTiddler">> instead of the normal [[MyTiddler]], i.e as a macro call.
Is this kind of what you mean?

<:-)

Eric Shulman

unread,
Feb 2, 2020, 3:29:04 PM2/2/20
to TiddlyWiki
On Sunday, February 2, 2020 at 8:23:29 AM UTC-8, David Gifford wrote:
Is there a way to configure TiddlyWiki or a plugin, so that when closing a link (]]), if the tiddler does not exist, one is automatically created? Of course I am thinking of TiddlyBlink - this would replicate a very handy, time-saving feature of Roam. There would be no need to click edit then click save changes for each tiddler.

As you know, TiddlyWiki already allows you to enter [[NameOfTiddler]] to create a link to a "missing" tiddler.
The only difference in appearance is that the link is shown using italics.

Following that link still opens the tiddler, just as if it exists.
The only differences in appearances are:
* the tiddler title is shown using italics
* it does not display a "modified" date (the tiddler subtitle)
* it shows default fallback text of: Missing tiddler "SomeTiddler" – click to create.

So... to make missing tiddlers look the same as existing tiddlers, all you need to do is make a few minor adjustments:

1) remove the italics from the link display and the tiddler title display by creating a tiddler, tagged with $:/tags/Stylesheet, containing:
a.tc-tiddlylink-missing
   
{ font-style:initial; }
.tc-tiddler-missing .tc-title
   
{ font-style:initial; font-weight:300; }

2) remove the default fallback text for missing tiddlers by editing $:/language/MissingTiddler/Hint

Of course, a missing tiddler still won't appear in lists of existing tiddlers (e.g., the sidebar "recent" tab),
and this *might* be an issue for lists of links shown by TiddlyBlink but, as I am not familiar with the
inner workings of TiddlyBlink, I leave this to you to determine.

hope this helps,
-e


David Gifford

unread,
Feb 2, 2020, 6:43:12 PM2/2/20
to TiddlyWiki
Hi Mat and Eric, thanks for the responses. Neither are what I mean. Mat's solution with a different syntax would undermine the advantage gained by using comptext autocomplete. Eric's suggestion is something I already knew about and played with, and had even changed the CSS for, last week. But in the end I decided against it because even I was getting confused. I couldn't find references to tiddlers in lists, and realized those tiddlers don't exist. So I went back to normal CSS for missing tiddlers.

I just meant that if there were a way for closing a link to a missing tiddler to trigger TW into creating an actual tiddler. Would save two steps. But I realize I am asking for the moon on this one.

The behavior in Roam research is interesting: click [[, and the closing ]] is automatically inserted after the cursor. Start typing, one character, and a dropdown list of your Roam pages appears, and the list gets filtered as you type. Hit enter, and the cursor jumps to just after the ]] . And the page for whatever you typed already exists as a page in Roam. It's really intuitive and saves steps. I figured it didn't hurt to ask.

Mat

unread,
Feb 2, 2020, 7:04:44 PM2/2/20
to TiddlyWiki
David Gifford wrote:
I just meant that if there were a way for closing a link to a missing tiddler to trigger TW into creating an actual tiddler. Would save two steps. But I realize I am asking for the moon on this one. 

AFAIK, the editor is totally passive.
 
The behavior in Roam research is interesting: click [[, and the closing ]] is automatically inserted after the cursor. Start typing, one character, and a dropdown list of your Roam pages appears, and the list gets filtered as you type. Hit enter, and the cursor jumps to just after the ]] . And the page for whatever you typed already exists as a page in Roam. It's really intuitive and saves steps. I figured it didn't hurt to ask.


That sounds super. You should express support for this proposal: https://github.com/Jermolene/TiddlyWiki5/issues/3784 As I note there: "This would make the editor support the very process of authoring and editing! The current editor merely enables authoring/editing.

<:-)

Diego Mesa

unread,
Feb 2, 2020, 7:41:07 PM2/2/20
to TiddlyWiki
Yes!! David the issue Mat linked will directly add support for this to the core!! 

BurningTreeC

unread,
Feb 3, 2020, 1:53:43 AM2/3/20
to TiddlyWiki
Hi Dave, it would be possible in pure wiki text to create missing tiddlers when clicking the save-Tiddler button

BurningTreeC

unread,
Feb 3, 2020, 2:16:12 AM2/3/20
to TiddlyWiki
Place the following at the bottom of the "save-tiddler-actions" macro in the $:/core/ui/EditTemplate Tiddler :


<$list filter="[all[current]links[]is[missing]]">
<$action-createtiddler $basetitle=<<currentTiddler>>/>
</$list>

Ste Wilson

unread,
Feb 3, 2020, 2:21:11 AM2/3/20
to TiddlyWiki
Long long ago somewhere in this mire of posts and tangled threads I'm sure someone posted an auto complete of the tiddler title as you typed it as David describes above. I've just failed to find it but I'm sure i remember sticking it my wiki once.

PMario

unread,
Feb 3, 2020, 3:57:58 AM2/3/20
to TiddlyWiki
The problem is, that now the tiddler exists as an empty tiddler with no content, which imo is useless. ...

AND now the "missing" tiddlers tab in the right sidebar is empty, and you can't find your "empty but existing" tiddlers anymore. So the chance is high you produce a lot of working links to empty tiddlers.

@Dave - What did you win?

David Gifford

unread,
Feb 3, 2020, 8:40:16 AM2/3/20
to TiddlyWiki
Ste, the link is here, it is not a thing, it is a request for a thing. http://editorpopup.tiddlyspot.com/

David Gifford

unread,
Feb 3, 2020, 8:50:45 AM2/3/20
to TiddlyWiki
Hi PMario

By being able to have tiddlers created just by finishing links, I win big. In TiddlyBlink I take notes on books I read. So the notes are automatically linked to the book and show up there in the $viewtemplate tiddler. By linking the notes to topics, the notes also show up in the tiddlers for those topics. By not having to manually open each link, click the edit button, and then click the save button, I reduce time and friction, and I have topics that show up in searches and lists, and I can find them in Recent in order to build hierarchical outlines in outline tiddlers.

David Gifford

unread,
Feb 3, 2020, 8:54:29 AM2/3/20
to TiddlyWiki
Thanks BurningTree, I will test this out for a day or so, but it looks like this is the easiest and most intuitive way to do this! Thanks!

That seems like such a fundamental core tiddler to be editing, though. I am always told not to fiddle with core tiddlers. I do anyway, but I wonder if there would also be a way to do this without breaking that important rule, so that if that tiddler gets updated in future versions, I don't have to keep changing it.

David Gifford

unread,
Feb 3, 2020, 9:10:38 AM2/3/20
to TiddlyWiki
Not sure where to put this. I tried

1) Inserting it below <$action-sendmessage $message="tm-save-tiddler"/>
2) Splitting <$action-sendmessage $message="tm-save-tiddler"/> by turning /> to </$action> and inserting your snippet there.
3) Between </$list> and </$keyboard>

Nothing happens.

Where do I put it this so it works?

On Monday, February 3, 2020 at 1:16:12 AM UTC-6, BurningTreeC wrote:

Mark S.

unread,
Feb 3, 2020, 10:07:17 AM2/3/20
to TiddlyWiki
At the top of $:/core/ui/EditTemplate there is a macro, "actions". Put the text at the bottom of the macro, just before "\end"

Worked in my test.

Occurs to me that the way to get the exact thing you want would be hack edit-comptext to add that ability. Perhaps you could appeal to the author?

Good luck!

Mark S.

unread,
Feb 3, 2020, 10:16:45 AM2/3/20
to tiddl...@googlegroups.com
Just tested BTC' code in Blink. It seems like the easiest solution to your request.

But you're probably going to want to modify it so that it that it adds a back link to it's text field. Otherwise you won't be able to navigate back, which is what you probably wanted.

Buenos días!

David Gifford

unread,
Feb 3, 2020, 10:41:51 AM2/3/20
to tiddl...@googlegroups.com
Mark, I inserted your list where you said, then created a tiddler and added a link to a non-existing tiddler. I save the tiddler, and the link there is a missing link to a non-existent tiddler. What am I doing wrong?

Did not work on empty.html either.

David Gifford

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/xo-kICZZEcg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/3a51a60a-bd98-4bab-ae90-32a1eb6829e0%40googlegroups.com.

BurningTreeC

unread,
Feb 3, 2020, 11:05:18 AM2/3/20
to TiddlyWiki
Hi David, you probably just pressed the save button and you 'd need to edit $:/core/Buttons/save so that it works by clicking the button. Now it should work by hitting ctrl-enter, did you try that?

David Gifford

unread,
Feb 3, 2020, 11:08:33 AM2/3/20
to tiddl...@googlegroups.com
Yes, that worked! What would I need to edit in  $:/core/Buttons/save?

Dave


On Mon, Feb 3, 2020 at 10:05 AM BurningTreeC <hypnotize...@gmail.com> wrote:
Hi David, you probably just pressed the save button and you 'd need to edit $:/core/Buttons/save so that it works by clicking the button. Now it should work by hitting ctrl-enter, did you try that?

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/xo-kICZZEcg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

BurningTreeC

unread,
Feb 3, 2020, 11:13:18 AM2/3/20
to TiddlyWiki
You would place the same lines of code below the line with the tm-save-tiddler message

David Gifford

unread,
Feb 3, 2020, 11:39:29 AM2/3/20
to TiddlyWiki
Thanks BurningTreeC! That worked great! And sorry for mixing you up with Mark in an earlier response.

David Gifford

unread,
Feb 3, 2020, 11:42:43 AM2/3/20
to TiddlyWiki
Hi Mark S!

Bimlas? Are you referring to a code in a different thread? I don't see any posts from bimlas here.

If you are referring to BurningTreeC, I don't need to add a backlink if I use his code, since TiddlyBlink is already set up for bi-directional linking. A link in one appears as a link in the viewtemplate tiddler of the other.

Blessings,

On Monday, February 3, 2020 at 9:16:45 AM UTC-6, Mark S. wrote:
Just tested Bimlas' code in Blink. It seems like the easiest solution to your request.

BurningTreeC

unread,
Feb 3, 2020, 11:46:03 AM2/3/20
to TiddlyWiki
Great :) and no problem :o)

Mark S.

unread,
Feb 3, 2020, 12:53:15 PM2/3/20
to TiddlyWiki
I had already corrected that in the message thread and was hoping no would notice. I really shouldn't post before my 3rd cup of coffee ...

If you follow one of the links that is automatically created, you won't be able to navigate back to your starting point, because the link created in that way won't have a link back the way the one's created with + or the timestamp will.

David Gifford

unread,
Feb 3, 2020, 1:06:03 PM2/3/20
to TiddlyWiki
Hi Mark

Yeah, I saw 'bimlas' because it came through on the email that GG sends me. Amen about the coffee, or in my case Coke Zero.

Regarding your comment: In TiddlyBlink, with the exception of things like accents, parentheses, etc, the link back is indeed created. This is confusing to explain, but,

1) The buttons create a child tiddler with the link to the current (parent) tiddler. This automatically means the child tiddler will show up in the parent tiddler viewtemplate.
2) Creating a link in the current tiddler does the opposite. It means the current tiddler will show up in the viewtemplate of the tiddler you created with the link.

So yes, creating the link creates the backlink, in both scenarios. Just that in one case the link back is in the text field, and in the other case the link back is in the viewtemplate. That is the power of bi-directional linking! Blessings.

Ste Wilson

unread,
Feb 3, 2020, 2:06:41 PM2/3/20
to TiddlyWiki
Hi Dave.
I think https://snowgoon88.github.io/TW5-extendedit/ mentioned in your link goes some way to auto completion and may have been what i was thinking of.

Scott Kingery

unread,
Feb 11, 2020, 8:19:36 PM2/11/20
to TiddlyWiki
For future searchers, an incorrect tiddler name was mentioned in this thread so here is a bit of a summary.


And you want to edit these 2 tiddlers to make it work

$:/core/ui/EditTemplate
- paste the code in the tiddler just above "\end"

$:/core/ui/Buttons/save
- paste the code below the line with the tm-save-tiddler message

Scott

David Gifford

unread,
Feb 11, 2020, 9:16:33 PM2/11/20
to TiddlyWiki
Thanks for the correction, Scott!
Reply all
Reply to author
Forward
0 new messages