[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-24 Thread Misterel85
Hi Tones,

Thank you very much for your solution. Being away from my computer for the 
last few days, I could try it only this afternoon. I managed to twist it to 
my needs and it seems to work fine, which is great!

I understand the way you implemented your solution, but I have three 
specific questions about the code you used, in order to grasp the details 
that still elude me.

1) You used `variable=nul` 5 times in your code, for at least two 
(seemingly) different list filters. Why did you use the same variable name? 
And why did you choose that name? How useful is it to declare a variable in 
a list filter? Could we make do without it?


2) You also chose to use `$wikify` at some point. Why did you choose that?
In my adaptation of your code, I had to replace:

```
<$wikify name=details-start text="""{{{ [all[current]get[details]split[ 
]first[]] }}}""">
```

with:

```
<$set name=details-start value={{{ [all[current]get[details]split[ 
]first[]] }}}>
```

because it wouldn't work properly otherwise. (Some closing tags such as 
`` would show as text.)


3) How does `+[limit[1]` work? What does the plus sign mean here? Wouldn't 
it be okay to just use `[all[current]has[fieldname]]`?


Thanks again, Tones.

-Stéphane

Le jeudi 19 août 2021 à 05:31:03 UTC+2, TW Tones a écrit :

> Stephanie
>
> It took a little time to wade through the combinations. I also found there 
> are possibly many ways to do this.
>
> The attached json has a view template that displays the detail or 
> references if they exist according to your specs, the view template itself 
> is for all other setting and the testn tiddlers demonstrate each of the 
> formats. 
>
> Here is the content of the viewtemplate
> \define reference-only() {{!!reference}}.
> \define page-reference() {{!!reference}}, {{!!details}}
> \define not-page-reference()
> <$list filter="[lowercase[]match]" 
> variable=nul> 
> {{!!reference}} — {{!!details}}
> 
> <$list filter="[lowercase[]!match]" 
> variable=nul> 
> {{!!reference}}. {{!!details}}
> 
> \end
> 
> <$list filter="[all[current]has[details]] [all[current]has[reference]] 
> +[limit[1]]" variable=nul>
> <$wikify name=details-start text="""{{{ [all[current]get[details]split[ 
> ]first[]] }}}""">
> <$list filter="[all[current]get[details]]" variable=nul 
> emptyMessage=<> >
><$list filter="[match[p.]] [match[pp.]]" 
> emptyMessage=<>  variable=nul>
><>
>
> 
> 
> 
>
> Basically I define some alternative layouts with define, some with logic. 
> These transclude the reference and details fields so any wiki text therein 
> is rendered.
>
> Then from  
>
>- first we test if we have anything todo - reference and/or details 
>has content
>- Then we get and wikify a filtered transclusion to get the first word
>- Then if not details exist we use the  reference-only layout
>- else if we do have details we test if it contains a page-reference 
>and use that layout if so
>- else (emptyMessage) we use the  not-page-reference layout
>   - Every other case uses this.
>
> To handle the first character upper or lower case I am simply testing to 
> see if the first word matches all lower or not, it does the same job but 
> could be tricked. eg "tHis" would trip the capital test. This can be 
> refined, however I expect you would then edit it to correct it anyway.
>
> So the main mechanism I use is the list widget with filtered tests and 
> emptyMessage. As I asserted best put the formatting separate from the 
> content/data.
>
> Regards
> Tones
> On Thursday, 19 August 2021 at 09:48:02 UTC+10 joshua@gmail.com wrote:
>
>> Stéphane,
>>
>> Some-one on GitHub in the bug report (link) mentioned that you can "view" 
>> the raw text of a field with the View Widget.
>>
>> So, where as {{foo!!bar}} is a shortcut for 
>>
>> <$tiddler tiddler="foo"><$translcude tiddler=<> 
>> field="bar"/>
>>
>> You can create a macro that uses the View Widget like so:
>>
>> ```
>> \define viewField(tiddler,field)
>> <$tiddler tiddler=$tiddler$><$view field=$field format="text"/>
>> \end
>>
>> <> <>
>> ```
>> You could even use the View Widget directly if the defaults would do fine:
>>
>> ```
>> <$tiddler  tiddler="tiddler a">
>> <$view  field="foo"/><$view field="bar"/>
>> 
>> ```
>>
>> If you had wikitext in the field that needed 

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-18 Thread Misterel85
Thank you for your very interesting and useful examples, Tones. I didn't 
know about `sentencecase`! I'll keep that post as a reference. 
And thank you very much for proposing your help.

Sorry for not replying sooner. I've spent the last two days thinking those 
field connexion rules over for my project and I can say they are not that 
obvious to define. Anyway, here is something that would correspond to my 
needs, but it needs 'conditional transclusion'. So I gladly accept your 
offer.

So, in order to manage my sources, I have a 'reference' field for general 
information and a 'details' field for any additional information, that I 
must transclude in that order: `reference` + `details`.

Here's how I see things:

* the value in 'details' may start with `p. ` (for page) or `pp. ` (for 
pages).
Then I would connect 'reference' and 'details' with `, ` (comma + 
whitespace).
For instance:
Doe, John. //My Great Exercise Book// (2019), pp. 28-32.

* the value in 'details' may start with a word in lowercase: `exercise 2`, 
`chapter 4`, etc.
Then I would connect 'reference' and 'details' with ` — ` (whitespace + 
dash + whitespace).
For instance:
Doe, John. //My Great Exercise Book// (2019) — chapter 6 exercise 5 p. 
61.

* the value in details may start with the first word having a capital 
letter (uppercase), to start a short sentence.
Then I would connect 'reference' and 'details' with `. ` (period + 
whitespace).
For instance:
August 2018 training session with John Doe. See short video for this 
exercise on YouTube.

* if the `details` field is empty, then I would need to end the 
transclusion of `reference` with `.` (period).

I'm not too sure what I should do if the value in `details` field starts 
with a character that is not a letter, which may happen in very rare cases. 
And I can still alter the value accordingly:
For instance:
[[Comprehensive Exercise Website|www.to.the.link.com]] — "Exercises" 
tab, bottom of page.
might be replaced with:
[[Comprehensive Exercise Website|www.to.the.link.com]]. See "Exercises" 
tab, bottom of page.

I hope the goals I have set are clearly explained and above all doable.

I suppose that making liberal use of list filters and operators such as 
'split', 'join', 'append', 'match', it could be possible to build those 
'conditional field transclusions', but I don't think I could do that alone!

Regards,

-Stéphane

Le lundi 16 août 2021 à 14:45:29 UTC+2, TW Tones a écrit :

> Misterel,
>
> Perhaps my writing is not so helpful, but my advice is intended to make it 
> simpler for you. I would be happy to write the code to resolve the 
> concatenation of various text snippets into sentence like text. All I would 
> need is samples of the text you whish to join (without presentation related 
> hacks eg leading spaces etc...
>
> The first examples would be foo="This is foo"  bar="and this is bar." 
> please join as a sentence.
>
> Feel free to be pragmatic and decline my offer but also feel free to ask.
>
> Here are some examples to look at, paste into a tiddler on tiddlywiki.com, 
> add the foo and bar fields as before. 
> See how alice and bob values are independent of the order in which they 
> will be presented, used?
>
> \define full() {{!!foo}} {{!!bar}}
> \define full2() $(foo)$ $(bar)$
> \define full3() $(alice)$ and $(bob)$.
>
> ```
> \define full() {{!!foo}} {{!!bar}}
> \define full2() $(foo)$ $(bar)$
> \define full3() $(alice)$ and $(bob)$.
> ```
>
> <$vars
> foo="This is foo"  
> bar="and this is bar."
> alice="this is Alice"
> bob="this is Bob"
> cat="this is cat"
> >
>
> # `<> <>` <> <>
> # `{{!!foo}} {{!!bar}}`  {{!!foo}} {{!!bar}}
> # `{{{ [] [] +[join[ ]] }}}` {{{ [] [] +[join[ ]] }}}
> # `<$text text={{{ [] [] +[join[ ]] }}}/>` <$text text={{{ 
> [] [] +[join[ ]] }}}/>
> # `<$text text={{{ [{!!foo}] [{!!bar}] +[join[ ]] }}}/>` <$text text={{{ 
> [{!!foo}] [{!!bar}] +[join[ ]] }}}/>
> #`<>` <>
> #`<>` <>
> #`<>` <> | {{{ [sentencecase[]] }}}
> #`{{{ [] [] +[join[ and ]addsuffix[.]sentencecase[]] }}}` {{{ 
> [] [] +[join[ and ]addsuffix[.]sentencecase[]] }}}
> #`{{{ [] [] +[join[ and ]addsuffix[.]sentencecase[]] }}}` {{{ 
> [] [] +[join[ and ]addsuffix[.]sentencecase[]] }}}
>
>
> 
>
>
>
> Regards
> Tones 
>
> On Monday, 16 August 2021 at 19:54:36 UTC+10 Misterel85 wrote:
>
>> Tones,
>>
>> Oh, now I better see what you mean by 'separating the data from its 
>> presentation'.
>> It kind of reminds me of my attempts at concatenating genealogical data 
>> in LaTeX with AppleScript years ago. What you advise is something I more or 
>> les

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-16 Thread Misterel85
Joshua,

