What is a good way to store data for an auto-generated table?

124 views
Skip to first unread message

si

unread,
Feb 25, 2021, 8:15:53 AM2/25/21
to TiddlyWiki
Hi all.

I'm working on a mini-project for myself that involves representing tiddlers within a table, and I'm hoping to get some advice on exactly how to manage the data in TiddlyWiki.

The goal of the project is to create a table that lists what certain keyboard shortcuts do for particular programs that I use. Then I will automatically generate flashcards from the table so that I can memorise the shortcuts.

A simplified example of the table might look something like this:

|          |Windows 10              |Chrome               |
|Ctrl + F4 |Close the current window|                     |
|Ctrl + W  |                        |Close the current tab|
|Ctrl + Z  |Undo                    |                     |

I think I will be able to generate the table and flashcards, but I am undecided on exactly how to store this data in TiddlyWiki. I can't just use regular table syntax, because this will make it tricky to generate the flashcards, so its obvious that the data should be stored in separate tiddlers in some way.

My first thought was to create tiddlers for each shortcut (e.g. "Ctrl + Z"), and add fields named after each program where the value of the field is the effect of the shortcut (e.g. "windows_10:Undo"). I don't like this idea because, for example, I also want the field "windows_10" to be related back to a tiddler called "Windows 10". But this is difficult to do because of the character restrictions on field names.

Anyway just wondering if anyone has any advice here? What's a good way to represent this type of data in TiddlyWiki?

Thanks in advance for you help.

Mohammad Rahmani

unread,
Feb 25, 2021, 10:39:47 AM2/25/21
to tiddl...@googlegroups.com
1. Storing data in separate tiddler is good idea
2. When you have problem with field name then you can use data dictionary
3. Use Shiraz dynamic table then to create tables from data tiddler on the file

/Mohammad

 

Anyway just wondering if anyone has any advice here? What's a good way to represent this type of data in TiddlyWiki?

Thanks in advance for you help.

--
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/6c7cbe84-ae6b-4fe1-a55b-5f79d997f225n%40googlegroups.com.

Mat

unread,
Feb 25, 2021, 11:52:14 AM2/25/21
to TiddlyWiki
You can "connect" a string like "Windows 10" with a field name by doing slugify[Windows 10] to get "windows-10".

So if you have a tiddler per command you could do e.g 

<$list filter="[tag[OS]]">
   <$link/>
   <$vars os={{{ [all[current]slugifytag[]] }}} >
      <$list filter="[all[tiddlers]has<os>]">
etc

(not that I have tried this but I think this should work

<:-)

Mat

unread,
Feb 25, 2021, 11:53:07 AM2/25/21
to TiddlyWiki
(it should say "slugify" not "slugifytag")

<:-)

si

unread,
Feb 25, 2021, 12:26:12 PM2/25/21
to TiddlyWiki
@Mohammad

Thanks a lot! Data tiddlers + Dynamic tables is exactly what I needed. Great plugin!

I have one tiny question: Is there a way to apply filters to the entries of a column? Here's what I've done which will make it clear what I mean:

I created tiddlers to store shortcuts for each program. For example "Windows 10/Keyboard shortcuts" contains the following:

Ctrl + Z: Undo
Alt + F4: Close the current window.

Then with this macro:

<<table-dynamic filter:"[suffix[/Keyboard shortcuts]]" indexes:"[[title]] [suffix[/Keyboard shortcuts]indexes[]]">>

I get a table like this:

shortcuts-table.png
So I'm asking if there is a way to remove the "/Keyboard shortcuts" suffix from the entries in the "Title" column, and maybe even change the name of the column itself to something like "Software"? I know that I could add another value to the text of the data tiddler, but this creates another step which I feel is best avoided.

Thanks again for your help!


@Mat

Thank you! I did not know about the slugify filter.

Mohammad Rahmani

unread,
Feb 25, 2021, 1:16:39 PM2/25/21
to tiddl...@googlegroups.com
On Thu, Feb 25, 2021 at 8:56 PM si <matthew...@gmail.com> wrote:
@Mohammad

Thanks a lot! Data tiddlers + Dynamic tables is exactly what I needed. Great plugin!

I have one tiny question: Is there a way to apply filters to the entries of a column? Here's what I've done which will make it clear what I mean:

I created tiddlers to store shortcuts for each program. For example "Windows 10/Keyboard shortcuts" contains the following:

Ctrl + Z: Undo
Alt + F4: Close the current window.

Then with this macro:

<<table-dynamic filter:"[suffix[/Keyboard shortcuts]]" indexes:"[[title]] [suffix[/Keyboard shortcuts]indexes[]]">>

I get a table like this:

shortcuts-table.png
So I'm asking if there is a way to remove the "/Keyboard shortcuts" suffix from the entries in the "Title" column, and maybe even change the name of the column itself to something like "Software"? I know that I could add another value to the text of the data tiddler, but this creates another step which I feel is best avoided.

Thanks again for your help!


Well I think you need to customize the templates! Each column uses a template! So you can clone a template and change it as you like
Open Shiraz Tutorial / Dynamic tables / Custom template.
Column headers and what you want to be displayed as entries can be modified (for example add a prefix or change the case, ...)


 
Reply all
Reply to author
Forward
0 new messages