Can you provide some sample data that shows what the TW filter is doing, 
and then an example of what you would like it to do?

On Wednesday, October 28, 2020 at 1:06:39 AM UTC-7 jn.pierr...@gmail.com 
wrote:

> Now that I know how to fetch the first letter of a given tiddler title, I 
> am not up to my task alas. Because the bit of code shown to me is unable to 
> permit me to have list of all initial letters with only one of each letter 
> concerned. This means I need to have firsthand all the initial inside my 
> filter, not within a list widget.
>
> And there lays the limit of subfilter: it is not able to do that, although 
> I thought to understand it could. This is the never ending story, or am I 
> so dumb?
>
> Here is my latest code (without letter unification yet):
>
> \define first-char() [split[]first[]]
> \define glossary-entries() [tag[glossaire]subfilter<first-char>]
> <$list filter=<<glossary-entries>>> * <$link/></$list>
>
> it returns only the first letter of the first tiddler!
>
> what I want to acheive finally, is generate something like (see that all 
> letters are not there):
>
> [[A]] [[B]] [[C]] [[D]] [[E]] [[F]] [[G]] [[I]] [[L]] [[M]] [[O]] [[P]] 
> [[R]] [[S]] [[T]] [[U]] [[V]] [[Z]]
>
> Le mercredi 28 octobre 2020 à 08:50:40 UTC+1, Jean-Pierre Rivière a écrit :
>
>> <$list filter="[tag[TableOfContents]]">
>>    <$set name=1st value={{{ [all[current]split[]first[]] }}}>
>>    <$set name=1stWord value={{{ [all[current]split[ ]first[]] }}}>
>>         <<1st>> <<1stWord>> <$link/><br>
>>    </$set></$set>
>> </$list>
>>
>> is really what I wanted to know how to do. I failed to spot your message. 
>> Many thanks Tones!
>>
>> Le lundi 26 octobre 2020 à 23:51:59 UTC+1, TW Tones a écrit :
>>
>>> Jean-Pierre,
>>>
>>> Please do say what you want to do with the first word / letter ?
>>>
>>>    - Below are some examples that should solve your issues
>>>    - Filters as a rule generate one output so I like to focus on the 
>>>    selected tiddler then process it later.
>>>
>>>
>>> Thanks for sharing code that works on TiddlyWiki.com, my examples do so 
>>> as well.
>>>
>>> If it is only for some display purpose you can keep the list focused on 
>>> the selected tiddlers and use triple curly braces (filtered Transclusions) 
>>>
>>> <$list filter="[tag[TableOfContents]]">
>>>    {{{ [all[current]split[]first[]] }}}, {{{ [all[current]split[ 
>>> ]first[]] }}}, <$link/><br>
>>> </$list>
>>>
>>> You can also use HTML
>>>
>>> <style>
>>> p.uppercase {
>>>   text-transform: uppercase;
>>> }
>>>
>>> p.lowercase {
>>>   text-transform: lowercase;
>>> }
>>>
>>> p.capitalize {
>>>   text-transform: capitalize;
>>> }
>>> </style>
>>>
>>>
>>> <$list filter="[tag[TableOfContents]]">
>>> <p class="uppercase"><<currentTiddler>></p>
>>> <p class="lowercase"><<currentTiddler>></p>
>>> <p class="capitalize"><<currentTiddler>></p>
>>> <hr>
>>> </$list>
>>>
>>> But if you need the 1st letter and first word as variables do this.
>>>
>>> <$list filter="[tag[TableOfContents]]">
>>>    <$set name=1st value={{{ [all[current]split[]first[]] }}}>
>>>    <$set name=1stWord value={{{ [all[current]split[ ]first[]] }}}>
>>>         <<1st>> <<1stWord>> <$link/><br>
>>>    </$set></$set>
>>> </$list>
>>>
>>> Regards
>>> Tones
>>>
>>> On Tuesday, 27 October 2020 09:10:59 UTC+11, Jean-Pierre Rivière wrote:
>>>>
>>>> good points. OK, I'll do the rwo lists imbicated. Yet, I cannot see why 
>>>> I get exactly the same results in the two lists below.
>>>>
>>>>
>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>> <$list 
>>>> filter="[subfilter<chrome>lowercase[]sentencecase[]splitregexp[\W]!is[blank]addprefix[
>>>>  
>>>> * ]]"/>
>>>> </$set>
>>>>
>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>> <$list 
>>>> filter="[tag[Chrome]lowercase[]sentencecase[]splitregexp[\W]!is[blank]addprefix[
>>>>  
>>>> * ]]"/>
>>>> </$set>
>>>>
>>>> which is
>>>>
>>>> * noteself * by * danielo * rodr * guez * savetiddlers * extension * 
>>>> for * chrome * and * firefox * by * buggyj * Emergency * tiddler * export 
>>>> * 
>>>> Saving * on * tiddlyspot * Saving * to * a * git * service * Saving * via 
>>>> * 
>>>> a * minimal * ruby * server * Saving * via * webdav * Saving * with * the 
>>>> * 
>>>> html5 * fallback * saver * Tiddlydrive * add * on * for * google * drive * 
>>>> by * joshua * stubbs * Tiddlywiki * cloud * Timimi * webextension * and * 
>>>> native * host * by * riz
>>>>
>>>> And same with
>>>>
>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>> <$list 
>>>> filter="[subfilter<chrome>lowercase[]sentencecase[]splitregexp[\W]!is[blank]first[]]"/>
>>>> </$set>
>>>>
>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>> <$list 
>>>> filter="[tag[Chrome]lowercase[]sentencecase[]splitregexp[\W]!is[blank]first[]]"/>
>>>> </$set>
>>>>
>>>> where the result is:
>>>>
>>>> noteself
>>>>
>>>> (from ~"noteself" by danielo rodríguez~)
>>>>
>>>> What's the use of subfilter in real life? It seems such a strange 
>>>> beast. I'm really confused. I wish there be an equivalent of map() found 
>>>> in 
>>>> functional language. I thought subfilter was just that but visibly it is 
>>>> not.
>>>>
>>>> with map I would code:
>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>> <$list 
>>>> filter="[subfilter<chrome>lowercase[]sentencecase[]splitregexp[\W]!is[blank]first[]]"/>
>>>> </$set>
>>>>
>>>> In fact, I'm perplex when reading the subfilter help and the examples 
>>>> don't help me. In particular, I am at odds with the input and the 
>>>> parameter 
>>>> S. S is said to be a filter expression. And the outpur is the selection of 
>>>> titles returned from the subfilter S. Let's see.
>>>>
>>>> in the complete filter below, what is the input and what is the 
>>>> parameter S?
>>>>
>>>> [subfilter[one two three]addsuffix[!]]
>>>>
>>>> input should be: every tiddlers (but system tiddlers).
>>>> S is <<one two three>> and so S is a collection of three tiddler titles.
>>>> The output of subfilter is S, right?
>>>> Although it does not seems so because [[one two three]addsuffix[!]] 
>>>> does not produce the same result ("one two three!" instead of "one! two! 
>>>> three!").
>>>>
>>>> Le lundi 26 octobre 2020 à 19:00:52 UTC+1, Mark S. a écrit :
>>>>
>>>>> There are two mistakes in this:
>>>>>
>>>>> <list filter="[subfilter<chrome> splitregexp[\W]!is[blank]first[]]"/>
>>>>>
>>>>> 1. It should be $list.  2. There is a space in front of splitregexp.
>>>>>
>>>>> Unfortunately, using a subfilter won't allow you to process the 
>>>>> tiddlers the way you want. You will need a nested loop, with the outer 
>>>>> list 
>>>>> finding the tiddlers and the inner list extracting the first word.
>>>>>
>>>>>
>>>>>
>>>>> On Monday, October 26, 2020 at 10:41:29 AM UTC-7, Jean-Pierre Rivière 
>>>>> wrote:
>>>>>>
>>>>>> I have a liste of tiddlers (got with something like 
>>>>>> filter="[tag[foo]]") of which I want the first word/letter.
>>>>>>
>>>>>> For only the last single title I get the first word with 
>>>>>> filter="[tag[Chrome]last[]splitregexp[\W]!is[blank]first[]]"
>>>>>>
>>>>>> Now, how to get it for all the titles, entirely within a single 
>>>>>> filter if possible (I'd rather avoid a list widget to achieve that)? 
>>>>>> Definitely something to do with subfilter. But no, I still can't get it. 
>>>>>> Frustrating. My initial coding:
>>>>>>
>>>>>> <$set name="chrome" value="[tag[Chrome]]">
>>>>>> <list filter="[subfilter<chrome> splitregexp[\W]!is[blank]first[]]"/>
>>>>>> </$set>
>>>>>>
>>>>>>
>>>>>>

-- 
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/325ca456-c68f-4b81-82b1-09cc805f94ddn%40googlegroups.com.

Reply via email to