Thanks for letting me know! Glad to have contributed to the bug chase 
through that seemingly inconspicuous question!
I don't know much about GitHub, therefore I let you file that bug.

Best,

Stéphane


Le lundi 16 août 2021 à 11:54:36 UTC+2, Misterel85 a écrit :

> Tones,
>
> Oh, now I better see what you mean by 'separating the data from its 
> presentation'.
> It kind of reminds me of my attempts at concatenating genealogical data in 
> LaTeX with AppleScript years ago. What you advise is something I more or 
> less tried to do at the time.
>
> I fully agree with what you wrote, but your precious advice stumble over a 
> huge impediment: my poor skills at programming in general, and Wikitext in 
> particular! I have absolutely no programming or STEM background, 
> unfortunately, and I am only a tinkerer.
>
> When I manage to copy-paste and adapt existing code snippets to meet my 
> needs, I am very happy.
> What a seasoned programmer would conceive and write in half an hour will 
> take hours --if not days-- for me to think about and assemble, and I am 
> overwhelmed with joy if it works, even if the resulting code would be 
> scoffed at by students, let alone their teachers, after a few months in a 
> 101 Programming class.
>
> Being both a perfectionist and a dabbler, one should never been given such 
> good advice as yours! They will  keep what you suggest in mind and want to 
> implement it without ever knowing how to get started! How terrible! ;-)
> My project is certainly not well-thought-out, and if it was, I would 
> probably need more code examples like the solution Eric Shulman kindly 
> provided me with. And TW v. 5.2.0 being in prerelease, I haven't looked 
> into it yet.
>
> I am aware that that TW project of mine is personal and is not designed to 
> be published. Unless I get struck with Alzheimer's disease soon --in which 
> case I won't need that project anymore--, for the moment I should be able 
> to remember its quirks when I use it. And there's room for improvement in 
> several other priority aspects of it. I am already spending way too much 
> time trying to achieve a project that probably wouldn't need all those 
> bells and whistles to work properly, to the detriment of other --as / 
> more-- meaningful projects. 
>
> Best,
>
> Stéphane
>
> Le lundi 16 août 2021 à 02:34:48 UTC+2, joshua@gmail.com a écrit :
>
>> We've found a bug!
>>
>> The wikitext parser object always tries to read Pragmas from the 
>> beginning to parse a text, and this _always_ trims whitespace from the text 
>> (moves the parser position past any leading whitespace).
>>
>> The $:/core/modules/parsers/wikiparser/wikiparser.js module needs to 
>> updated.
>>
>> The Parser's `this.skipWhiteSpace =` method needs to check the 
>> `this.configTrimWhiteSpace` value before moving the parser position, or 
>> reset the parser position if no pragmas are read, etc.
>>
>> This type of change should definitely have Jeremy's eye on it.
>>
>> I am terribly busy at work, so I will come back and file a Bug/Issue on 
>> GitHub if no-one else can.
>>
>> Best,
>> Joshua Fontany
>>
>> On Sunday, August 15, 2021 at 10:34:41 AM UTC-7 Misterel85 wrote:
>>
>>> Yay, it works!!! Thank you very much for your quick reply and your 
>>> simple and straightforward solution, Eric!
>>> After a bit of trial and error, I could adapt it to my TiddlyWiki.
>>> No need for an  anymore indeed.
>>> Thanks again to all of you for your help, solutions, explanations and 
>>> suggestions.
>>>
>>> Best,
>>> -Stéphane
>>>
>>> Le dimanche 15 août 2021 à 18:01:55 UTC+2, Eric Shulman a écrit :
>>>
>>>> On Sunday, August 15, 2021 at 7:10:39 AM UTC-7 Misterel85 wrote:
>>>>
>>>>> I first thought there would have been a more straightforward solution 
>>>>> to that issue, but actually I come to think that it should be possible to 
>>>>> inspect the first character in the contents of field 2:
>>>>> If value of field2 starts with space, then insert `` between the 
>>>>> transclusions, else just proceed with both transclusions.
>>>>>
>>>>
>>>> Try this:
>>>> <$transclude field="field1"/><$text text={{{ 
>>>> [{!!field2}split[]first[]match[ ]] }}}/><$transclude field="field2"/>
>>>>
>>>> Notes:
>>>> * The {{{ [...] }}} is a "filtered transclusion"
>>>> * The filter starts by getting the value of the desired field, using 
>

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-16 Thread Misterel85
Tones,

Oh, now I better see what you mean by 'separating the data from its 
presentation'.
It kind of reminds me of my attempts at concatenating genealogical data in 
LaTeX with AppleScript years ago. What you advise is something I more or 
less tried to do at the time.

I fully agree with what you wrote, but your precious advice stumble over a 
huge impediment: my poor skills at programming in general, and Wikitext in 
particular! I have absolutely no programming or STEM background, 
unfortunately, and I am only a tinkerer.

When I manage to copy-paste and adapt existing code snippets to meet my 
needs, I am very happy.
What a seasoned programmer would conceive and write in half an hour will 
take hours --if not days-- for me to think about and assemble, and I am 
overwhelmed with joy if it works, even if the resulting code would be 
scoffed at by students, let alone their teachers, after a few months in a 
101 Programming class.

Being both a perfectionist and a dabbler, one should never been given such 
good advice as yours! They will  keep what you suggest in mind and want to 
implement it without ever knowing how to get started! How terrible! ;-)
My project is certainly not well-thought-out, and if it was, I would 
probably need more code examples like the solution Eric Shulman kindly 
provided me with. And TW v. 5.2.0 being in prerelease, I haven't looked 
into it yet.

I am aware that that TW project of mine is personal and is not designed to 
be published. Unless I get struck with Alzheimer's disease soon --in which 
case I won't need that project anymore--, for the moment I should be able 
to remember its quirks when I use it. And there's room for improvement in 
several other priority aspects of it. I am already spending way too much 
time trying to achieve a project that probably wouldn't need all those 
bells and whistles to work properly, to the detriment of other --as / 
more-- meaningful projects. 

Best,

Stéphane

Le lundi 16 août 2021 à 02:34:48 UTC+2, joshua@gmail.com a écrit :

