[tw5] Re: Chinese characters in Stroll doesn't work well

2022-01-23 Thread fh hf
Hi David. Thanks for your Stroll and your kind reply.

I've tried to change ` $:/config/Search/MinLength` to 2 or 1, but it didn't 
work, even after saved and reloaded.

在2022年1月23日星期日 UTC+8 00:11:58 写道:

> Hi fh hf! Welcome to TiddlyWiki / Stroll!
>
> I think this is caused by Tiddlywiki's minimum length for search strings. 
> I think if you go into $:/config/Search/MinLength in the shadow tiddlers 
> and reduce 3 to 2 or 1 you will solve this problem. But it also means 
> searching could take longer. When you search for every tiddler with one 
> character, you will turn up a lot of results.  
>
> On Saturday, January 22, 2022 at 1:41:48 AM UTC-6 fh hf wrote:
>
>>
>> Hello, I'm new to use Stroll with TiddlyWiki and there is some problem 
>> when use Stroll in Chinese situation.
>>
>> Here is the problem:
>>
>> 1. When the title is chinese, the reference below doesn't show context of 
>> other tiddlers link to it, only links. But when the tittle's length is 
>> longger, say length 4, the context works.
>>
>>
>>
>> 2. When a tiddler has reference linked to it, the refernce below doesn't 
>> show context if the context has chinese characters.
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/5e6a015b-06a4-43e9-8403-c4287ca076f9n%40googlegroups.com.


[tw5] Re: dynamically building a string by concatenation in a macro

2022-01-23 Thread PMario
On Saturday, January 22, 2022 at 7:07:59 PM UTC+1 CarloGgi wrote:
...

> Now, before I ask why ON EARTH the above code doesn't work, let me say 
> that I expect for it to be because of how macros are parsed and when macro 
> substitution is made, in which case I will do a little comment on it later.
>

There is some docs about string concatenation. 
https://tiddlywiki.com/#Concatenating%20text%20and%20variables%20using%20macro%20substitution
-m

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/9cb38ee4-ff8a-4c64-92fa-81b75249bcd0n%40googlegroups.com.


Re: [Talk TW] [Google Group (Read Only)] [tw5] dynamically building a string by concatenation in a macro

2022-01-23 Thread Brian Theado
Jeremy,

That is a very enlightening way of explaining it. I wasn't sure where in
the docs this exact explanation would fit, but I did make a PR at
https://github.com/Jermolene/TiddlyWiki5/pull/6417 which adds warnings
about the non-recursive nature of attribute value processing.

On Sun, Jan 23, 2022 at 8:41 AM Jeremy Ruston 
wrote:
[...]

> A simple tranclusion like the following works in two distinct steps:
> first, it retrieves the text of the tiddler "foobar", and then it
> recursively processes the retrieved text as if it had appeared in the same
> place as the transclusion. This deals with any wikitext within it.
>
> ```
> {{foobar}}
> ```
>
> In the case of using a transclusion as an attribute we get the same
> actions: it retrieves the text of the transcluded tiddler and then treats
> the text as if it had appeared in the same place as the transclusion, which
> means that it is treated as a literal string.
>
> ```
> 
> ```
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/CAO5X8CxRnvwVPxRqUZD8bHS99ogZD%2BMdgTtyQWY_urp6VB0WNg%40mail.gmail.com.


[tw5] Re: Dynamic class

2022-01-23 Thread Thomas Schnetzer
Many thanks this works!

Eric Shulman schrieb am Sonntag, 23. Januar 2022 um 10:41:15 UTC+1:

> Remove the quotes around `"""<>"""`.  Like this:
> ```
> <$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
> class=<> />
> 
> <$macrocall $name="testFunction" alignmentTabs=<> 
> tName="""$tName$""" />
> 
> ```
> On Sunday, January 23, 2022 at 1:29:55 AM UTC-8 thomas.sch...@gmail.com 
> wrote:
>
>> Hello Marc
>> I tested this only the last Test shows the Tabs Vertical
>> Thanks for your help.
>>
>> ```
>> \define testFunction(alignmentTabs:"", tName:"" )
>> Second Test: <>,$alignmentTabs$
>>
>> <$macrocall $name="tabs" tabsList="[tag[$tName$]nsort[order]]" 
>> class="""$alignmentTabs$""" />
>>
>> \end
>>
>> \define dynamicTabs(current:"", tName:"" )
>>
>> <$set name="alignmentTabs" value="tc-vertical" >
>> First Test: <>,$alignmentTabs$
>>
>> <$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
>> class="""<>""" />
>> 
>> <$macrocall $name="testFunction" alignmentTabs="""<>""" 
>> tName="""$tName$""" />
>> 
>>
>> Last Test:
>> <$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
>> class="tc-vertical" />
>> 
>> ''
>> \end
>>
>> <$macrocall $name="dynamicTabs" current=<> 
>> tName="TableOfContents"/>
>> ```
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/27f6aa0f-1e78-4df2-b649-66806af35669n%40googlegroups.com.


