Jean-Pierre ,
Its late here in Sydney, so I can look at this tomorrow, if no one else
has, however can I suggest you try an come at this from a different
direction!
Alternatively can I suggest it will be easier for you if you state
> Please do say what you want to do with the first word / letter ?
The conversation has being driven by the code that has not being working
for you, but it is not clear to me, perhaps others what it is you want to
do.
Please state your requirement in plain language so we can respond to you
requirement, rather than the code that is not working for you.
A tip to consider lists generate lists of titles, once you have those
tittle you can do what every you want yo each title inside the list widget.
If instead you want a list of all letters in the alphabet, with a list of
tiddlers beginning with that letter then you should have a alphabet list as
an outer list, and a letters beginning with that letter in an inner list.
Only then see if you can combine them into a single filter, if you must.
<$list filter="A B C D E F G I L M O P R S T U V Z" variable=firstchar >
Then
<$list filter=[tag[glossaire]prefix<firstchar>sort[]]">
</$list>
</$list>
But I am still not sure what you want.
Regards
Tones
On Wednesday, 28 October 2020 19:06:39 UTC+11, Jean-Pierre Rivière 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/ed415b96-dfd1-4f02-acd0-f2b34142639fo%40googlegroups.com.