> We've found a bug!
>
> The wikitext parser object always tries to read Pragmas from the beginning 
> to parse a text, and this _always_ trims whitespace from the text (moves 
> the parser position past any leading whitespace).
>
> The $:/core/modules/parsers/wikiparser/wikiparser.js module needs to 
> updated.
>
> The Parser's `this.skipWhiteSpace =` method needs to check the 
> `this.configTrimWhiteSpace` value before moving the parser position, or 
> reset the parser position if no pragmas are read, etc.
>
> This type of change should definitely have Jeremy's eye on it.
>
> I am terribly busy at work, so I will come back and file a Bug/Issue on 
> GitHub if no-one else can.
>
> Best,
> Joshua Fontany
>
> On Sunday, August 15, 2021 at 10:34:41 AM UTC-7 Misterel85 wrote:
>
>> Yay, it works!!! Thank you very much for your quick reply and your simple 
>> and straightforward solution, Eric!
>> After a bit of trial and error, I could adapt it to my TiddlyWiki.
>> No need for an  anymore indeed.
>> Thanks again to all of you for your help, solutions, explanations and 
>> suggestions.
>>
>> Best,
>> -Stéphane
>>
>> Le dimanche 15 août 2021 à 18:01:55 UTC+2, Eric Shulman a écrit :
>>
>>> On Sunday, August 15, 2021 at 7:10:39 AM UTC-7 Misterel85 wrote:
>>>
>>>> I first thought there would have been a more straightforward solution 
>>>> to that issue, but actually I come to think that it should be possible to 
>>>> inspect the first character in the contents of field 2:
>>>> If value of field2 starts with space, then insert `` between the 
>>>> transclusions, else just proceed with both transclusions.
>>>>
>>>
>>> Try this:
>>> <$transclude field="field1"/><$text text={{{ 
>>> [{!!field2}split[]first[]match[ ]] }}}/><$transclude field="field2"/>
>>>
>>> Notes:
>>> * The {{{ [...] }}} is a "filtered transclusion"
>>> * The filter starts by getting the value of the desired field, using 
>>> {!!field2}
>>> * It then splits that value into separate characters, using split[]
>>> * Next, it gets just the first character, using first[]
>>> * and compares it with a space, using match[ ]
>>> * The result of the filter is either nothing, or an actual space 
>>> character (not an )
>>> * The <$text> widget then converts the output to plain text (instead of 
>>> displaying a link to a space!)
>>>
>>> enjoy,
>>> -e
>>>
>>

-- 
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/9a1d870a-575b-4c5f-a451-361c7f61dbf0n%40googlegroups.com.