Re: [Talk TW] [Google Group (Read Only)] [tw5] dynamically building a string by concatenation in a macro

2022-01-23 Thread Jeremy Ruston
My reply used the jargon because I was being brief.

It's really not as irregular as it appears; it's largely a matter of ones terms 
of reference. It's like the difference between an expression and a string 
literal `a=b+c` and `a="b+c"`, if you're familiar with programming languages.

A simple tranclusion like the following works in two distinct steps: first, it 
retrieves the text of the tiddler "foobar", and then it recursively processes 
the retrieved text as if it had appeared in the same place as the transclusion. 
This deals with any wikitext within it.

```
{{foobar}}
```

In the case of using a transclusion as an attribute we get the same actions: it 
retrieves the text of the transcluded tiddler and then treats the text as if it 
had appeared in the same place as the transclusion, which means that it is 
treated as a literal string.

```

```

Best wishes

Jeremy



--
Jeremy Ruston
jer...@jermolene.com
https://jermolene.com

> On 23 Jan 2022, at 12:32, CarloGgi via Talk TW  
> wrote:
> 
> 
> @jeremy thanks for the clarification. So it seems that you can correctly (in 
> the sense of *syntactically* correct) use a macro call as argument of a 
> widget attribute, but functionally fail to have it work as intended. This 
> shows clearly that TW is way too much stuffed with booby-traps and something 
> must be definitely done to make coding easier and safer for the average user. 
> 
> We need a stricter syntax, even at the expense of flexibility, to spare the 
> user from these pitfalls, and we need debugging tools to make him easily 
> single out the problem when syntax doesn't help. We cannot go on relying on 
> knowledge of how the parser and 'wikifier' behaves, it simply cannot be 
> viable if TW is to become widely used as is everybody's wish.
> I'm not a complete beginner in programming, and as a matter of fact I spend 
> 50% of coding time trying to debug obscure malfunctioning that mostly turns 
> out to require a developer-level knowledge of the parser to be worked out: I 
> dare say that this scares away a lot of would-be users after the first, 
> frustrating attempts.
> 
> In the meantime that TW morphs to something less tricky, a huge effort should 
> be done IMHO in bettering the documentation so that the user is aware of the 
> pitfalls left open by its syntax.
> 
> Thanks and regards,
> CG
> 
>> On Saturday, January 22, 2022 at 11:05:03 PM UTC+2 jeremy...@gmail.com wrote:
>> Hi Charlie
>> 
>>> I often say "first things first, consider upgrading", but 5.2.1 has the 
>>> same issue.  So I say stick with what you have if it is working no-worse 
>>> than the latest.
>> 
>> The problem is that the OP is using the macro "templatename" as an attribute 
>> value in the `<$action-createtiddler>` widget, which means that wikitext 
>> content will not be processed ("wikified"), so the transclusion in the macro 
>> is ignored.
>> 
>> The workaround is to use textual substitution within the macro (in other 
>> words the $param$ and $(var)$ syntax).
>> 
>>> As for bug-reporting, that, to me, is a crappy process that needs some 
>>> tender loving care, including a need to update the related circa 2014 
>>> documentation (ReportingBugs).
>> 
>> "Crappy"?
>> 
>> It would be more helpful to explain the specific problems you see, and 
>> perhaps suggest improvements.
>> 
>> Best wishes
>> 
>> Jeremy
>> 
>> 
>>> 
>>> Rock'n roll !
>>> 
>>> 
>>> 
>>> 
>>> 
> On Saturday, January 22, 2022 at 4:31:45 PM UTC-4 CarloGgi wrote:
> It worked like a charm, thanks! 
> If it is really a bug, is there a dedicated place to submit it for 
> analysis?
> 
> My TW version is 5.2.0
> 
> Thanks again and regards,
> CG
> 
>> On Saturday, January 22, 2022 at 9:57:46 PM UTC+2 cj.v...@gmail.com 
>> wrote:
>> TiddlyTalk is a pain.  Let me try pasting that code again so that it 
>> shows okay over there.
>> 
>> ```
>> <$button>
>>  <$action-createtiddler
>>  $basetitle="testTiddler"
>>  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
>> }}} >
>> 
>>  <$action-navigate $to=<>/>
>>  
>>  create new test tiddler
>> 
>> ```
>> 
>>> On Saturday, January 22, 2022 at 3:53:48 PM UTC-4 Charlie Veniot wrote:
>>> I'm thinking you found a bug related to how the action-createtiddler 
>>> handles the $template parameter.
>>> 
>>> In the meantime (i.e. until there is a fix or somebody can explain this 
>>> "feature" going on) ...
>>> 
>>> The following seems to work A-1 for me in my testing (ignore the "pre" 
>>> tags):
>>> 
>>> 
>>> <$button>
>>>  <$action-createtiddler
>>>  $basetitle="testTiddler"
>>>  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
>>> }}} >
>>> 
>>>  <$action-navigate $to=<>/>
>>>  
>>>  

