Sequential tiddlers

246 views
Skip to first unread message

mrv...@gmail.com

unread,
Feb 26, 2021, 9:10:02 AM2/26/21
to TiddlyWiki
I need the ability to create sequentially numbered tiddlers.  In other words, a button that creates a new tiddler with the following pattern. <<blankname>><<paddednumber1>>.  The next number in the series would have <<blankname>><<paddednumber2>> and so on.  The title cannot contain any spaces.  

I am not a whiz, but I have been using Tiddlywiki for a number of years, so I have the capability to do basic coding. Does anybody have any ideas?

Merv

Mohammad Rahmani

unread,
Feb 26, 2021, 9:42:46 AM2/26/21
to tiddl...@googlegroups.com
This may be helpful if you can use batch operations.
Have you tried Tiddler Commander! Open it and go to create tiddlers! It can create many tiddlers with sequential numbers at once.



Best wishes
Mohammad


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a163705d-abac-4f75-a264-c2411874b0can%40googlegroups.com.

Mat

unread,
Feb 26, 2021, 9:44:03 AM2/26/21
to TiddlyWiki
Yeah, so the ActionCreateTiddlerWidget takes a basetitle and then adds an incremental count to each new tiddler. This is what is used for the "New Tiddler 1", "New Tiddler 2" etc. You can trim off the space before the number in various ways but I think split[ ]join[] could work well here to split at the empty space and then join.

<:-)

PMario

unread,
Feb 26, 2021, 9:48:57 AM2/26/21
to TiddlyWiki
Hi Merv,

There is a pending pull request at github, which would make it easy to create titles like this. Please vote +1 at: allow unusedtitle macro to use the prefix parameter and fix wiki.generateNewTitle() #5361

-mario

mrv...@gmail.com

unread,
Feb 26, 2021, 10:47:18 AM2/26/21
to TiddlyWiki
I noticed the pull request.  Thank you for noticing the need.  I"m unfamiliar with the process.  Is there anything that I can do to help?

Merv

Jeremy Ruston

unread,
Feb 26, 2021, 10:50:25 AM2/26/21
to TiddlyWiki Group
Hi pmario

I think Merv also wants the index number to be zero padded, which isn’t currently supported by the PR, but does make a lot of sense. Presumably we’d add an optional parameter giving the padding width.

Best wishes

Jeremy

-- 
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+...@googlegroups.com.

mrv...@gmail.com

unread,
Feb 26, 2021, 10:53:38 AM2/26/21
to TiddlyWiki
Thank you.  That is exactly right.

Merv

PMario

unread,
Feb 26, 2021, 5:44:17 PM2/26/21
to TiddlyWiki
On Friday, February 26, 2021 at 4:50:25 PM UTC+1 Jeremy Ruston wrote:

I think Merv also wants the index number to be zero padded, which isn’t currently supported by the PR, but does make a lot of sense. Presumably we’d add an optional parameter giving the padding width.

Hmmm, I think this could be a new macro. + a new .wiki.generateNewTitleXXXX() ... The "old" function needs to be backwards compatible, which imo causes some problems.

-mario

Charlie Veniot

unread,
Feb 26, 2021, 9:39:02 PM2/26/21
to TiddlyWiki
G'day,

