Re-presenting: newtids ~ easily create multiple tids

[First log-in for quite some time, but I’m still around and my love for TW is as strong as ever :wink: ]

I needed to improve my ol’ newtids macro so it resulted in a proper plugin instead:

    newtids ~ convert a typed list into multiple tids

The prime use case is a common “mid-sized” list of items that you type up or copy; a list of names, some project list, brainstorm output, etc - where each item should have some common tags or fields.

This shows the macro call syntax and seven to-be tiddlers.

<<newtids """
Flour
Baking Powder
Sugar
Salt
Cold Butter
Heavy Cream
Eggs
""">>

Entering this will show a small UI to add common tags etc.

The new feature is that you can create tiddlers with text content by inserting a separator character in the row to distinguish the to-be tiddlers title from its text. This means you can easily tiddlify two columns from an Excel table by just copy-pasting them!

4 Likes

Thanks for sharing @twMat perhaps you could also use it this way

<<newtids {{list-tiddler}}>>

Thanks, that’s interesting but even if it were possible syntactically, I doubt it would make much sense as the ´list-tiddler´ you allude to is, presumably, a static list… but why is there a static list there? Wouldn’t it make more sense to just type it directly into the newtids macro :grinning_face_with_smiling_eyes:

list-tiddler is just any tiddler that contains a list you want to use your macro on. It could be something you pasted, typed or imported from another source.

I would personally find it “cleaner this way”.

I will play with your solution a little more but may look at using it to create and recreate a list of steps I do multiple times.

Welcome back! Good to see you around again.

Very nice! I’ve been doing this from Node for my wikis. It’s not hard, but it would be nice to do them in-wiki like this. I would definitely want an Add-all button for my own uses. (My own such things often run into the hundreds or low thousands.)


It would be an interesting addition to use a header-row for field names, possibly with a feature to allow the user to rename headers first. This would allow us to import data with multiple fields.

I often use this – or a variant of it – to parse the tab-separated values in JS:

const tsv2arr = ( 
  tsv, [headers, ...rows] = tsv.split('\n').filter(Boolean).map((r => r.split('\t')))
) => rows.map((r) => Object.fromEntries(r.map((c, i) => [headers[i], c])))

I’m sure we could create a wikitext version of it. The other thing I would want with this is the ability to auto-add some common fields, say, tags: Ingredients to each created tiddler.

I’m not requesting that you do this. If I find time, I might look at extending your work in this direction… not that I would argue should you want to do it! :slight_smile:

Aha, good idea! And as you point out it should be pretty simple to implement. I won’t do it now but it’s a “someday”.

That is already a feature - add tags and any number of custom fields+values that are to be included in each new tiddler.

D’oh! Of course it is. I wasn’t following your UI correctly. This is very nice!