Re: [tw5] Re: dynamically building a string by concatenation in a macro

2022-01-23 Thread CarloGgi
@jeremy thanks for the clarification. So it seems that you can correctly 
(in the sense of *syntactically* correct) use a macro call as argument of a 
widget attribute, but functionally fail to have it work as intended. This 
shows clearly that TW is way too much stuffed with booby-traps and 
something must be definitely done to make coding easier and safer for the 
average user. 

We need a stricter syntax, even at the expense of flexibility, to spare the 
user from these pitfalls, and we need debugging tools to make him easily 
single out the problem when syntax doesn't help. We cannot go on relying on 
knowledge of how the parser and 'wikifier' behaves, it simply cannot be 
viable if TW is to become widely used as is everybody's wish.
I'm not a complete beginner in programming, and as a matter of fact I spend 
50% of coding time trying to debug obscure malfunctioning that mostly turns 
out to require a developer-level knowledge of the parser to be worked out: 
I dare say that this scares away a lot of would-be users after the first, 
frustrating attempts.

In the meantime that TW morphs to something less tricky, a huge effort 
should be done IMHO in bettering the documentation so that the user is 
aware of the pitfalls left open by its syntax.

Thanks and regards,
CG

On Saturday, January 22, 2022 at 11:05:03 PM UTC+2 jeremy...@gmail.com 
wrote:

> Hi Charlie
>
> I often say "first things first, consider upgrading", but 5.2.1 has the 
> same issue.  So I say stick with what you have if it is working no-worse 
> than the latest.
>
>
> The problem is that the OP is using the macro "templatename" as an 
> attribute value in the `<$action-createtiddler>` widget, which means that 
> wikitext content will not be processed ("wikified"), so the transclusion in 
> the macro is ignored.
>
> The workaround is to use textual substitution within the macro (in other 
> words the $param$ and $(var)$ syntax).
>
> As for bug-reporting, that, to me, is a crappy process that needs some 
> tender loving care, including a need to update the related circa 2014 
> documentation (ReportingBugs ).
>
>
> "Crappy"?
>
> It would be more helpful to explain the specific problems you see, and 
> perhaps suggest improvements.
>
> Best wishes
>
> Jeremy
>
>
> Rock'n roll !
>
>
>
>
>
> On Saturday, January 22, 2022 at 4:31:45 PM UTC-4 CarloGgi wrote:
>
>> It worked like a charm, thanks! 
>> If it is really a bug, is there a dedicated place to submit it for 
>> analysis?
>>
>> My TW version is 5.2.0
>>
>> Thanks again and regards,
>> CG
>>
>> On Saturday, January 22, 2022 at 9:57:46 PM UTC+2 cj.v...@gmail.com 
>> wrote:
>>
>>> TiddlyTalk is a pain.  Let me try pasting that code again so that it 
>>> shows okay over there.
>>>
>>> ```
>>> <$button>
>>>  <$action-createtiddler
>>>  $basetitle="testTiddler"
>>>  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
>>> }}} >
>>>
>>>  <$action-navigate $to=<>/>
>>>  
>>>  create new test tiddler
>>> 
>>> ```
>>>
>>> On Saturday, January 22, 2022 at 3:53:48 PM UTC-4 Charlie Veniot wrote:
>>>
 I'm thinking you found a bug related to how the action-createtiddler 
 handles the $template parameter.

 In the meantime (i.e. until there is a fix or somebody can explain this 
 "feature" going on) ...

 The following seems to work A-1 for me in my testing (ignore the "pre" 
 tags):

 
 <$button>
  <$action-createtiddler
  $basetitle="testTiddler"
  $template={{{ [[BASENAME-]addsuffix{!!grammar_class}] 
 }}} >

  <$action-navigate $to=<>/>
  
  create new test tiddler
 
 

 On Saturday, January 22, 2022 at 2:07:59 PM UTC-4 CarloGgi wrote:

