[data tiddlers] dealing with ":" (from <<currentTiddler>>)

127 views
Skip to first unread message

HC Haase

unread,
Feb 3, 2020, 3:52:44 AM2/3/20
to TiddlyWiki
Hey all

In my new plugin TOC generic, ended up storing tiddler title and value (show/hide) in a dictionary tidder. This is done with a button action-set-field widget that use <<currentTiddler>>.

Problem
data tiddlers use a colon ":" between name (tiddler title) and value

If a tiddler title have ":" in the title when appended to the data tiddler, the colon will be interpreted as the name/value separator and that do not work.

Example:

tiddler titled

New Tiddler : with a colon:


will append to the dictionary tiddler like this
New Tiddler : with a colon:: show


question
Is there a way to escape the colon or a way to append the title to a dictionary tiddler that do not interpret the colon?

TonyM

unread,
Feb 3, 2020, 4:18:20 AM2/3/20
to TiddlyWiki
One thing you can do is avoiding : in tiddler titles but system tiddlers include it.

So you could store tiddlers with the prefix of $:/ as $/ and after and then provide a method to remove and restore this prefix.

This only causes problems it tiddlers begin $/

You could hide this in a macro that given tiddler name returns a tiddler index and one the other wa the fact it plays games with system tiddlers would be all but hidden hidden from you.

Tony

TonyM

unread,
Feb 3, 2020, 4:21:02 AM2/3/20
to TiddlyWiki
Buy the way if you choose what's in the title why not usesemi colon

Tony

Mohammad

unread,
Feb 3, 2020, 5:09:58 AM2/3/20
to TiddlyWiki
Use json tiddler! It has the same capability and you would not encounter this problem.


On Monday, February 3, 2020 at 12:22:44 PM UTC+3:30, HC Haase wrote:
Hey all

In my new plugin TOC generic, ended up storing tiddler title and value (show/hide) in a dictionary tidder. This is done with a button action-set-field widget that use <<currentTiddler>>.


 
Problem
data tiddlers use a colon ":" between name (tiddler title) and value

If a tiddler title have ":" in the title when appended to the data tiddler, the colon will be interpreted as the name/value separator and that do not work.


My experiences say, TW consider the separator (delimiter) as the first : per row. Check your code! It seems strange!
See attached example. drag and drop into tiddlywiki.com and check the read-dataTiddler
read-dataTiddlers.json

HC Haase

unread,
Feb 3, 2020, 7:42:34 AM2/3/20
to tiddl...@googlegroups.com
@Tony
thanks, but that is not a good solution, especially in a plugin used by other people

@Mohammad

My experiences say, TW consider the separator (delimiter) as the first : per row. Check your code! It seems strange!

That's exactly the problem

Use json tiddler! It has the same capability and you would not encounter this problem.

That's exactly the solution

thank you

I am just learning how to use data tiddlers, its quite usefull.

A Gloom

unread,
Feb 4, 2020, 9:28:43 PM2/4/20
to TiddlyWiki
This doesn't help with writing titles to a data tiddler-- I don't know if urlencode with encode : but you must make those extra :'s into &#x3A; for the data tiddler ignore them-- its only needed in title section before the data tiddler : seperator-- in the value section after the seperator it's not an issue

Mohammad is correct-- json is better especially since data tiddlers won't be worked on (but still supported) in the core any longer iirc

Look at this at TWScripts-- I went by this when converting to data tiddlers to json


HC Haase

unread,
Feb 5, 2020, 5:05:54 AM2/5/20
to TiddlyWiki


onsdag den 5. februar 2020 kl. 03.28.43 UTC+1 skrev A Gloom:
This doesn't help with writing titles to a data tiddler-- I don't know if urlencode with encode : but you must make those extra :'s into &#x3A; for the data tiddler ignore them-- its only needed in title section before the data tiddler : seperator-- in the value section after the seperator it's not an issue

 I don't understand what you are saying here.. are you saying, that you could change the colon to url &#x3A?  "the value section after the separator it's not an issue"- that part I understand. Good to know.


Mohammad is correct-- json is better especially since data tiddlers won't be worked on (but still supported) in the core any longer iirc

Look at this at TWScripts-- I went by this when converting to data tiddlers to json


For my problem I followd Mohammads advice and just used a json tiddler. workd perfectly.

"data tiddlers won't be worked on" does that mean that dictionary tiddlers should be avoided?? as I understand it,  the json can do the same as the dictionary and more, so I don't see the need for the dictionary type. But then again I dont know much about the issue.

Jeremy Ruston

unread,
Feb 5, 2020, 5:13:31 AM2/5/20
to TiddlyWiki


On 5 Feb 2020, at 10:05, HC Haase <haas...@gmail.com> wrote:

"data tiddlers won't be worked on" does that mean that dictionary tiddlers should be avoided?? as I understand it,  the json can do the same as the dictionary and more, so I don't see the need for the dictionary type. But then again I dont know much about the issue.

It just means that there are no current plans to work on improvements to the data/JSON tiddler implementation. The functionality will not be removed, although I do intend to work on alternative ways of achieving some of the same goals.

Best wishes

Jeremy

Hubert

unread,
Feb 5, 2020, 5:17:10 AM2/5/20
to TiddlyWiki
Hi HC,
 
"data tiddlers won't be worked on" does that mean that dictionary tiddlers should be avoided??

Regarding long-term support for data tiddlers (of which there are two main types: dictionary and json), you might be interested in this thread.

As it stands, they are candidates for deprecation. I still use them a lot though, especially for thousands of small data points.

Just a slightly OT note.

Regards,
Hubert

TonyM

unread,
Feb 6, 2020, 12:23:55 AM2/6/20
to TiddlyWiki
On Data Dictionary tiddlers;

I believe the handling of ata Dictionary tiddlers needs improvement not deprecation, even if it is not a de jure standard.

Why?

Because even just the "index: value" format is used all over the internet. a Range of settings files, calendar or address file standards out there use this standard. JSON could be argued to be superior, however there are many places that use simple text files and possibly always will. To be able to drop/import such a file and write a little wiki text to interrogate the content of such files is a great opportunity for further integration with a range of data sources.

Improvement examples;
  • Parse text in a tiddler to extract index value pairs including extracting recurring groups such the result can be iterated or indexed.
  • Data dictionary to JSON tools
etc...
tony

A Gloom

unread,
Feb 6, 2020, 5:48:19 AM2/6/20
to TiddlyWiki
first I was sloppy with terms--
when I said data tiddler, I meant standard data dictionary tiddler (name:value)
urlencode I meant uriencode -- https://tiddlywiki.com/#encodeuri%20Operator
 
 I don't understand what you are saying here.. are you saying, that you could change the colon to url &#x3A?  "the value section after the separator it's not an issue"- that part I understand. Good to know.
 
see the screenshot below-- it shows the data dictionary tiddler code on the left and how displays when transcluded-- the "
data dictionary tiddler value &#x3A; : " (data dictionary) / "data dictionary tiddler value :" (transcluded) entry shows , but was manually entered-- for filter generated tiddler titles you'll have to have the list encode them so any ":" is encoded.

Clipboarddt.jpg


For my problem I followd Mohammads advice and just used a json tiddler. workd perfectly.

excellent-- I hadn't tried ":" in a json data tiddler "name"  portion though I assume it shouldn't be an issue since ":" separator isn't used there
 
Reply all
Reply to author
Forward
0 new messages