Still frustrated

460 views
Skip to first unread message

Bob Jansen

unread,
Sep 27, 2020, 2:52:29 AM9/27/20
to TiddlyWiki
I know and am very thankful of the many items of advice I have received in the past. But I am still frustrated - there must be some core element I am not understanding.

The main issue is how to address items in wikitext, {{ [[ {{{ << <  etc. I know this all depends on how the item is being used but a simple cheat sheet with many examples would be really useful. I don't find the Tiddlywiki documentation easy to follow, bits are all over the place and none of the examples address my problems I find.

For example, why does this not work?

<$button>
<$action-setfield
     $tiddler="$:/TLS/exhibition_id"
     $value={{!!exhibition_id}}
/>
<!--append the exhibition_id to the exhibition id field in each artwork-->
<$list filter="[tag[Mark]]">
     <$action-setfield 
          $field="exhibition_id" 
          $value=<<TLSconcatenate {{!!exhibition_id}} {{$:/TLS/exhibition_id}}>>
     /> 
</$list>

Link Artworks to Exhibition
</$button>


The result is the string {{!!exhibition_id}} {{$:/TLS/exhibition_id}} stored in the exhibition_id field of each artwork selected and not the transcluded values.

TLSconcatenate is a simple macro to concatenate two strings

\define TLSconcatenate(head tail) $head$$tail$

bobj

Eric Shulman

unread,
Sep 27, 2020, 4:16:17 AM9/27/20
to TiddlyWiki
On Saturday, September 26, 2020 at 11:52:29 PM UTC-7, Bob Jansen wrote:
For example, why does this not work?
<$button>
<$action-setfield
     $tiddler="$:/TLS/exhibition_id"
     $value={{!!exhibition_id}}
/>
<!--append the exhibition_id to the exhibition id field in each artwork-->
<$list filter="[tag[Mark]]">
     <$action-setfield 
          $field="exhibition_id" 
          $value=<<TLSconcatenate {{!!exhibition_id}} {{$:/TLS/exhibition_id}}>>
     /> 
</$list>

Link Artworks to Exhibition
</$button>

The result is the string {{!!exhibition_id}} {{$:/TLS/exhibition_id}} stored in the exhibition_id field of each artwork selected and not the transcluded values.
TLSconcatenate is a simple macro to concatenate two strings
\define TLSconcatenate(head tail) $head$$tail$

A macro does NOT "parse" anything that you pass to it.  It only does TWO things:
   1) replace instances of $param$ with a value passed into the macro
   2) replace instances of $(variable)$ with a value defined outside of the macro

Macro calls (<<macroname param param ...>>) do not parse any of the parameters before passing them into the macro.
Thus, when you use {{!!exibition_id}} and {{$:/TLS/exhibition_id}}, the macro simply appends those two bits of syntax, unchanged.

It is up to the "calling context" to determine what happens with the result of a macro.
If the macro occurs directly in wikitext, then the result *is* parsed and rendered.
If the macro is used as the value of a widget parameter, it is *not* parsed.

This can lead to some confusion when trying to debug a macro:
If you invoke <<somemacro {{foo}} {{bar}}>> and display the results, the {{foo}} and {{bar}} transclusions are parsed
and replaced with their underlying values, so it can look like the macro does what you might be expecting.
However, if you use that same macro as a widget parameter (e.g., $value=<<somemacro ...>>) then the
the tranclusions are NOT processed and the macro results are just passed along to the widget 'as-is'.

For your specific use-case (concatenating the text from two transclusions), forget macros...
Instead, use an "inline filter" to construct the desired widget parameter value.

"inline filters" (aka "filtered transclusion") are surrounded by tripled-curly braces: {{{ ... }}}
and contain filter syntax, which is itself enclosed in a pair of square brackets: [...].

Within the filter syntax, transclusions, variables, and literal text use *single* brackets:
   {...} for transclusions
   <...> for variables
   [...] for literal text

Thus, the $value param of your $action-setfield widget could be written like this:
<$action-setfield
   $field="exhibition_id"
   $value={{{ [{!!exhibition_id}addsuffix{$:/TLS/exhibition_id}] }}}
/>

Hope this helps.

enjoy,
-e

TW Tones

unread,
Sep 27, 2020, 6:49:11 PM9/27/20
to TiddlyWiki
Bob,

There is an older resource on this here http://pv5.tiddlyspot.com however I will update my own abridged version and share a cheat sheet today.

Regards
Tony

Bob Jansen

unread,
Sep 27, 2020, 8:11:29 PM9/27/20
to TiddlyWiki
Eric and Tones,

your explanation makes things clearer and the cheat sheet helps. It just adds to my argument though, the documentation needs to be updated. For example, searching for concatenation provides the tiddler on using macros for this but no mention of when using in a filter. Tones, I think your cheat sheet should be included in the Tiddlywiki wiki documentation right up front to make things clearer for naive users like me.

One more thing, is there a way to append a space character in the filter? I've tried
<$action-setfield 
          $field="exhibition_id" 
          $value={{{ [{!!exhibition_id}addsuffix{" "}addsuffix{$:/TLS/exhibition_id}] }}}

Also tried

<$list filter="[tag[Mark]]">
     <$set name="spaceChar" value=" "> 
     <$action-setfield 
          $field="exhibition_id" 
          $value={{{ [{!!exhibition_id}addsuffix{<spaceChar>}addsuffix{$:/TLS/exhibition_id}] }}}
     />
</$list>

but the space character does not seem to be added to the field. I need a space character between each id value.

bobj

TW Tones

unread,
Sep 27, 2020, 9:22:53 PM9/27/20
to TiddlyWiki
Oh,

One big leap in my understanding occurred when I learned this

However, within TiddlyWiki *filters*, there is no need doubling the brackets, as HTML is not allowed *within* the filter, so only single <variableName> is used.

...and why I don't have to wrap <fieldname> with [<fieldname>] before giving it to split? 

Think of the brackets in filters as part of the operand itself rather than a "container" for the operand.  The type of bracket indicates the type of operand being used:
   use [...] for literal values, e.g., [texthere] 
   use {...} for field references, e.g., {!!fieldname}
   use <...> for variables e.g. <currentTiddler>

Thus, to split the literal text, "sometext", you could write:
   [title[sometext]splitbefore[t]removesuffix[t]]
you would get "some" as a result.

If the value "sometext" is stored in a field named "somefield" in the current tiddler, you could write:
  [{!!somefield}splitbefore[t]removesuffix[t]]

and, if the value "sometext" is stored in a variable named "somevariable", you could write:
  [<somevariable>splitbefore[t]removesuffix[t]]

As a slightly more complex example, suppose the value to split on was also stored in a variable.  Then you could write:
  [<somevariable>splitbefore<othervariable>removesuffix<othervariable>]

Regards
Tony

TW Tones

unread,
Sep 27, 2020, 9:26:32 PM9/27/20
to TiddlyWiki
Bob,

My updated cheat sheet is in progress. Attached, Final to be published first here https://anthonymuscio.github.io/

to add a space
addprefix[ ]

or you can use it in 
join[ ]
addsuffix
[ ]
and possibly other places

Dont kick yourself.

Tones

TW Tones

unread,
Sep 27, 2020, 9:28:58 PM9/27/20
to TiddlyWiki
Sorry attached DRAFT cheat sheet

Tones
Standard Nomenclature.json

Dr. Bob Jansen

unread,
Sep 27, 2020, 9:41:59 PM9/27/20
to tiddl...@googlegroups.com
Thanks Tones

tried addsuffix[ ] and it worked!

bobj
--
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/jQpUdgQQQWc/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/11241312-f1b5-499e-828e-b8a1d7f1a7ebo%40googlegroups.com.

-- 
--------------------------------
Dr Bob Jansen
122 Cameron St, Rockdale NSW 2216, Australia
Ph (Korea): +82 10-4494-0328
Ph (Australia) +61 414 297 448
Resume: http://au.linkedin.com/in/bobjan
Skype: bobjtls
KakaoTalk: bobjtls
http://cultconv.com

In line with the Australian anti-spam legislation, if you wish to receive no further email from me, please send me an email with the subject "No Spam"

Eric Shulman

unread,
Sep 27, 2020, 9:43:11 PM9/27/20
to TiddlyWiki
On Sunday, September 27, 2020 at 6:22:53 PM UTC-7, TW Tones wrote:
Oh,

One big leap in my understanding occurred when I learned this...

*snip* 

Wow... It's been quite a while since I wrote that explanation!   ... and I'm still explaining the same stuff to people who are new to TW.
Seems to me that it should be rolled into the "official" documentation on TiddlyWiki.com, since it keeps coming up.

-e

TW Tones

unread,
Sep 27, 2020, 11:53:19 PM9/27/20
to TiddlyWiki
Eric,

So true. I owe a lot to you and some regulars, unfortunately many of these issues are only addressed when the right question is asked. 

For some time there are just a few questions that people do not even know how to ask.

This does high light not just the facts are missing from the doco but a place to record these "principal" issues.

Hopefully my attached tiddler and its current version helps. I don't doubt it contains information gleaned from you too.

Regards
Tony

Atronoush Parsi

unread,
Sep 28, 2020, 12:13:47 AM9/28/20
to tiddl...@googlegroups.com
Bob,
 Most of your problems come from how to write Tiddlywiki scripts (e.g. wikitext). One the best resource in this regards is

For example what you asked in this post has been addressed in TW-Scripts

You are quite right, the documentation in Tiddlywiki.com is nonlinear and confusing for newbies. Perhaps a linear A to Z step by step tutorial is better.

Atro

--
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/4cc4b26e-250b-4c7f-8590-fc0ae5dd7db0n%40googlegroups.com.

Bob Jansen

unread,
Sep 28, 2020, 1:25:18 AM9/28/20
to TiddlyWiki
Atro,

you are right, the problems are in writing wikitext. The real problem, as far as I can understand it, is that the documentation is incomplete and messy AND that there seems to be no consistency in the parsing of wikitext. That may be because different people write different widgets, macros, etc, but this does not help the naive user like me.

I am a programmer, have been programming for over 40 years. So it is not an issue with how to program or its concepts. Like other programming languages, there is an expectation of consistency, but  may be this is not an attribute of web applications.

Still, we keep trying and getting better...........slowely :-)

bobj

Atronoush Parsi

unread,
Sep 28, 2020, 2:28:22 AM9/28/20
to tiddl...@googlegroups.com
Bob,
Quite agree with you. I am a programmer too but for number crunching (Python, Fortran, C). I have seen several times people raised similar questions and what I see as the answer was TW has been grown organically. There are reasons for inconsistency and I understand part of that, but learning TW wikitext specially if you like to develop a working plugin/script with many wikitext is really cumbersome. It would be great to see some common logic and consistency! 

One philosophy in TW developing is restricted backward compatibility and this is appreciated, but this prevents some inconsistency!  There are discussions in the forum to have a breakthrough release, but it is a difficult decision to make.

Atro




TW Tones

unread,
Sep 29, 2020, 7:30:55 PM9/29/20
to TiddlyWiki
Bob/Atro

Bob I don't understand your statement "no consistency in the parsing of wikitext", perhaps you can't see the logic yet? but do share the inconsistencies?

Mario, I and others are working on a new wiki text customise solution which adds so much power, it will blow you mind, but it still needs to sit on top of the current Wiki text, so we should raise issues to fix egregious examples of inconsistencies.

Though keep in mind a widget is  "subprogram" of sorts. The internal widgets are highly consistent (a few exceptions), however third party ones vary as for any similar case.

Regards
Tones

Bob Jansen

unread,
Sep 30, 2020, 7:28:12 AM9/30/20
to TiddlyWiki
Tones,

Please accept this reply in the spirit it is intended, as constructive input into the issue of learning TW wikitext and not as an attack on anyone, TW or this group.

A simple example.

The tiddlywiki wiki entry on Variables in Wikitext has the example, 

<$set name=animal value=zebra> 
<<animal>> 
</$set>

Your cheatsheet, which I know you passed to me before it has been reviewed, has a similar example

<$set name='var' value='Foo'> 
<<taggingByVar>> 
</$set>

Note one difference, the use of quotes around the variable name and value attributes. So which is it, are quotes required or not? Do quotes matter? I would assume quotes do matter and if so why does the official documentation leave them out. I also assume the macro call should read <<taggingby var>> and this is just a mistype. But this hows that even such a simple statement's documentation is inconsistent. Now, if quotes don't matter I assume it is because no values have spaces? But this is an exception rule and as we all know one exception breeds other exceptions and soon we have so many exceptions that the only real exception is the initial idea. In all other programming languages that I know of, strings are quote delimited. A simple lesson learned once and applied all over the place.

Your cheatsheet on the <VAR> element states
"Does only work as a filter variable, inside or outside a macro:"
As something is either inside or outside of a macro, this should always work as a filter variable then cause it can't be in any other state so the statement doesn't make sense.

Another example, concatenation of strings. Search for concatenate in TW documentation and you get the  tiddler, Concatenating text and variables using macro substitution, which categorically states that the only way to do this is to use a macro. So I used a macro. Could not get the macro to function as expected inside a $list loop. You and Eric explained that it can not be used this was inside a $list loop but where does it state that in the documentation?

Many of the examples in the TW documentation use what appears to be a macrocall of some sort to perform the example. So you cannot see the actual statements used, you can only see the result of the macrocall. Not very helpful really is it. Why not just use simple statements that anyone can follow after all we are after a real example to see how things are done.

As for referencing values inside tiddlers, it seems there are many possibilities involving various configurations of quotes/brackets/braces/underscores. Why is there not a single method of referencing content? Eric, in an earlier email, described it as the calling context's problem to work out what is required. Yet in all other programming languages that I have used over the 40+ years of my programming, referencing a variable is always the same in a particular language, it is not dependent on the calling content, nor is it dependent on how it is being used, it is defined in the grammar of the language. Now maybe this is an attribute of web applications. Maybe it is the result of organic development as Atro states. Whatever it is, it is bloody difficult to grasp and so becomes very frustrating. 

My development progress at this stage is a single wikitext statement at a time involving much input from the helpful people on this group.Each time, I learn a bit more but applying that learning quickly fails with the next statement.

Your email to Atro and I asks, "perhaps you can't see the logic yet"

Too right! I don't see any logic yet. I have studied your cheatsheet and the references it makes to others' work as well as various emails from Eric and the Tiddlywiki documentation and I still don't see any logic in it.  Perusing the emails on this list indicates I am not the only one and there seems to be some recognition that this is a real problem for TW uptake.

Someone earlier suggested I contribute to the documentation but I don't understand enough to be able to do that. Any contribution I could make would, right now, be wrong, misleading and totally misunderstanding of the design philosophy behind TW.

I am continuing to use TW for my web app but at some stage will have to make the decision as to whether it is worth my time and effort to continue. I feel TW has a great potential but believe the development side needs to be addressed.

I am nearly 60% way through another TW app that simple involves my editing content and this is working well and is getting welcome acceptance. http://cultconv.com/English/Conversations/MacQueen_Mary/TiddlyWiki/index.html. FYI, for this application, I have created a Filemaker Pro database into which I type the various content elements and then generate the required Wikitext which I then cut and past into the appropriate tiddler. This has proved very efficient over typing directly into TW. 

Hope this helps. Happy to discuss further and do what I can to address these concerns/issues.

bobj

PMario

unread,
Sep 30, 2020, 10:48:01 AM9/30/20
to TiddlyWiki
Hi folks,

I didn't read the whole thread. Only this post and I downloaded. the "Standard Nomenclature.json" from Tony.

On Wednesday, September 30, 2020 at 1:28:12 PM UTC+2, Bob Jansen wrote:

The tiddlywiki wiki entry on Variables in Wikitext has the example, 

<$set name=animal value=zebra> 
<<animal>> 
</$set>

That's right. Consistency is an issue and we try hard to fix it. ...

TW documentation should consistently use double quotes. It should look like this. I'll create a PR after finishing this post.

<$set name=animal value="zebra"> 
<<animal>> 
</$set>

As long as there are no spaces and "special chars" quotes are not needed.

 
Your cheatsheet, which I know you passed to me before it has been reviewed, has a similar example

<$set name='var' value='Foo'> 
<<taggingByVar>> 
</$set>

It's the users taste. So users can use different quotes if they want. The macro call syntax is described in the docs. The search string is "macro call"
 
Note one difference, the use of quotes around the variable name and value attributes. So which is it, are quotes required or not? Do quotes matter? I would assume quotes do matter and if so why does the official documentation leave them out.

See the link above. Quotes do matter as soon as you have special characters in parameter values. That's why the rule for TW PRs with documentation is: Quotes must be used. ... BUT I'm sure there are some oversights.

I'll post a link to the PR. If you find more problems tell me there and I'll try to fix it with that PR.

 
I also assume the macro call should read <<taggingby var>> and this is just a mistype.

<<taggingByVar>>  ... This is a macro call without any parameters. Macro names -- see link above.
 
But this hows that even such a simple statement's documentation is inconsistent.

Sure if you use different sources. Different users have different preferences. ...
For single word values you'll find many of my personal examples here in the group without quotes, because I'm lazy.

The TW docs should have them. ... If not, it needs to be fixed.

 
Now, if quotes don't matter I assume it is because no values have spaces?

right. But as soon as you have other chars than A-Z, a-z and 0-9 you have to use quotes, even if you don't have spaces.
 
But this is an exception rule and as we all know one exception breeds other exceptions and soon we have so many exceptions that the only real exception is the initial idea. In all other programming languages that I know of, strings are quote delimited. A simple lesson learned once and applied all over the place.

You are right, but we can't enforce this, since TW needs to be able to work with copy/pasted html code. Browsers don't enforce those quotes, if they are not needed. They use what's intended.

We have

<$list filter="[tag[x]]" /> and we can have <$list filter=<<myFilter>> /> which is a completely different thing

The first example shows all tiddlers tagged: x

The second example uses a filter, that is stored in a variable named: myFilter. A working code for the second example is:

\define myFilter() [tag[x]]

<$list filter=<<myFilter>> />

Yes ... internally macros are variables.

 <$list filter="<<myFilter>>" />  will be interpreted as a tiddler name <<myFilter>>, which probably doesn't make sense for most users.

 
Your cheatsheet on the <VAR> element states
"Does only work as a filter variable, inside or outside a macro:"
As something is either inside or outside of a macro, this should always work as a filter variable then cause it can't be in any other state so the statement doesn't make sense.

A link would be nice, so others can follow. I can't comment on this one. 

Another example, concatenation of strings. Search for concatenate in TW documentation and you get the  tiddler, Concatenating text and variables using macro substitution, which categorically states that the only way to do this is to use a macro. So I used a macro. Could not get the macro to function as expected inside a $list loop. You and Eric explained that it can not be used this was inside a $list loop but where does it state that in the documentation?

YES. This is one of the biggest sins in TW docs and how TW works. It causes problems for every new user and getting it right in bigger junks of code is hard, even for advanced users. .. I do have an idea to solve it, but not enough "pain" / time to fix it.

 
Many of the examples in the TW documentation use what appears to be a macrocall of some sort to perform the example. So you cannot see the actual statements used, you can only see the result of the macrocall. Not very helpful really is it. Why not just use simple statements that anyone can follow after all we are after a real example to see how things are done.

I don't know exactly, what you mean here. Can you provide a link? ... I think I know what you mean, but I'm not sure.


As for referencing values inside tiddlers, it seems there are many possibilities involving various configurations of quotes/brackets/braces/underscores. Why is there not a single method of referencing content?

A single method wouldn't be enough. ... But there could be less. TW 5 Version 1 aka: V5.1.0 had less possibilities. Especially filters [1]. But you probably wouldn't want to use it, because it can't do what you want. There have been 30 widgets, with about half the functionality.

Eric, in an earlier email, described it as the calling context's problem to work out what is required. Yet in all other programming languages that I have used over the 40+ years of my programming, referencing a variable is always the same in a particular language, it is not dependent on the calling content, nor is it dependent on how it is being used, it is defined in the grammar of the language.

IMO that's not true. Variables do have a scope. They can be local and global. They can be referenced by name or as a pointer with a different name. ... And so on.

With TW we also need different ways to reference tiddler content and variables. ... The problem may be, that these syntax elements look very similar.

It's getting more complex if we want to use it within a filter expression.


Now maybe this is an attribute of web applications. Maybe it is the result of organic development as Atro states. Whatever it is, it is bloody difficult to grasp and so becomes very frustrating. 

Thank you for discussing your problems. ... Others would have thrown the whole thing away. You started a discussion, so there seems to be something, that you like.

You are right. Frustration is a topic at the beginning. .. Be assured you are not the only one, that felt that way. ... Be assured, I sometimes felt stupid, but I'm sure I'm not ;)

 
My development progress at this stage is a single wikitext statement at a time involving much input from the helpful people on this group.Each time, I learn a bit more but applying that learning quickly fails with the next statement.

Your email to Atro and I asks, "perhaps you can't see the logic yet"

Yea. The learning curve is steep, but IMO it's worth it.
 
Too right! I don't see any logic yet.

 
I have studied your cheatsheet and the references it makes to others' work as well as various emails from Eric and the Tiddlywiki documentation and I still don't see any logic in it.  Perusing the emails on this list indicates I am not the only one and there seems to be some recognition that this is a real problem for TW uptake.

Right.
 
Someone earlier suggested I contribute to the documentation but I don't understand enough to be able to do that. Any contribution I could make would, right now, be wrong, misleading and totally misunderstanding of the design philosophy behind TW.

You are contributing already! ... For us it is important, that new users tell us their problems. That's the only way we can fix them.
 
I am continuing to use TW for my web app but at some stage will have to make the decision as to whether it is worth my time and effort to continue. I feel TW has a great potential but believe the development side needs to be addressed.
 
I am nearly 60% way through another TW app that simple involves my editing content and this is working well and is getting welcome acceptance. http://cultconv.com/English/Conversations/MacQueen_Mary/TiddlyWiki/index.html. FYI, for this application, I have created a Filemaker Pro database into which I type the various content elements and then generate the required Wikitext which I then cut and past into the appropriate tiddler. This has proved very efficient over typing directly into TW. 

Nice example!
 
Hope that helps a little bit.

have fun!
mario

[1] TiddlyWiki5 Version 1 --- http://tw5-1-0.tiddlyspot.com/#FilterOperators  just to see the differences ;)

Ed Heil

unread,
Sep 30, 2020, 11:53:24 AM9/30/20
to TiddlyWiki
As a programmer myself, I would agree agree that tiddlywiki doesn't let you exploit your existing programming knowledge very much at all.  It's very different from most programming environments, in that it's almost entirely declarative, it operates by transforming an underlying series of entities which are a superset of HTML; it has several different "syntaxes" that are appropriate in different contexts and interact in sometimes unexpected ways, or require unexpected means to make them interact...  There's just not much resemblance to the kind of programming most people do, even most web developers.

You kind of have to throw away everything you know about programming and accept that this system operates on its own terms and in its own context, and your existing programming knowledge will apply only in the most general ways.  (Although of course, if you have HTML/CSS knowledge, that knowledge *will* apply with respect to the appearance and structure of the final product of all the underlying transformation.  And if you have existing Javascript knowledge and are developing a JS-based plugin, that knowledge will apply -- but that's very advanced and seldom necessary.)

PMario

unread,
Sep 30, 2020, 12:13:11 PM9/30/20
to TiddlyWiki
Hi

@Bob, The PR is active at: https://github.com/Jermolene/TiddlyWiki5/pull/4870  If you find more inconsistencies, that drove you crazy, let me know and we will see, how we can approve.

The best way it can work is, if you directly write down, what would have helped you, in your words. .. I'll check if and how it can be implemented.

have fun!
mario


Saq Imtiaz

unread,
Sep 30, 2020, 12:46:03 PM9/30/20
to TiddlyWiki
Perhaps adding a note in the String concatenation documentation, about using filter operators if concatenating within filters, would be helpful.I suspect that documentation hasn't been updated since the filter operators were extended with addsuffix, addprefix etc.

Dr Bob Jansen

unread,
Sep 30, 2020, 1:46:41 PM9/30/20
to tiddl...@googlegroups.com
Hi All,

Read with interest all the comments. I am trying to help and it is warming to read that you seem to agree. Other lists I have been on are less welcoming.

Imtaz's comments are right but I would go further and argue for a rewrite of all the filter docs. The one thing I have learned is the central and crucial role of filters to the extent that I believe they need a 'Book' on their own. Filters drive just about everything and understanding them, their role and how to code them is most crucial.

Secondly, how to address stuff needs a rewrite, what bracket/brace/underscore configuration drives me crazy and every time I get my problem fixed and then apply that to the next wiki text statement to have it fail makes things worse. I don't believe the problem is because TW is a declarative language. I have used other such languages and they don't suffer from this. It sounds as if the scope of today's browsers contributes and maybe that needs to be looked at. Looking at HTML/CSS though, the early days of hard coding have been replaced by IDE's. Maybe TW needs to change to something like an IDE with sound foundation in language grammar and possibly restrict what can be done through the IDE but with a hook to let the experienced programmer do what they want with appropriate responsibilities on results of course.

Mario, the examples I mentioned used code like '.operator parameter'. I'll find some and mail them to this list.

BobJ
---------------
Dr Bob Jansen
The Cultural Conversations project 
Turtle Lane Studios Pty Ltd trading as the Australian Centre for Oral History
122 Cameron St, Rockdale NSW 2216, Australia 
Ph (Korea): +82 10-4494-0328 
Ph (Australia) +61 414 297 448 
Resume: http://au.linkedin.com/in/bobjan 
Skype: bobjtls 
KakaoTalk: bobjtls 

 In line with the Australian anti-spam legislation, if you wish to receive no further email from me, please send me an email with the subject "No Spam"
--
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/jQpUdgQQQWc/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/fc76e5e6-c223-4fa8-95d0-2e3a0fb47222o%40googlegroups.com.

Cade Roux

unread,
Sep 30, 2020, 2:13:10 PM9/30/20
to TiddlyWiki
I sympathize.

It's very hard for me to switch gears into TiddlyWiki filter and widget syntax.  I generate my tiddlers with a combination of SQL and PowerShell within and around a source template TW.  So I am dealing with two completely different declarative models (TW - plus HTML/CSS - and SQL queries) and four different imperative models (C#, Javascript, PowerShell, SQL procedures) on a daily basis.

I am trying to let each be the best at what it does.  So in cases where I might have previously generated an HTML table to put in a tiddler, I am instead replacing that with a macro based on a list(s) of elements put into a field(s) in the tiddler, and generating more of the raw data into the fields of the tiddlers and let them render more things based on their attached data.

I find the filters are really hard to deal with finding which one you need.  The names are so generic and terse and they are so varied.  I mean we have tag, tags and tagged which all have to do different things.  And ones like each, get, has, is, contains - all needed obviously for their different input and semantics, but it's hard to keep them all in your head there are so many compared to other languages.

I use a macro to do edit/transclusion extensively, to allow the medical informaticist to edit tiddlers which annotate things in various places which need handwritten narratives - so he gets quick feedback since everything is transcluded, he can see the results immediately as if he was building the manual in Word or some other documentation tool without having to cut and paste in new lists of things generated from the datamart.  He just transcludes them and when they are regenerated, they are updated.

Because we have a combination of edited manual tiddlers and generated tiddlers, and also need source control for our work simultaneously, I tend to relegate all control over the template to the medical informaticist and put anything I want in through the build process - all tiddlers are either in the template or they are generated, there is no mixing.  Once we established that separation (generated tiddlers are marked in a field and are all deleted and recreated during the build process), it has worked very well.  Generated tiddlers can transclude manual tiddlers and vice versa, which truly is wonderful.  It's somehow hard to tell whether the system is filling out a template we have created or we are filling out a template the build process has created - that is very liberating from the point of view of generating a rapidly growing data dictionary for our data mart.  It's a continual learning process and a lot of refactoring and refinement, but I think the process is a lot smoother and less labor intensive than if we had a system that was more biased one way or the other towards whether the main point of view was the generated documentation from manual parts or the manual documentation from generated parts.

Best of luck,

Cade

Bob Jansen

unread,
Sep 30, 2020, 6:54:21 PM9/30/20
to TiddlyWiki
Mario,

to see what I mean about examples, open the TW wiki and search for .oper. You will get 24 retrieved. All the examples use this format.

I can't remember other examples I found....I have 'found' many things and most of them have now been 'lost' :-)

bobj

Joshua Fontany

unread,
Sep 30, 2020, 7:35:38 PM9/30/20
to TiddlyWiki
There IS a lot to absorb, and it was all "grown organically". I think the specific macros you are finding odd are actually defined in the "tw5.com edition", and is part of a set of macros called "documentation macros". These macros use leading punctuation (.operator-example, .warning, .tip, etc). These can be considered "user created" macros (with the user being Jeremy and everyone on the GitHub repository), and the leading period is to separate these into a different "name-space". Granted, this is never called out, and you need to use the Advanced Search's System tab to find the tiddlers that contain these definitions:

\define .icon(_) <span class="doc-icon">{{$_$}}</span>
\define .tip(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/tip}}</div> $_$</div>
\define .warning(_) <div class="doc-icon-block"><div class="doc-block-icon">{{$:/core/images/warning}}</div> $_$</div>

Welcome to the community!

Best,
Joshua Fontany

TW Tones

unread,
Sep 30, 2020, 9:48:45 PM9/30/20
to TiddlyWiki
Bob,


Please accept this reply in the spirit it is intended, as constructive input into the issue of learning TW wikitext and not as an attack on anyone, TW or this group.

That is the way we work here, I personally prefer the "egoless approach".

I will Publish the updated cheat sheet in its own thread in the TiddlyWiki Dev forums, I want peer review before the general membership takes copies. I have provided numeric references.


 

Your cheatsheet, which I know you passed to me before it has been reviewed, has a similar example

<$set name='var' value='Foo'> 
<<taggingByVar>> 
</$set>

I can not find the use of foo in my current version of the cheat sheet.
 

Note one difference, the use of quotes around the variable name and value attributes. So which is it, are quotes required or not? Do quotes matter? I would assume quotes do matter and if so why does the official documentation leave them out. I also assume the macro call should read <<taggingby var>> and this is just a mistype. But this hows that even such a simple statement's documentation is inconsistent. Now, if quotes don't matter I assume it is because no values have spaces? But this is an exception rule and as we all know one exception breeds other exceptions and soon we have so many exceptions that the only real exception is the initial idea. In all other programming languages that I know of, strings are quote delimited. A simple lesson learned once and applied all over the place.

 are quotes required or not? (yes/no) Do quotes matte? (yes)

This is a case of falling back on well establish practices in coding here are a set of examples

value='Foo' lets generalise to parname=value

If value is a single word not containing spaces or other delimiters parname=value (no quotes)
If value is two words spaces parname='value word2' parname="value word2" parname="""value word2""" all work. note double "" does not.
Then as the documentation outlines, but is a logical necessity on almost every computer on earth (this is my point, not intended as belittling)
  • If you want to use a delimiter such as ' or " in a string you must use the other 
  • If our value is parname="something "quote here" something else" it does not know when it is starting or ending
  • parname='something "quote here" something else' this works 
  • parname="something 'quote here' something else" as does this
  • The advantage of the triple quotes is they rarely appear in content so parname="""something 'quote here' and "here is another" something else""" works and is the most reliable.
The above are the rules for literals, or fixed typed values.
  • Tiddlywiki uses quotes for literals so if you put it around other things '<<macroname>>'  "<<macroname>>" """<<macroname>>""" it turns it into a literal
  • However when we use the following as a parameter or attribute value they are already delimited by the << or {{ or {{{ so no need to add quotes and turn them into literals.
    • parname=<<macroname>> 
    • parname=<<varname>> 
    • parname={{{ [filter] }}} 
    • parname={{!!fieldname}} 
    • parname={{tiddlername}}  
    • parname={{tiddlername!!fieldname}} 
  • But in the above cases the value is retrieved from elsewhere, and that value needs to be appropriate for the parameter you are providing.
  • Keep in mind double and triple braces are used in wikitext because html tags <div></div> etc... are permitted in wiki text, So we need << to separate them from <
    • only singles are required in filters because filters do not handle html tags.
 Bob can you review the following again to see if they are still issues in my new version.

<issues>
Your cheatsheet on the <VAR> element states
"Does only work as a filter variable, inside or outside a macro:"
As something is either inside or outside of a macro, this should always work as a filter variable then cause it can't be in any other state so the statement doesn't make sense.
 
I think this is gone and replaced 


Another example, concatenation of strings. Search for concatenate in TW documentation and you get the  tiddler, Concatenating text and variables using macro substitution, which categorically states that the only way to do this is to use a macro. So I used a macro. Could not get the macro to function as expected inside a $list loop. You and Eric explained that it can not be used this was inside a $list loop but where does it state that in the documentation?

The section on The value of Substitutions  kind of addresses how we use macros to do concatenation,  but the section on ❻ More on filtered transclusions
 

Many of the examples in the TW documentation use what appears to be a macrocall of some sort to perform the example. So you cannot see the actual statements used, you can only see the result of the macrocall. Not very helpful really is it. Why not just use simple statements that anyone can follow after all we are after a real example to see how things are done.

I agree this is not perfect, it was build to automate a large documentation effort.
 

As for referencing values inside tiddlers, it seems there are many possibilities involving various configurations of quotes/brackets/braces/underscores. Why is there not a single method of referencing content? Eric, in an earlier email, described it as the calling context's problem to work out what is required. Yet in all other programming languages that I have used over the 40+ years of my programming, referencing a variable is always the same in a particular language, it is not dependent on the calling content, nor is it dependent on how it is being used, it is defined in the grammar of the language. Now maybe this is an attribute of web applications. Maybe it is the result of organic development as Atro states. Whatever it is, it is bloody difficult to grasp and so becomes very frustrating. 

This is still true in tiddlywiki but you are forced to use the appropriate delimiters because we mix code with content such as wiki text. You may very well see "referencing a variable is always the same in a particular language" but I dispute this assertion, most languages have typing or delimiter requirements as well.
 

My development progress at this stage is a single wikitext statement at a time involving much input from the helpful people on this group.Each time, I learn a bit more but applying that learning quickly fails with the next statement.

Yes, if this is occurring we need our community to smooth the learning and documentation.
 

Your email to Atro and I asks, "perhaps you can't see the logic yet"

Too right! I don't see any logic yet. I have studied your cheatsheet and the references it makes to others' work as well as various emails from Eric and the Tiddlywiki documentation and I still don't see any logic in it.  Perusing the emails on this list indicates I am not the only one and there seems to be some recognition that this is a real problem for TW uptake.

I agree it may be a problem for uptake, we own this and we can/will remedy it. However although it may seem irrational, it is not, and It is almost all logical to me now. Personally I found my experience as coding in procedural programming languages sometimes a barrier to some conceptual leaps. 
 

Someone earlier suggested I contribute to the documentation but I don't understand enough to be able to do that. Any contribution I could make would, right now, be wrong, misleading and totally misunderstanding of the design philosophy behind TW.

I am continuing to use TW for my web app but at some stage will have to make the decision as to whether it is worth my time and effort to continue. I feel TW has a great potential but believe the development side needs to be addressed.

I am nearly 60% way through another TW app that simple involves my editing content and this is working well and is getting welcome acceptance. http://cultconv.com/English/Conversations/MacQueen_Mary/TiddlyWiki/index.html. FYI, for this application, I have created a Filemaker Pro database into which I type the various content elements and then generate the required Wikitext which I then cut and past into the appropriate tiddler. This has proved very efficient over typing directly into TW. 

This can only be the case that you are more familiar with Filemaker Pro database than tiddlywiki, it sounds like a wasteful procedure, but I understand we use what we know.
 

Hope this helps. Happy to discuss further and do what I can to address these concerns/issues.

bobj

Thanks and lets move forward.

Tones 

TW Tones

unread,
Sep 30, 2020, 10:04:20 PM9/30/20
to TiddlyWiki
Ed,

My programming days was more in the past, but I would argue that tiddlywikis approach is different for a fundamental reason of architecture. If you were to build something similar in any language you would have to ensure the following and it would complicate the program massively;
  • Cause all and any change in the whole solution to flow through immediately to all references to that changed item
  • Render all visible objects when a change occurs but do so efficiently, including dealing with potential loops
  • Allow the transclusions of transclusions etc... to work and be reliable and avoid loops.
  • Now wrap the vast majority of this is an environment that is somewhat accessible to almost everyone 
  • Create not just an application but a platform which can be used to design and document itself.
In the face of these facts it is my option tiddlywiki does the best job I have ever seen. Yes we want to improve documentation and teach the concepts effectively to improve ease of adoption and share the concepts.

TiddlyWiki is not just a non-trivial Quine but a Quine platform.

Regards
Tones

TW Tones

unread,
Sep 30, 2020, 10:18:52 PM9/30/20
to TiddlyWiki

On Sunday, 27 September 2020 16:52:29 UTC+10, Bob Jansen wrote:

TW Tones

unread,
Sep 30, 2020, 10:37:59 PM9/30/20
to TiddlyWiki
Related matter;

I recall on my own learning journey that much of the Tiddlywiki.com documentation had ONLY example with literals

eg;
<<macro tiddlername subtiddler>>
The above is true but limited!

More often that not the user wishes to provide the value "tiddlername" programmatically, such as a result of concatenation.

Of course we learn that to do so using the macrocall Widget but this suggests to me every macro documented should have is variouse formes of "macrocall" documented as well.

eg `<<tag tagname>>` <$macrocall $name=tag tag={{!!mytag}}/>

With a note on how to find the names of parameters because you cant provide parameters without a name in macrocalls.

My point this more useful form of every macro is rarely documented.

Regards
Tony

Ed Heil

unread,
Oct 1, 2020, 8:43:28 AM10/1/20
to tiddl...@googlegroups.com
Tones,

Agreed on all points.  I didn't meant to suggest that the differences between Tiddlywiki and other programming environments are arbitrary or random.  Generally TW is the way it is so it can do the things it does.

PMario

unread,
Oct 1, 2020, 10:47:55 AM10/1/20
to tiddl...@googlegroups.com

On Wednesday, September 30, 2020 at 1:28:12 PM UTC+2, Bob Jansen wrote:

Many of the examples in the TW documentation use what appears to be a macrocall of some sort to perform the example. So you cannot see the actual statements used, you can only see the result of the macrocall. Not very helpful really is it. Why not just use simple statements that anyone can follow after all we are after a real example to see how things are done.

As Joshua pointed out, that's the use of so called documentation macros. We needed to use them because, the "default" approach is a maintenance horror ... and many users requested a "copy to clipboard" button.

eg: To document the action-setfield widget we used a similar wikitext code as follows:


```
<$button>
<$action-setfield $tiddler="$:/state/tab-1749438307
7" text="$:/core/ui/ControlPanel/Appearance"/>
<$action-navigate $to="$:/ControlPanel"/>
Go to Control Panel "Appearance" tab
</$button>
```

renders as:

<$button>
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$:/core/ui/ControlPanel/Appearance"/>
<$action-navigate $to="$:/ControlPanel"/>
Go to Control Panel "Appearance" tab
</$button>

... and the underlying HTML is

```
<p><button class="">
Go to Control Panel &quot;Appearance&quot; tab
</button></p>
```

The nightmare comes now: What if I want to add a class definition to the  button widget like so:  <$button class=test>

How many changes do I need to fix it. ...  3 ...

No it's 6 because I actually found out I should have done: <$button class="tc-btn-xyz">

That's the reason, why we use a macrocal for may examples. ... There should be only 1 "source of truth", for examples. ... because the worst thing that can happen is, that the rendered code works, but the code to be used by the user has a typo. If I wouldn't have highlighted it, you would have searched for hours. ... right?

As a side effect, the "copy to clipboard" button is available for many examples. .. That's the one to be used.

BUT if you open the tiddler you as a programmer will see this:

<$macrocall $name='wikitext-example'
src='<$button class="tc-btn-xyz">
<$action-setfield $tiddler="$:/state/tab-1749438307" text="$:/core/ui/ControlPanel/Appearance"/>
<$action-navigate $to="$:/ControlPanel"/>
Go to Control Panel "Appearance" tab
</$button>
'/>

The code that will be copied to the clipboard is highlighted in light blue.

That's confusing. But even more confusing would have been an example the looks right for the user, but doesn't work if you copy / paste the code, to test it.

I did add a file to play with.

hope that helps
-mario


test-doc-macro.json
Reply all
Reply to author
Forward
0 new messages