> hallo folks,
> i need to feed the $template parameter of an <$action-createtiddler> 
> widget with the correct template tiddler's name. The latter has a fixed 
> part 'BASENAME' and a parameterized (or variable) suffix, which is 
> choosen 
> by means of a <$select> input. The idea is to have a macro build the full 
> name based on the choice made by using <$select>, like in:
>
> \define templatename() BASENAME-{{!!grammar_class}}
>
> the suffix, as you can imagine, is taken from field grammar_class 
> which is set by the <$select> widget control.
>
> Now one would expect that things would work nice and easy writing this 
> code:
>
> <$button> create new test tiddler
>  <$action-createtiddler 
>  $basetitle='testTiddler'
>  $template=<> >
>  <$action-navigate $to=<>/>
>  
> 
>
> but disappointingly enough they do not! The new tiddler is created 
> indeed, but from NO TEMPLATE at all!
> Funny as it is, if we add a debug line like:
>

[tw5] Re: Dynamic class

2022-01-23 Thread Eric Shulman
Remove the quotes around `"""<>"""`.  Like this:
```
<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
class=<> />

<$macrocall $name="testFunction" alignmentTabs=<> 
tName="""$tName$""" />

```
On Sunday, January 23, 2022 at 1:29:55 AM UTC-8 thomas.sch...@gmail.com 
wrote:

> Hello Marc
> I tested this only the last Test shows the Tabs Vertical
> Thanks for your help.
>
> ```
> \define testFunction(alignmentTabs:"", tName:"" )
> Second Test: <>,$alignmentTabs$
>
> <$macrocall $name="tabs" tabsList="[tag[$tName$]nsort[order]]" 
> class="""$alignmentTabs$""" />
>
> \end
>
> \define dynamicTabs(current:"", tName:"" )
>
> <$set name="alignmentTabs" value="tc-vertical" >
> First Test: <>,$alignmentTabs$
>
> <$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
> class="""<>""" />
> 
> <$macrocall $name="testFunction" alignmentTabs="""<>""" 
> tName="""$tName$""" />
> 
>
> Last Test:
> <$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
> class="tc-vertical" />
> 
> ''
> \end
>
> <$macrocall $name="dynamicTabs" current=<> 
> tName="TableOfContents"/>
> ```
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/59e9c179-1947-406b-93f5-174d8d1cb51an%40googlegroups.com.


[tw5] Re: Dynamic class

2022-01-23 Thread Thomas Schnetzer
Hello Marc
I tested this only the last Test shows the Tabs Vertical
Thanks for your help.

```
\define testFunction(alignmentTabs:"", tName:"" )
Second Test: <>,$alignmentTabs$

<$macrocall $name="tabs" tabsList="[tag[$tName$]nsort[order]]" 
class="""$alignmentTabs$""" />

\end

\define dynamicTabs(current:"", tName:"" )

<$set name="alignmentTabs" value="tc-vertical" >
First Test: <>,$alignmentTabs$

<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
class="""<>""" />

<$macrocall $name="testFunction" alignmentTabs="""<>""" 
tName="""$tName$""" />


Last Test:
<$macrocall $name="tabs" tabsList="""[tag[$tName$]nsort[order]]""" 
class="tc-vertical" />

''
\end

<$macrocall $name="dynamicTabs" current=<> 
tName="TableOfContents"/>
```

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d8bc9231-a075-4cd9-8f10-a7e3f486de56n%40googlegroups.com.