Sneak a peek at these tiddlers and see if there is some code of use to you:
  • Facts Explorer  (find the "New" button, which calls the NewFact macro)
  • Tifoist Macros  (here you'll find the NewFact macro)
    • The code of interest:  <$vars NewFactId={{{ [tag[fact]removeprefix[Fact-]maxall[]add[1]pad[6,0]addprefix[Fact-]] }}}>
Cheers !

mrv...@gmail.com

unread,
Feb 27, 2021, 9:02:52 AM2/27/21
to TiddlyWiki
That is a very useful example.  Not only does it do something similar to what I want to accomplish, it has an approach that may be useful to my use case.  Thank you.  And thanks to the example's creator for their good work.

Merv

Charlie Veniot

unread,
Feb 27, 2021, 9:25:09 AM2/27/21
to TiddlyWiki
G'day Merv,

Woohoo!  "Tifoist" is my little project, and those example tiddlers and sample code are right out of the creative/analytical not-so-far-recesses of me old sponge.

Thanks for the pat on the back!  (Something I never had much of in my career, and never took very seriously when I did get them.  Now I find pats on the back one of the greatest gifts.)

I still consider myself very much a newb (a yellow belt?) regarding the art of TiddlyWiki filtering, so look upon everything I do with a wee sceptical eye !

BTW, a toast to serendipity.    That coding of mine is very recent.

Whatever fun stuff you create, please share!  Even if "only" an inspirational screenshot (to me, nothing "only" about it.)

Cheers, best regards, rock'n roll !

PMario

unread,
Feb 27, 2021, 4:02:39 PM2/27/21
to TiddlyWiki
On Friday, February 26, 2021 at 3:10:02 PM UTC+1 mrv...@gmail.com wrote:
I need the ability to create sequentially numbered tiddlers.  In other words, a button that creates a new tiddler with the following pattern. <<blankname>><<paddednumber1>>.  The next number in the series would have <<blankname>><<paddednumber2>> and so on.  The title cannot contain any spaces.  

As I wrote in my first post, there is a pending PR, which tries to achieve something slightly related.

I did come up with an implementation that looks like this:

<<unusedtitle baseName:"yourName">> 

will output

yourName
yourName  1
yourName  2

and so on

<<unusedtitle baseName:"yourName" template:"$baseName$ $CNT:4$">> 

which will output something like this:

yourName 0000
yourName 0001
yourName 0002

and so on.

<<unusedtitle baseName:"yourName" template:"$baseName$$CNT:2$">>
results in
yourName00

As you can see, there is a little bit of a difference.  The first example is there for backwards compatibility. The second example is new behaviour and will start with the 0000 as the numbering.

What do you think? Would this behaviour be OK for your usecase.

@Jermolene .. What do you think.

A working TEST-wiki to test with will be posted soon!

-mario

mrv...@gmail.com

unread,
Feb 28, 2021, 9:11:29 AM2/28/21
to TiddlyWiki
This approach comes very close to what I need, but what is problematic is the space between the name and the numbers.  As you know, spaces in titles require special handling and can limit options.

I am trying to build a document management system that can index, identify and describe a series of documents.  Every once in a while someone hands me a pile of paper that I need to organize, which can be overwhelming since I do not have a paralegal.  Some law firms use what is called a "Bates" numbering system.  This is a number system that uses a series of padded numbers: ei., 0001, 0002, 0003.  I would like a number system that does this, but also allows me to attach a name on the front to identify the account.

I am still evaluating how to organize these numbers once I have them---there are several options.  I may try one method out, then switch to another.  I am not smart enough to figure this stuff out ahead of time.  I try stuff, see what works, then try something else.  Sometimes when I get something that works, I can't even explain why it works, I just like the result.

I know that some options are not compatible with spaces in titles.  For example there is the "tree Macro," (https://tiddlywiki.com/#tree%20Macro).  I have never seen this macro actually used, and it seem somewhat awkward, so maybe it is not something that I want to rely upon but on the other hand, it appears to accomplish useful things and may work well for my use-case.  I want to be able to test it out.  But the macro does not appear to work if there are spaces in the titles.  Another option is the tabbed internal macro (https://tiddlywiki.com/#Example%20Table%20of%20Contents%3A%20Tabbed%20Internal).  This macro does not tolerate spaces in the titles of the root tiddler.  I already use this method extensively, so I would like to have this option available.

I hope this adequately explains what I need.

Merv

PMario

unread,
Feb 28, 2021, 9:23:21 AM2/28/21
to TiddlyWiki

PMario

unread,
Feb 28, 2021, 9:32:14 AM2/28/21
to TiddlyWiki
On Sunday, February 28, 2021 at 3:11:29 PM UTC+1 mrv...@gmail.com wrote:
This approach comes very close to what I need, but what is problematic is the space between the name and the numbers.  As you know, spaces in titles require special handling and can limit options.

The new "template" handling can fix this. Be aware: The working demo is only a suggestion. It is _not part of the core yet_ The PR is here: https://github.com/Jermolene/TiddlyWiki5/pull/5361 

I am trying to build a document management system that can index, identify and describe a series of documents.  Every once in a while someone hands me a pile of paper that I need to organize, which can be overwhelming since I do not have a paralegal.  Some law firms use what is called a "Bates" numbering system.  This is a number system that uses a series of padded numbers: ei., 0001, 0002, 0003.  I would like a number system that does this, but also allows me to attach a name on the front to identify the account.

OK. Should be simple now.
 
I am still evaluating how to organize these numbers once I have them---there are several options.  I may try one method out, then switch to another.  I am not smart enough to figure this stuff out ahead of time.  I try stuff, see what works, then try something else.  Sometimes when I get something that works, I can't even explain why it works, I just like the result.

OK
 
I know that some options are not compatible with spaces in titles.  For example there is the "tree Macro," (https://tiddlywiki.com/#tree%20Macro).  I have never seen this macro actually used, and it seem somewhat awkward, so maybe it is not something that I want to rely upon but on the other hand, it appears to accomplish useful things and may work well for my use-case.

The tree macro uses slashes as a separator. We call this a "namespace" eg:

mario's/house/room1/table/document-0001

This could be handy. ... The tree macro is relatively hardcoded atm. But it could be made more flexible.
 
  I want to be able to test it out.  But the macro does not appear to work if there are spaces in the titles.  Another option is the tabbed internal macro (https://tiddlywiki.com/#Example%20Table%20of%20Contents%3A%20Tabbed%20Internal).  This macro does not tolerate spaces in the titles of the root tiddler.  I already use this method extensively, so I would like to have this option available.

I'm pretty sure it does allow spaces. Did you try "my root tiddler name" as a parameter?
 
Feedback is very welcome
-mario

PMario

unread,
Mar 2, 2021, 8:08:32 AM3/2/21
to TiddlyWiki
@Merv,

Did you test the "demo"? Would it work for you?

@all
What do you think?

scot

unread,
Mar 3, 2021, 6:17:59 AM3/3/21
to TiddlyWiki
Has anyone considered this plugin. $:/plugins/tobibeer/make
I am not sure whether this plugin is still valid when used with the latest release of TW, but it offers a number of examples for numbering tiddlers. e.g.

Zero-pad count to 5 digits:
{{{ [[]make[%count%\max:3\pad:5]] }}}

No Separator Before Unique Number
{{{ [[]make[sep:]] }}}


Can anyone please confirm whether this plugin will work on new wikis and if not, can it be replicated in another way using current macro or widget.

Scot

scot

unread,
Mar 5, 2021, 7:01:58 AM3/5/21
to TiddlyWiki
I've answered my own question.
Yes $:/plugins/tobibeer/make does work in TW 5.1.23


scot
Reply all
Reply to author
Forward
0 new messages