[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Yay, it works!!! Thank you very much for your quick reply and your simple 
and straightforward solution, Eric!
After a bit of trial and error, I could adapt it to my TiddlyWiki.
No need for an  anymore indeed.
Thanks again to all of you for your help, solutions, explanations and 
suggestions.

Best,
-Stéphane

Le dimanche 15 août 2021 à 18:01:55 UTC+2, Eric Shulman a écrit :

> On Sunday, August 15, 2021 at 7:10:39 AM UTC-7 Misterel85 wrote:
>
>> I first thought there would have been a more straightforward solution to 
>> that issue, but actually I come to think that it should be possible to 
>> inspect the first character in the contents of field 2:
>> If value of field2 starts with space, then insert `` between the 
>> transclusions, else just proceed with both transclusions.
>>
>
> Try this:
> <$transclude field="field1"/><$text text={{{ 
> [{!!field2}split[]first[]match[ ]] }}}/><$transclude field="field2"/>
>
> Notes:
> * The {{{ [...] }}} is a "filtered transclusion"
> * The filter starts by getting the value of the desired field, using 
> {!!field2}
> * It then splits that value into separate characters, using split[]
> * Next, it gets just the first character, using first[]
> * and compares it with a space, using match[ ]
> * The result of the filter is either nothing, or an actual space character 
> (not an )
> * The <$text> widget then converts the output to plain text (instead of 
> displaying a link to a space!)
>
> enjoy,
> -e
>

-- 
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/3afe1cc5-8ccd-4b0d-90e3-397ac079f9ffn%40googlegroups.com.


[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Thanks for your complementary explanation about order, Tones, and you're 
quite right.
But as I wrote in a previous message, in that particular TW instance I am 
adamant that I won't change the field order.

Concatenating / Joining snippets of text from two fields in immutable 
order, while retaining Wikitext or HTML formatting or links is exactly what 
I want to do.

The basic example I gave earlier is thus:

if field1 contains: 'The cat is eating'
field2 might contain: ' a mouse.' or ' cat food.' (note the space),  or ', 
while the dog is playing.' or '.' (no space required before a full stop / 
period or a comma).

Actually I need that to reference sources for tiddler contents. It is a bit 
more complex because field1 is in the source tiddler, providing general 
info, whereas field2 is in the content tiddler, with references specific to 
that content.

As an example:
field1 in 'source' tiddler might contain: 'Doe, John. //My Great Book.// 
(2020)'
while field2 in 'excerpt' or 'content' tiddler might contain details such 
as: ', p. 22.' or ' — see chapter 8.' or '. John Doe develops that idea in 
the first 3 chapters.'
So the leading character in field2 might either be a period, a comma, a 
space, depending on how I wish to gracefully join the two parts 
punctuation-wise.
It is pretty similar to connecting words and parts of speech in a sentence.

What I have achieved so far works fine, except for the space trimming in 
the transclusion of field 2.

I first thought there would have been a more straightforward solution to 
that issue, but actually I come to think that it should be possible to 
inspect the first character in the contents of field 2:

If value of field2 starts with space, then insert `` between the 
transclusions, else just proceed with both transclusions.
But I don't think I have enough TW knowledge to do that, unfortunately.

Best,

Stéphane

Le dimanche 15 août 2021 à 15:22:31 UTC+2, TW Tones a écrit :

> I think you can have your cake and eat it, as long as you use the 
> tiddlywiki recipe/ingredients.
>
> First lets see if I can explain about order.
>
> If this was my first design (with space between them)
> <$transclude field="field1" /> <$transclude field="field2" />
>
> And I decided I wanted;
> <$transclude field="field2" /> <$transclude field="field1" />
>
>
>- I modify the presentation in the above code, I do not need to modify 
>my data, just its presentation. This may be happening inside a list widget 
>for example.
>- In your case you may need to change both the presentation and the 
>data.
>
>
> Now, If I understand correctly you want to correctly treat the joining of 
> "snipits" found in fields correctly, you would be better served building 
> some standards for your data and tools to do the joining. Since there are 
> already implied standards for handling those values lets adopt them, then 
> if you can identify occasions where appending one snippet to the other by 
> separation with a space, is not working, let us detect and alter that case.
>
> In the original post I think you go down the path of altering the way they 
> are presented by modifying the data.
>
> *Could you give us some examples where you are finding it hard to join 
> such snippets?*
>
> I would suggest {{!!foo}}{{!!bar}} for your first example (As did 
> Mario)
>
> Tones
>
> On Sunday, 15 August 2021 at 22:54:39 UTC+10 Misterel85 wrote:
>
>> Thank you for your replies, PMario, Joshua and Tones.
>>
>> @ Joshua: Thanks a lot for taking the time to write this comprehensive 
>> and clear explanation.
>>
>> I have followed your solution to insert `\whitespace notrim` at the 
>> beginning of a tiddler text, but unfortunately, it doesn't work.
>>
>> I also tried to place it into a macro like this:
>>
>> ```
>> \define mymacro()
>> \whitespace notrim
>> <$transclude field="field1" /><$transclude field="field2" />
>> \end
>> ```
>>
>> but in vain. In the documentation <https://tiddlywiki.com/#Pragma>, the 
>> default is set to 'notrim', so adding such an instruction in a macro is 
>> useless.
>>
>>
>> @ PMario:
>>
>> I am aware of the solution you provide, but inserting a normal or 
>> non-breakable space between the two transclusions is not an option.
>>
>> A very simplified example of what I would like to do is connecting two 
>> parts of something similar to a sentence together, but that sentence may 
>> not need a complement in the second part.
>> For instance:
>> if field1 contains: 'The cat is eating'
>> field2 might contain: ' a mouse.' or ' cat food.' (

[tw5] Re: How can I prevent TW from trimming leading space in field transclusion?

2021-08-15 Thread Misterel85
Thank you for your replies, PMario, Joshua and Tones.

@ Joshua: Thanks a lot for taking the time to write this comprehensive and 
clear explanation.

I have followed your solution to insert `\whitespace notrim` at the 
beginning of a tiddler text, but unfortunately, it doesn't work.

I also tried to place it into a macro like this:

```
\define mymacro()
\whitespace notrim
<$transclude field="field1" /><$transclude field="field2" />
\end
```

but in vain. In the documentation , the 
default is set to 'notrim', so adding such an instruction in a macro is 
useless.


@ PMario:

I am aware of the solution you provide, but inserting a normal or 
non-breakable space between the two transclusions is not an option.

A very simplified example of what I would like to do is connecting two 
parts of something similar to a sentence together, but that sentence may 
not need a complement in the second part.
For instance:
if field1 contains: 'The cat is eating'
field2 might contain: ' a mouse.' or ' cat food.' (note the space), or '.' 
(no space required before a full stop / period).

Your solution would always insert a space, even before a punctuation sign 
such as a period or a comma...



@ Tones

Your advice is worth following 'for standard use cases'. But what I wish to 
implement is probably not an ordinary one.

You wrote:
- The spacing you wish is something best done in the display of the data 
and not in the data, what if they changed order? 

I don't understand what you mean by 'what if they changed order?'.
What would change order? The data? The fields? No, I wouldn't need to 
change their order. See my example above. Why would I need the 
'complementary' part of the data to show before the 'main' part?

As for the spacing, it is an integral part of the data here (as a word 
separator within a sencence, for instance). Therefore putting it anywhere 
else in this case wouldn't be a wise choice.

- A field containing a list of titles or tiddlers is typically space 
delimited. So we often need the leading and trailing spaces not to be 
included.

Sure, but that's not my use case. And 'often' is not 'always'! ;-)

- You can access fields in a different way if you really need to have 
leading or training spaces as part of the data

Well, that's exactly what I'm after!


> '{{{ [all[current]get[afield]] }}}'

> The transcluded filter output demonstrates the field contains a leading 
space of it has one.

That filter output is interesting. But it doesn't render HTML tags or 
Wikitext, contrary to $transclude.
If 'afield' contains: ` This is my //field//. `, 
then 
'{{{ [all[current]get[afield]] }}}'
'<$text text={{{ [all[current]get[afield]] }}} />'
'<$view field=afield />'
all render raw text as: 
' This is my //field//. '
whereas
'<$transclude field=afield/>'
renders as:
'This is *my* *field*.'

Seems that I have to trade in the leading space for formatting and 
vice-versa. Can't have my cake and eat it.

Regards,

Stéphane


-- 
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/19c1fa23-fb11-48c6-8ee6-513a5657597cn%40googlegroups.com.


[tw5] How can I prevent TW from trimming leading space in field transclusion?

2021-08-14 Thread Misterel85
How can I prevent TW from trimming leading space in field transclusion?

When transcludings two fields one after the other, for instance:

`<$transclude field="foo" /><$transclude field="bar" />`

if the value of field "bar" starts with a space, that space is 
automatically removed in the transclusion.

In this example the successive transclusions of:

"foo"=> "This is foo"
"bar"=> " and this is bar."

render as:

"This is fooand this is bar."

Inserting a trailing space in "foo" or a `` between the two 
transclusions is not an option for me.
Placing a `` at the beginning of the value in the second transcluded 
field works, but that's a bit of a hassle with multiple transclusions.

Why does TW behave so and what is needed to achieve the result I am looking 
for (a kind of 'untrim' operator)? 

Sorry if that question seems trivial or was already asked before.

-Stéphane L.

-- 
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/22f3a526-db90-40e8-8378-da60676512b7n%40googlegroups.com.


[tw5] Re: Code Patterns: A Tag Selector Gadget

2021-07-28 Thread Misterel85
Hi Charlie,

Thank you very much for sharing this great idea!

I managed to adapt your tag selector when I noticed that checkboxes could 
have checkactions / uncheckedactions parameters.
So now I can kill two birds with one stone thanks to your tag selector: 
with one checkbox (un)tick, I can add (/ remove) both a tag and a field 
whose name is based on the tag . That is much more effective and useful 
than the built-in tag-picker.

So, hats off, Sir! You've made my day.

I will now modify the tag filter so as to only show the tags I'm interested 
in. It shouldn't be too difficult to do that.

If it might be of help to anyone, here is the code I modified in your Tag 
Selector tiddler:

```
<$checkbox tiddler=<> tag=<> 
checkactions="""<$action-setfield $tiddler=<> $value={{{ 
[addprefix[{{]addsuffix[!!presentation}}]] }}} $field={{{ 
[addprefix[ref_]] }}} />  """ 
uncheckactions="""<$action-deletefield $tiddler=<> $field={{{ 
[addprefix[ref_]] }}} /> """ > <>  

```
Notes:

   - When a box is ticked, it creates a field whose name starts with ref_ 
   and ends with the name of the tag.
   - That field transcludes data from the 'presentation' field in the tag 
   itself.
   - When the box is unchecked, the field is deleted.


Stéphane L.

Le vendredi 16 juillet 2021 à 16:25:28 UTC+2, cj.v...@gmail.com a écrit :

> G'day Mike,
>
> That little bit of magic really is the result of some fine teaching by 
> Mohammad and Tones.
>
> With advanced search in TiddlyWiki, use a filter that lists all related 
> tiddlers (ie that work together to provide some 
> feature/functionality/information/etc.).
>
> Then use the export button on the advanced search tiddler to export all 
> tiddlers found by the filter to a handy-dandy JSON file that has all the 
> tiddlers packaged up neatly.  That one file can then be dragged for import 
> into some other TiddlyWiki, and all tiddlers in that JSON file get 
> "extracted".
>
> In my mind: Very cool for simple things that don't really need all of the 
> oomph/heft of a plugin.
>
> Screenshot below.  *(The export button is the one between the X and the 
> garbage can.)*
>
> Cheers !
>
> [image: Screenshot 2021-07-16 11.20.23 AM - Display 1.png]
>
> On Friday, July 16, 2021 at 10:58:05 AM UTC-3 miket...@gmail.com wrote:
>
>> cj.v...
>> How did you export the required tiddlers in one file?
>>
>> четверг, 15 июля 2021 г. в 11:31:13 UTC+3, TW Tones: 
>>
>>> Charlie,
>>>
>>> I like your large tag selector, and see similar smaller ones filtered or 
>>> from a separate list would be more than enough. Yes this customisation is 
>>> person and wiki specific.
>>>
>>> Sorry about that little comment. But as much as I don't want to cause 
>>> trouble, I wanted you to know I relay appreciate your work when its more 
>>> accessible, In line rather than attached is just as good. I actually find 
>>> the image attachment more work myself. But whatever you want. :)
>>>
>>> Tones
>>>
>>> On Thursday, 15 July 2021 at 12:10:06 UTC+10 cj.v...@gmail.com wrote:
>>>
 Well, choice of filtering mechanism to reduce the number tags, that's 
 kind of hard to setup in a way that suits everybody.

 Probably best to let each individual customize this basic code with the 
 kind of filters (cosmetics, etc.) that work for her/him.

 I did the parts that were fun to do on my free time.  The rest is for 
 somebody else, although I'll build anything for anybody for the right 
 price...

 Aside:  Sharing code as attachments versus images (usually with a link 
 to working code in hosted TiddlyWiki) is hit and miss with me.  I wish you 
 had not brought attention to it.  It is a bit of a reminder about a 
 standard that I don't always have the energy to achieve.  A simple "Thanks 
 for sharing" (minus the other bit) would have been pretty sweet.



 On Wednesday, July 14, 2021 at 10:02:05 PM UTC-3 TW Tones wrote:

> Charlie,
>
> I like the idea here. To me however the strength would be in providing 
> a filter to the tag selection. Perhaps have a set. for example if tagged 
> todo provide a drop down of status tags.
>
> This would simplify wiki with a lot of tags as discussed here 
> 
>
> I tested you JSON on tiddlywiki.com and the multi-colum effect was 
> not there
>
> Thanks for sharing (code rather than images).
> Tones
>
> On Thursday, 15 July 2021 at 08:57:53 UTC+10 cj.v...@gmail.com wrote:
>
>> Yeah, I never make pretty until general concept is iron-clad, and 
>> only if it is worth it (i.e. if nobody likes the general approach, why 
>> would I waste my time with prettiness?  I'm quirky that way ...)
>>
>> On Wednesday, July 14, 2021 at 7:51:03 PM UTC-3 miket...@gmail.com 
>> wrote:
>>
>>> Very good! We need to test it. But for the button it is better to 
>>> use the standard code 

[tw5] Re: Two problems with macro: displaying and refreshing

2021-07-22 Thread Misterel85
Ciao Tones,
An interesting guess you've tried to make here. Well, you could have added 
the similarity of the name I chose here with the 'massif de l'Esterel', a 
mountain range between Cannes and Saint-Tropez!

Well, that alias is closer to English than French, actually. It dates back 
to my year as a French assistant in Scotland. Some pupils at the boarding 
house didn't bother call the tutors by their full name, so they used the 
initial of the family name: 'Mr. T.', 'Mr. S.' or, in my case, 'Mr. L.'...

I'm sorry to disappoint you but I'm from the West of France. I live near 
Nantes, and my parents' house was very close to 'Le Puy du Fou' a renowned 
sound-and-light show about the history of the area. The French dialect I 
would use is probably closer to Charlie Veniot's Acadian French than to 
Occitan, I'm afraid. I enjoyed reading some words and phrases in his 'Le 
P'tit Aurèle', and could understand most of them at first glance, since 
were also used by my the elders in my family.

I do miss travelling as well, although I don't know France that much. I'm 
more used to visiting English-speaking countries.

Stéphane L.

Le mercredi 21 juillet 2021 à 03:39:58 UTC+2, TW Tones a écrit :

> Thanks for sharing your result back here Misterel, it is great community 
> participation.
>
> Yup, TiddlyWiki is so awesome.
>
> With the name Misterel, makes me think of thew Mistrals and "Pas de" in 
> your code I imagine you may be in the south of France? We have friends in a 
> place called Castries not far from Montpelier, it was there I saw the 
> result of the Mistrals (winds) in their back yard with every tree leaning 
> away from the wind. Strangely whilst their house was a modern Spanish 
> style, their pool and barbeque area was quite similar to nice homes here in 
> Australia.
>
> We miss France terribly, and can't wait to visit again. My partner 
> Isabelle's mother remains in Paris and we have family all over 
> France/Portugal.
>
> Tones/Tony
>
> On Wednesday, 21 July 2021 at 04:56:03 UTC+10 Misterel85 wrote:
>
>> Hi everyone,
>>
>> With Springer's help and and bit of googling around, I finally found a 
>> (basic) working solution. Yay!
>> It is much simpler to use a ViewTemplate instead of a macro and it should 
>> satisfy most of my needs.
>>
>> Should it be useful to anybody, here is the code I used in the 
>> ViewTemplate to replace the macro:
>>
>> ```
>> <$list 
>> filter="[all[current]field:tiddler-type[exercice]field:displaysource[yes]]">
>> <$set name="fieldCount" 
>> filter="[all[current]fields[]prefix[ref_]count[]]">
>> <$text text={{{ [match[0]then[Pas de ]else] }}} />
>> <$text text={{{ [!match[1]then[sources :]else[source :]]  }}} 
>> />
>> 
>> <$list filter="[all[current]fields[]prefix[ref_]sort[title]]" 
>> variable="fieldName">
>> @@color:grey; 
>> 
>> <$transclude field=<>/>
>> @@
>> 
>> 
>> 
>> ```
>> I can't believe how great and versatile TiddlyWiki is!!
>>
>> Regards
>>
>>
>> Le mardi 20 juillet 2021 à 18:35:59 UTC+2, Misterel85 a écrit :
>>
>>> Springer,
>>> Thanks a lot for taking the time to reply and for your help.
>>>
>>> You're exactly right: I'd like my macro to count (and then display one 
>>> summary line for) each of the fields that start with ref_ in every tiddler 
>>> in the story river.
>>>
>>> I have tried your solution to add `all[current]` in my macro but 
>>> unfortunately it doesn't work.
>>> Actually because the macro is in its own tiddler, I think `all[current]` 
>>> tries to find the ref_ fields in the macro's tiddler. But I may be wrong.
>>>
>>> Grok TiddlyWiki is a great tool to learn, but I haven't finished reading 
>>> it, and it needs time to figure out all the intricacies of (TW) programming 
>>> when your coding knowledge amounts to next to nothing.
>>>
>>> Regards
>>>
>>>
>>> Le mardi 20 juillet 2021 à 17:32:35 UTC+2, springer a écrit :
>>>
>>>> Misterel,
>>>>
>>>> I am *not* the expert; others could probably write the code you need in 
>>>> 60 seconds. But since nobody else has answered, and understanding your 
>>>> task 
>>>> and its problems demands some time and attention, I'll offer one nudge to 
>>>> start...
>>>>
>>>> It seems you want your macro to count (and then display one summary 
>>>> line for) each of the CURRENT tiddler's fields that start with ref_ -- Is 
>

[tw5] Re: Two problems with macro: displaying and refreshing

2021-07-20 Thread Misterel85
Hi everyone,

With Springer's help and and bit of googling around, I finally found a 
(basic) working solution. Yay!
It is much simpler to use a ViewTemplate instead of a macro and it should 
satisfy most of my needs.

Should it be useful to anybody, here is the code I used in the ViewTemplate 
to replace the macro:

```
<$list 
filter="[all[current]field:tiddler-type[exercice]field:displaysource[yes]]">
<$set name="fieldCount" filter="[all[current]fields[]prefix[ref_]count[]]">
<$text text={{{ [match[0]then[Pas de ]else] }}} />
<$text text={{{ [!match[1]then[sources :]else[source :]]  }}} />

<$list filter="[all[current]fields[]prefix[ref_]sort[title]]" 
variable="fieldName">
@@color:grey; 

<$transclude field=<>/>
@@



```
I can't believe how great and versatile TiddlyWiki is!!

Regards


Le mardi 20 juillet 2021 à 18:35:59 UTC+2, Misterel85 a écrit :

> Springer,
> Thanks a lot for taking the time to reply and for your help.
>
> You're exactly right: I'd like my macro to count (and then display one 
> summary line for) each of the fields that start with ref_ in every tiddler 
> in the story river.
>
> I have tried your solution to add `all[current]` in my macro but 
> unfortunately it doesn't work.
> Actually because the macro is in its own tiddler, I think `all[current]` 
> tries to find the ref_ fields in the macro's tiddler. But I may be wrong.
>
> Grok TiddlyWiki is a great tool to learn, but I haven't finished reading 
> it, and it needs time to figure out all the intricacies of (TW) programming 
> when your coding knowledge amounts to next to nothing.
>
> Regards
>
>
> Le mardi 20 juillet 2021 à 17:32:35 UTC+2, springer a écrit :
>
>> Misterel,
>>
>> I am *not* the expert; others could probably write the code you need in 
>> 60 seconds. But since nobody else has answered, and understanding your task 
>> and its problems demands some time and attention, I'll offer one nudge to 
>> start...
>>
>> It seems you want your macro to count (and then display one summary line 
>> for) each of the CURRENT tiddler's fields that start with ref_ -- Is that 
>> correct?
>>
>> Instead, your macro is counting (and then displaying one summary line 
>> for) every field in your whole wiki that begins with ref_
>>
>> Try pasting your code (with the variable filled in) and this alternate 
>> code, into your Exercice1 tiddler. Your code yields 5, because the whole 
>> project had five ref_ fields; but beginning your filter with 
>> [all[current] gets you the number you want.
>>
>> First segment of your existing macro's code (specifying the prefix):
>> <$set name="fieldCount" filter="[fields[]prefix[ref_]count[]]">
>> <$text text={{{ [match[0]then[Pas de ]else] }}} />
>> <$text text={{{ [!match[1]then[sources :]else[source :]] }}} 
>> />
>> 
>>
>> Better:
>> <$set name="fieldCount" 
>> filter="[all[current]fields[]prefix[ref_]count[]]">
>> <$text text={{{ [match[0]then[Pas de ]else] }}} />
>> <$text text={{{ [!match[1]then[sources :]else[source :]]  }}} 
>> />
>> 
>>
>> All I'm doing here is the technique in https://groktiddlywiki.com/read/
>>
>> That is: breaking down a complex problem into smaller bits, and getting 
>> your macro to count right *before* trying to set it up in the ViewTemplate 
>> with an additional variable for the prefix and an additional condition for 
>> displaysource[yes].  
>>
>> Alas, I need to switch to other tasks, but I hope you're on the road to 
>> getting the behavior you need.
>>
>> -Springer
>>
>> On Monday, July 19, 2021 at 11:08:53 AM UTC-4 Misterel85 wrote:
>>
>>> Hi,
>>> I'm back to work on a TiddlyWiki to manage my collection of drama 
>>> exercises, but I came across 2 problems with displaying their sources and 
>>> refreshing that display.
>>>
>>> Problem #1:
>>>
>>> My 'exercises' tiddlers all refer to a 'SourceDisplay' macro to show the 
>>> sources.
>>> If I use a field to trigger the macro to show or hide the sources, they 
>>> appear in 'Exercise1' tiddler, but not in 'Exercise2'. If I paste 
>>> <> in the text field of each of the 
>>> Exercise tiddlers, it works fine.
>>> I suppose something like 'qualify' might solve the trick, but I don't 
>>> know how to use it. Perhaps any of you has a better solution to suggest 
>>> anyway, but I can make do with copying-pasting the macro call.
>>>
>>> Probl

[tw5] Re: Two problems with macro: displaying and refreshing

2021-07-20 Thread Misterel85
Springer,
Thanks a lot for taking the time to reply and for your help.

You're exactly right: I'd like my macro to count (and then display one 
summary line for) each of the fields that start with ref_ in every tiddler 
in the story river.

I have tried your solution to add `all[current]` in my macro but 
unfortunately it doesn't work.
Actually because the macro is in its own tiddler, I think `all[current]` 
tries to find the ref_ fields in the macro's tiddler. But I may be wrong.

Grok TiddlyWiki is a great tool to learn, but I haven't finished reading 
it, and it needs time to figure out all the intricacies of (TW) programming 
when your coding knowledge amounts to next to nothing.

Regards


Le mardi 20 juillet 2021 à 17:32:35 UTC+2, springer a écrit :

> Misterel,
>
> I am *not* the expert; others could probably write the code you need in 60 
> seconds. But since nobody else has answered, and understanding your task 
> and its problems demands some time and attention, I'll offer one nudge to 
> start...
>
> It seems you want your macro to count (and then display one summary line 
> for) each of the CURRENT tiddler's fields that start with ref_ -- Is that 
> correct?
>
> Instead, your macro is counting (and then displaying one summary line for) 
> every field in your whole wiki that begins with ref_
>
> Try pasting your code (with the variable filled in) and this alternate 
> code, into your Exercice1 tiddler. Your code yields 5, because the whole 
> project had five ref_ fields; but beginning your filter with [all[current] 
> gets you the number you want.
>
> First segment of your existing macro's code (specifying the prefix):
> <$set name="fieldCount" filter="[fields[]prefix[ref_]count[]]">
> <$text text={{{ [match[0]then[Pas de ]else] }}} />
> <$text text={{{ [!match[1]then[sources :]else[source :]] }}} />
> 
>
> Better:
> <$set name="fieldCount" filter="[all[current]fields[]prefix[ref_]count[]]">
> <$text text={{{ [match[0]then[Pas de ]else] }}} />
> <$text text={{{ [!match[1]then[sources :]else[source :]]  }}} 
> />
> 
>
> All I'm doing here is the technique in https://groktiddlywiki.com/read/
>
> That is: breaking down a complex problem into smaller bits, and getting 
> your macro to count right *before* trying to set it up in the ViewTemplate 
> with an additional variable for the prefix and an additional condition for 
> displaysource[yes].  
>
> Alas, I need to switch to other tasks, but I hope you're on the road to 
> getting the behavior you need.
>
> -Springer
>
> On Monday, July 19, 2021 at 11:08:53 AM UTC-4 Misterel85 wrote:
>
>> Hi,
>> I'm back to work on a TiddlyWiki to manage my collection of drama 
>> exercises, but I came across 2 problems with displaying their sources and 
>> refreshing that display.
>>
>> Problem #1:
>>
>> My 'exercises' tiddlers all refer to a 'SourceDisplay' macro to show the 
>> sources.
>> If I use a field to trigger the macro to show or hide the sources, they 
>> appear in 'Exercise1' tiddler, but not in 'Exercise2'. If I paste 
>> <> in the text field of each of the Exercise 
>> tiddlers, it works fine.
>> I suppose something like 'qualify' might solve the trick, but I don't 
>> know how to use it. Perhaps any of you has a better solution to suggest 
>> anyway, but I can make do with copying-pasting the macro call.
>>
>> Problem #2 (more serious to me):
>> I changed the contents and title of tiddler "source1" to a more realistic 
>> name ('Dramaction' here) and contents and updated the the fields 
>> accordingly.
>>
>> I made 4 dummy source tiddlers. When I deleted the 'ref_source1' field in 
>> 'Exercise1' and replaced it with a 'ref_dramaction' field, I also noticed 
>> that there were now 4 sources in the list instead of 3. One line is blank, 
>> which I suppose is the ghost of 'source1', without any data, of course, 
>> since that content doesn't exist any more. It's as if old 'source1' data 
>> wasn't purged, or TW still expected that content to exist alongside the new 
>> 'dramaction' content. It also happens every time I delete one of those 
>> fields.
>>
>> Also, when I delete the 'ref_source1' field in 'Exercise2', the list of 
>> sources gets updated in 'Exercise1', but not in Exercise2, which showed the 
>> same problem as in the previous paragraph.
>>
>> Thanks in advance for your help.
>>
>>
>> Here is the link to a MWE you can download, to see what I mean:
>>
>>
>> https://u.pcloud.link/publink/show?code=XZmdnCXZmtUJk3s4tCfxvYwlXQmYnXrL8RJV
>>
>> And below is

[tw5] Two problems with macro: displaying and refreshing

2021-07-19 Thread Misterel85
Hi,
I'm back to work on a TiddlyWiki to manage my collection of drama 
exercises, but I came across 2 problems with displaying their sources and 
refreshing that display.

Problem #1:

My 'exercises' tiddlers all refer to a 'SourceDisplay' macro to show the 
sources.
If I use a field to trigger the macro to show or hide the sources, they 
appear in 'Exercise1' tiddler, but not in 'Exercise2'. If I paste 
<> in the text field of each of the Exercise 
tiddlers, it works fine.
I suppose something like 'qualify' might solve the trick, but I don't know 
how to use it. Perhaps any of you has a better solution to suggest anyway, 
but I can make do with copying-pasting the macro call.

Problem #2 (more serious to me):
I changed the contents and title of tiddler "source1" to a more realistic 
name ('Dramaction' here) and contents and updated the the fields 
accordingly.

I made 4 dummy source tiddlers. When I deleted the 'ref_source1' field in 
'Exercise1' and replaced it with a 'ref_dramaction' field, I also noticed 
that there were now 4 sources in the list instead of 3. One line is blank, 
which I suppose is the ghost of 'source1', without any data, of course, 
since that content doesn't exist any more. It's as if old 'source1' data 
wasn't purged, or TW still expected that content to exist alongside the new 
'dramaction' content. It also happens every time I delete one of those 
fields.

Also, when I delete the 'ref_source1' field in 'Exercise2', the list of 
sources gets updated in 'Exercise1', but not in Exercise2, which showed the 
same problem as in the previous paragraph.

Thanks in advance for your help.


Here is the link to a MWE you can download, to see what I mean:

https://u.pcloud.link/publink/show?code=XZmdnCXZmtUJk3s4tCfxvYwlXQmYnXrL8RJV

And below is the macro I am talking about:

```
\define SourceDisplay(prefix:"")
<$set name="fieldCount" filter="[fields[]prefix[$prefix$]count[]]">
<$text text={{{ [match[0]then[Pas de ]else] }}} />
<$text text={{{ [!match[1]then[sources :]else[source :]]  }}} />



<$list filter="[fields[]prefix[$prefix$]sort[title]]" variable="fieldName">

<$transclude field=<>/>




\end
```

-- 
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/3d234f73-878e-487b-8011-20c4cae84f56n%40googlegroups.com.


Re: [tw5] Can tag adding trigger field creation?

2021-03-21 Thread Misterel85
Javier,

Sorry for not replying earlier. I have been very busy this month.

Thanks a lot for your solution! That's great!
I tested your tiddler to see how it would work and I can tell tell you I'm 
very happy with the result.
I haven't been through all the steps you suggest, but I'm sure they work 
perfectly. I need to finish the TOC beforehand, as long as I have access to 
the built-in tag picker. (Yes, I know I can get it back easily, but once 
the structure is done, I don't want to modify it unless it is really 
needed.)

For the moment however, I have put that project on hold as it wasn't a 
priority.

Anyway, thanks again for your ready-made solution.

Cheers,

Stéphane


Le mardi 2 mars 2021 à 20:07:55 UTC+1, Javier Rojas a écrit :

> On Sun, Jan 24, 2021 at 05:48:10AM -0800, Misterel85 wrote:
> > So, here's what I would like:
> > 
> > 1. I create an activity tiddler.
> > 2. I create the corresponding generic source tag tiddler(s) if they 
> > don't already exist. Ex. a tiddler tag whose text field holds info about 
> a 
> > (hypothetical) 'dramatis.com' website would be called 'dramatis' and 
> tagged 
> > 'Source'.
> > 3. For every time I add a source tag to the activity tiddler, TW checks 
> > whether a corresponding source detail field exists in that current 
> activity 
> > tiddler.
> > 4. If not, it retrieves the name of the tag and creates a new field 
> > named after that tag. In the example above, a corresponding field named 
> > 'dramatis_detail' or simply 'dramatis' would be added in the current 
> > activity tiddler.
> > 5. If I delete a source tag (ex. the 'dramatis' tag), the corresponding 
> > 'dramatis' field would also be deleted. (That step may not be necessary 
> if 
> > step 3 is implemented.)
>
> The following tiddler + setup should:
>
> * add a "Sources" field which will show up whenever you edit a
> tiddler, where you will be able to search/select tags, just like the
> regular tag interface; it should show up at the bottom of a tiddler
> when editing it.
>
> * When selecting a tag *there*, it will be added to the current
> tiddler, AND, a new field called " detail" will be added, if
> the tag itself is tagged with the "source" tag.
>
> NOTE: it will only work with tiddlywiki 5.1.23 (latest release as of
> today), since it depends on some new features of the "tag-picker"
> macro.
>
> To add it to your tiddlywiki, create a new tiddler, as follows:
>
> title: doesn't matter, name it as you wish
> tags: $:/tags/EditTemplate
> content: (omit the % START % / % END % markers below)
>  START 
> %%%
> \define acts()
> <$list filter="[tag[source]]">
> <$action-setfield $tiddler="$(currentTiddler)$" $value="FILLME" $field={{{ 
> [addsuffix[ details]] }}} />
> 
> \end
>
> Sources: <$macrocall $name="tag-picker" actions=<> />
>  END 
> %
>
> If the above provides what you need, you should then consider using that
> code to replace the original tags widget in the edit tiddler interface. To 
> do
> that, I would:
>
> * save and backup my wiki ;)
>
> * copy-paste the original tiddler (its title is
> $:/core/ui/EditTemplate/tags ), into this new tiddler you created.
>
> * integrate the "acts" macro, and the changes to the "tag-picker"
> macrocall that I suggested above, to the copy-pasted tiddler content.
>
> * put the tiddler in the proper place in the edit interface: Click on
> the tag-pill for the $:/tags/EditTemplate of the new tiddler, and
> drag-and-drop the new tiddler's title to the desired position
>
> * Edit the $:/core/ui/EditTemplate/tags tiddler, to remove the
> $:/tags/EditTemplate tag from it, so it doesn't show up in the edit
> interface anymore.
>
> * Enjoy the new setup!
>
> Cheers,
>
> -- 
> Javier
>

-- 
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/c8401bac-a186-4c78-bc89-b3f6fdeecedcn%40googlegroups.com.


Re: [tw5] Re: Can tag adding trigger field creation?

2021-02-01 Thread Misterel85
Thanks for your input, Tones and Pit.W.

Sorry for this (very) long post again.

Here is an outline of how I see things in a tiddler. The aim is to avoid 
copying and pasting redundant information from one activity to the other 
with a little bit of automation. Any solution or idea to achieve that would 
be welcome.

---
Tiddler title: "This is one activity"
Contents: "A description of that activity. Blah blah…"

Tag1 name: thisdramabook
Tag2 name: dramatis
TagN, etc.
=> Each of these tags contain general reference about the source, for 
instance in Tag1: "This Drama Book - an extraordinary drama book". That 
info is then shown into the activity tiddler via transclusion.
I tagged these tags with 'source' because I use a few other tags to build a 
table of contents.

Field1 name: thisdramabook
Field1 contents: 'page 15.'
Field2 name: dramatis
Field2 contents: "exercise 3, posted by John Doe on Wednesday 12th."
FieldN, etc.
=> Each field would contain specific details about where I found the 
activity itself in the source referenced by the tag. The field is created 
when I add its tag namesake and I can manually add contents to it, that 
would differ from an activity to the other.
---

So, if I need to print the activity, the text would be something like:

---
"This is one activity.

A description of that activity. Blah blah…

Source(s):
– This Drama Book - an extraordinary drama book - p. 15.
– Dramatis - an extraordinary drama website - exercise 3, posted by John 
Doe on Wednesday 12th."
– …
---


@Tones,
My answer to your question:
'do you want this field added every time any tag is added?'
would be 'yes', because I can't find any other (better) solution to what I 
am trying to achieve. I'd rather keep the specific source details away from 
the activity description.

@Pit.W.
You're quite right about not needing both a tag and a field to hold the 
same contents.
That's not what I want to do, but you'll notice that both are linked: a 
source detail field would be created in a tiddler only if there is a 
corresponding source tag.


TiddlyWiki makes me feel both amazed at what it can do, keen about what I 
could do with it, and frustrated with what I can't achieve! :-s

Stéphane

Le jeudi 28 janvier 2021 à 12:45:15 UTC+1, Pit.W. a écrit :

> Stéphane,
>
>
> I had the same issue and I solved it by creating a special button, which 
> adds both a tag and one or more fields.
>
> When using it for some time it occurred to me that - if I need both a tag 
> and a field with always the same contents, something is flawed with my data 
> model or my processes, since I am creating redundant information stored in 
> different places.
>
> And it took only a short time until these redundancies made me very 
> unhappy
>
> Also see Tones last sentence: "what if the field already exists" - also a 
> way to become unhappy ;/
>
>
> Pit.W
> Am 28.01.2021 um 12:02 schrieb TW Tones:
>
> Stéphane,
>   
> *Can tag adding, trigger field creation?*
>
> To answer this question directly if you provide the method to add a tag, 
> like construct your own button, you can always add an additional action to 
> create a field. 
>
> I am sure we can find a way to hack the existing add tag system to also 
> add a field but do you want this field added every time any tag is added?
>
> When you are ready explain what you are trying to achieve with this tag 
> and field and when or if, its always needed, what if the field already 
> exists etc...
>
> Regards
> Tones
>
> On Thursday, 28 January 2021 at 00:50:03 UTC+11 Misterel85 wrote:
>
>> Hi Tones,
>> Thanks for your reply.
>> Sorry if I didn't clearly express 'what I would like', and sorry if 
>> providing steps on how I was seeing the mechanism I had in mind didn't 
>> help. I'll try to improve what I have already done and rephrase it 
>> accordingly.
>> Anyway, the macro you provided is very interesting and could be really 
>> useful. It should be added to TiddlyWiki's documentation which doesn't 
>> provide any examples about the tag-picker.
>> Also thanks for your 'standard nomenclature' you recently posted about. 
>> This is a great piece of work!
>> Cheers,
>> Stéphane
>>
>>
>>
>> Le mardi 26 janvier 2021 à 01:37:43 UTC+1, TW Tones a écrit :
>>
>>> Stéphane L.  
>>>
>>> You are aware that in your section  *So, here's what I would like:*  
>>> you are in many ways forcing the solution rather than truly stating "what 
>>> you would like". Perhaps avoid tiddlywiki jargon and ask again, then 
>>> responders can suggest solutions beyond the limitations you are implying.
>>>
>>> As far as I can see, In data

[tw5] Re: Can tag adding trigger field creation?

2021-01-27 Thread Misterel85
Hi Tones,
Thanks for your reply.
Sorry if I didn't clearly express 'what I would like', and sorry if 
providing steps on how I was seeing the mechanism I had in mind didn't 
help. I'll try to improve what I have already done and rephrase it 
accordingly.
Anyway, the macro you provided is very interesting and could be really 
useful. It should be added to TiddlyWiki's documentation which doesn't 
provide any examples about the tag-picker.
Also thanks for your 'standard nomenclature' you recently posted about. 
This is a great piece of work!
Cheers,
Stéphane



Le mardi 26 janvier 2021 à 01:37:43 UTC+1, TW Tones a écrit :

> Stéphane L. 
>
> You are aware that in your section  *So, here's what I would like:*  you 
> are in many ways forcing the solution rather than truly stating "what you 
> would like". Perhaps avoid tiddlywiki jargon and ask again, then responders 
> can suggest solutions beyond the limitations you are implying.
>
> As far as I can see, In database speak you want multiple values in your 
> source field, there are many ways to achieve this in tiddlywiki.
>
> I recently discovered we can use the tag-picker macro against another 
> field, try this;
>
> Source tags: <> 
> <$list filter="[{!!source}enlist-input[]]">
>   <>
> 
>
>
>- You can also trigger actions on selection with the tag picker.
>
>
> Regards
> Tones
> On Monday, 25 January 2021 at 00:48:10 UTC+11 Misterel85 wrote:
>
>> Hi,
>>
>> I started gathering all the drama activities I have collected over the 
>> years from miscellaneous sources into a TW single file.
>>
>> To quote the source of an activity (= one tiddler per activity / 
>> exercise), I have used so far:
>>
>>- a tag, itself tagged as 'Source', and that holds the main source 
>>reference in its text field (website, book, event title and description);
>>- a 'source_detail' field in the activity tiddler, that contains the  
>>reference details of the activity, such as the book page number, etc.
>>
>> Both the source tag's text field and the 'source_detail' field are then 
>> transcluded into the activity, thanks to a macro adapted from Tobias 
>> Beer's filter and list examples 
>> <http://tobibeer.github.io/tw/filters/#all%20current%20tags%20of%20type>.
>>
>> That works great when the activity has only one source. Some (nearly) 
>> identical activities, however, can be found on several sources: books, web 
>> pages, notes from events I took part in, etc. And I would like to quote 
>> them all in the activity tiddlers.
>>
>> So, here's what I would like:
>>
>>
>>1. I create an activity tiddler.
>>2. I create the corresponding generic source tag tiddler(s) if they 
>>don't already exist. Ex. a tiddler tag whose text field holds info about 
>> a 
>>(hypothetical) 'dramatis.com' website would be called 'dramatis' and 
>>tagged 'Source'.
>>3. For every time I add a source tag to the activity tiddler, TW 
>>checks whether a corresponding source detail field exists in that current 
>>activity tiddler.
>>4. If not, it retrieves the name of the tag and creates a new field 
>>named after that tag. In the example above, a corresponding field named 
>>'dramatis_detail' or simply 'dramatis' would be added in the current 
>>activity tiddler.
>>5. If I delete a source tag (ex. the 'dramatis' tag), the 
>>corresponding 'dramatis' field would also be deleted. (That step may not 
>> be 
>>necessary if step 3 is implemented.)
>>
>>
>> Hope my explanations were clear. I can't work it out because I've been a 
>> TW beginner for months, I can't understand everything in the very technical 
>> and programer-oriented TW documentation, and so far, my needs have always 
>> been very basic. Time for me to improve my TW knowledge!
>>
>> Do you think something like that could be done? If not, would anybody 
>> happen to think of a similar solution on how to manage multiple sources and 
>> reference details, and the  different steps to implement it?
>>
>> Thanks.
>>
>> Stéphane L.
>>
>

-- 
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/dcd3bee3-4344-496e-a257-dfc9ffa412den%40googlegroups.com.


[tw5] Can tag adding trigger field creation?

2021-01-24 Thread Misterel85
Hi,

I started gathering all the drama activities I have collected over the 
years from miscellaneous sources into a TW single file.

To quote the source of an activity (= one tiddler per activity / exercise), 
I have used so far:

   - a tag, itself tagged as 'Source', and that holds the main source 
   reference in its text field (website, book, event title and description);
   - a 'source_detail' field in the activity tiddler, that contains the  
   reference details of the activity, such as the book page number, etc.

Both the source tag's text field and the 'source_detail' field are then 
transcluded into the activity, thanks to a macro adapted from Tobias Beer's 
filter and list examples 
.

That works great when the activity has only one source. Some (nearly) 
identical activities, however, can be found on several sources: books, web 
pages, notes from events I took part in, etc. And I would like to quote 
them all in the activity tiddlers.

So, here's what I would like:


   1. I create an activity tiddler.
   2. I create the corresponding generic source tag tiddler(s) if they 
   don't already exist. Ex. a tiddler tag whose text field holds info about a 
   (hypothetical) 'dramatis.com' website would be called 'dramatis' and tagged 
   'Source'.
   3. For every time I add a source tag to the activity tiddler, TW checks 
   whether a corresponding source detail field exists in that current activity 
   tiddler.
   4. If not, it retrieves the name of the tag and creates a new field 
   named after that tag. In the example above, a corresponding field named 
   'dramatis_detail' or simply 'dramatis' would be added in the current 
   activity tiddler.
   5. If I delete a source tag (ex. the 'dramatis' tag), the corresponding 
   'dramatis' field would also be deleted. (That step may not be necessary if 
   step 3 is implemented.)


Hope my explanations were clear. I can't work it out because I've been a TW 
beginner for months, I can't understand everything in the very technical 
and programer-oriented TW documentation, and so far, my needs have always 
been very basic. Time for me to improve my TW knowledge!

Do you think something like that could be done? If not, would anybody 
happen to think of a similar solution on how to manage multiple sources and 
reference details, and the  different steps to implement it?

Thanks.

Stéphane L.

-- 
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/a2b129fe-5c40-425d-a7f6-5d9b8eb8574bn%40googlegroups.com.


[tw5] Re: [Formatting] How to format better in Wiki?

2020-07-29 Thread Misterel85
Hi Prestige,

I've had the same problem, which I tried to solve too.
Here's my solution, using  and :

# My first title

```
Some code here
```


# My second title

> This is a comment



# Another title

>* This is a listed comment



# The last title

It should give the same result as Mat's solution. Perhaps mine is not the 
best, though.
Hope that helps anyway.


Le mercredi 29 juillet 2020 15:03:46 UTC+2, Prestige a écrit :
>
> [image: {389BEC32-2503-425B-B221-DFAAA77E7D24}.png.jpg]Hello Fellow 
> Tiddlerers (?)
>
> I have this problem where the '#' doesnt take the right bullt number. and 
> I wanted nested quotes (inside the bullets) ; is it possible?
>
>
>

-- 
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/4c573585-4f49-46b0-8694-1004ca6a84d2o%40googlegroups.com.


[tw5] Re: 5.1.22 Upgrade - Top MenuBar

2020-04-19 Thread Misterel85
Thanks a lot for your quick reply, Birthe. I was sure the menu bar was 
included in the new version of TW.



Le dimanche 19 avril 2020 14:14:40 UTC+2, Birthe C a écrit :
>
> You have to install the menubar plugin. Go to control panel - Plugins, 
> click the blue button, get more plugins. Select Official Tiddlywiki Plugin 
> Library.
>
>
> Birthe
>

-- 
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/a70b426f-337c-4897-956a-1a66024b3ae2%40googlegroups.com.


[tw5] 5.1.22 Upgrade - Top MenuBar

2020-04-19 Thread Misterel85
Hi everyone,

I discovered TiddlyWiki a few months ago and I really enjoy using it. I 
have plenty of ideas of things I'd like to be able to do with TW but I lack 
time and knowledge to do them all. I'm sure I'll come back to this active 
and friendly community for help with a lot of questions.

I started updating some of my wikis to version 5.1.22 and I expected to see 
the new menu bar on top of the updates. But there was none.
I checked  in the Control Panel tiddler > Appearance > Toolbars and noticed 
that there's no Menu Bar tab in the updated TW files, which seems strange.

Therefore, I am wondering whether that's normal behavior or if there's a 
problem in the updating process, that might be caused by a difference in 
the language editions (all my TW files are in French). I checked in the 
French forum to find if somebody else had met that problem, but that 
doesn't seem to be the case.

I can't remember whether my wikis were downloaded from the standard 
English-language TW webpage and the French language plugin added 
afterwards, or directly in French from language edition tiddler.

Hope somebody can help me there. In the meantime, I'll try to investigate 
more on that problem.

Thanks.

-- 
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/e81c3cf0-f948-4fa3-879a-d89e0521d78d%40googlegroups.com.