[tw5] Re: Custom sort order

2021-05-03 Thread Max Rozeman
No problem Mario. I've learned from each of the replies to my question so 
I'm glad you posted.

On Monday, May 3, 2021 at 11:05:12 PM UTC+10 PMario wrote:

> On Monday, May 3, 2021 at 11:48:41 AM UTC+2 Max Rozeman wrote:
>
>> Well it looks like this isn't as simple as I had hoped. Maybe what I need 
>> is a macro, but that's a skill I've yet to learn. For the time being then 
>> I'll just have to sort my titles the easy and messy way by adding prefixes 
>> to my prefixes.
>>
>
> You are right. My code doesn't work as expected. ... I did very poor 
> testing, so it looked like it would have worked. ... :/ Sorry for that. 
>
> But the sortby operator needs "matching titles" it doesn't use regexp 
> matches internally, which would have been needed for your usecase. 
>
> So imo there won't be a "out of the box" solution. ... At least I don't 
> know it. 
>
> -mario
>
>

-- 
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/8860e2aa-0b9d-4294-b32c-7311263ad7fdn%40googlegroups.com.


[tw5] Re: Custom sort order

2021-05-03 Thread Max Rozeman
Thank you very much Soren -- it works beautifully! Thanks also for your 
clear explanation.

On Tuesday, May 4, 2021 at 4:34:21 AM UTC+10 Soren Bjornstad wrote:

> Sorry, there's a typo in that macro, should be:
>
> \define myfilt() [all[current]split[ ]first[]match[SP]then[010]] 
> [all[current]split[ ]first[]match[SC]then[020]] [all[current]split[ 
> ]first[]match[ER]then[030]]
>
> On Monday, May 3, 2021 at 1:30:56 PM UTC-5 Soren Bjornstad wrote:
>
>> Here's a solution using sortsub, which sorts based on a key obtained by 
>> running a filter against each input item.  This assumes your prefixes are 
>> separated from the rest of the tiddler title by a space. If not, you may 
>> have to change the split character or get a bit more creative:
>>
>> \define myfilt() [all[current]split[ ]first[]match[SP]then[010] 
>> [all[current]split[ ]first[]match[SC]then[020]] [all[current]split[ 
>> ]first[]match[ER]then[030]]
>>
>> <]">>
>>
>> The subfilter in myfilt uses a series of runs to convert each prefix 
>> into a numerical value which sorts in the order you want. You can add as 
>> many steps to the filter as you need to handle all your prefixes. Any items 
>> that don't have a prefix listed in the filter will get no sort key and so 
>> show up at the top of the list.
>>
>> I am sure you could get creative and figure out how to store the mapping 
>> in a data tiddler and dynamically build the filter, but I'll let someone 
>> else figure that out if they're so inclined.
>>
>> On Monday, May 3, 2021 at 8:05:12 AM UTC-5 PMario wrote:
>>
>>> On Monday, May 3, 2021 at 11:48:41 AM UTC+2 Max Rozeman wrote:
>>>
>>>> Well it looks like this isn't as simple as I had hoped. Maybe what I 
>>>> need is a macro, but that's a skill I've yet to learn. For the time being 
>>>> then I'll just have to sort my titles the easy and messy way by adding 
>>>> prefixes to my prefixes.
>>>>
>>>
>>> You are right. My code doesn't work as expected. ... I did very poor 
>>> testing, so it looked like it would have worked. ... :/ Sorry for that. 
>>>
>>> But the sortby operator needs "matching titles" it doesn't use regexp 
>>> matches internally, which would have been needed for your usecase. 
>>>
>>> So imo there won't be a "out of the box" solution. ... At least I don't 
>>> know it. 
>>>
>>> -mario
>>>
>>>

-- 
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/667c128b-5cff-47f4-9207-cf9b73189f92n%40googlegroups.com.


[tw5] Re: Custom sort order

2021-05-03 Thread Max Rozeman
Well it looks like this isn't as simple as I had hoped. Maybe what I need 
is a macro, but that's a skill I've yet to learn. For the time being then 
I'll just have to sort my titles the easy and messy way by adding prefixes 
to my prefixes.

On Sunday, May 2, 2021 at 10:56:47 PM UTC+10 Max Rozeman wrote:

> I have found that the 2nd example 
> <https://tiddlywiki.com/#sortby%20Operator%20(Examples)> of the sortby 
> operator works, but only if the headings of the tiddlers to be listed and 
> sorted are the same as and no longer than the prefixes. They are prefixes 
> however, i.e. at the beginning of tiddler titles; not complete headings. 
> Complete tiddler headings may for example look like: "SP. Tiddler heading" 
> or "ER. Another tiddler heading". 
>
> On Sunday, May 2, 2021 at 6:36:56 PM UTC+10 Max Rozeman wrote:
>
>> Sorry -- that was a typing mistake, not a direct copy-paste. I did 
>> include the exclamation marks in my attempt, and the list was alphabetical. 
>> The documentation link is very useful more generally; -- there is more 
>> depth of information on that site there than I previously realised, so I'll 
>> read it more and hopefully learn to problem-solve better. I don't know 
>> where to start with this sorting problem, except reading about `sortby` and 
>> trying each content type for saving the `testKeys` tiddler. No success so 
>> far.
>>
>>
>> On Sunday, May 2, 2021 at 12:08:16 AM UTC+10 PMario wrote:
>>
>>> <>  
>>>
>>> No exclamation marks. The have a meaning. See: more info in the docs 
>>> <https://tiddlywiki.com/#Transclusion:Transclusion%20%5B%5BTransclusion%20Basic%20Usage%5D%5D%20%5B%5BTransclusion%20in%20WikiText%5D%5D%20%5B%5BTransclusion%20and%20Substitution%5D%5D>.
>>>  
>>>
>>> -m
>>> On Saturday, May 1, 2021 at 3:35:51 PM UTC+2 Max Rozeman wrote:
>>>
>>>> Thank you for your replies, Joost and Mario. 
>>>>
>>>> For the solution suggested by Mario, I have created the testKeys 
>>>> tiddler with the space-separated list (without commas). 
>>>>
>>>> In another tiddler I tested it with the following: <>>> filter:"[priority[1]sortby{!!testKeys}]">>  The output is in alphabetical 
>>>> order. I don't know what could be wrong or missing.
>>>>
>>>> On Saturday, May 1, 2021 at 10:10:37 PM UTC+10 PMario wrote:
>>>>
>>>>> On Saturday, May 1, 2021 at 11:53:38 AM UTC+2 dode...@gmail.com wrote:
>>>>>  
>>>>>
>>>>>> <$list filter="[tag[Tasks]each[status]get[status]*sortby{!!sortkey}]*
>>>>>> ">
>>>>>
>>>>>
>>>>> Hi Max, 
>>>>>
>>>>> I'd use something like: [tag[asdf]sortby{testKeys}], where testKeys is 
>>>>> a  single tiddler that contains the sort order
>>>>>
>>>>> So tesKeys tiddler should contain a "space-separated" list eg: SC SP 
>>>>> ER MV IR SN CT AC CO   ...  no commas! 
>>>>>
>>>>> With your filter, the sortkeys field needs to be part of every 
>>>>> tiddler. .. That's a lot of redundant work, especially if you need to 
>>>>> change something and you have 100+ tiddlers. 
>>>>>
>>>>> have fun!
>>>>> mario
>>>>>
>>>>

-- 
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/411739fa-1ef6-43fb-84ee-ac3afe6eeaa3n%40googlegroups.com.


[tw5] Re: Custom sort order

2021-05-02 Thread Max Rozeman
I have found that the 2nd example 
<https://tiddlywiki.com/#sortby%20Operator%20(Examples)> of the sortby 
operator works, but only if the headings of the tiddlers to be listed and 
sorted are the same as and no longer than the prefixes. They are prefixes 
however, i.e. at the beginning of tiddler titles; not complete headings. 
Complete tiddler headings may for example look like: "SP. Tiddler heading" 
or "ER. Another tiddler heading". 

On Sunday, May 2, 2021 at 6:36:56 PM UTC+10 Max Rozeman wrote:

> Sorry -- that was a typing mistake, not a direct copy-paste. I did include 
> the exclamation marks in my attempt, and the list was alphabetical. The 
> documentation link is very useful more generally; -- there is more depth of 
> information on that site there than I previously realised, so I'll read it 
> more and hopefully learn to problem-solve better. I don't know where to 
> start with this sorting problem, except reading about `sortby` and trying 
> each content type for saving the `testKeys` tiddler. No success so far.
>
>
> On Sunday, May 2, 2021 at 12:08:16 AM UTC+10 PMario wrote:
>
>> <>  
>>
>> No exclamation marks. The have a meaning. See: more info in the docs 
>> <https://tiddlywiki.com/#Transclusion:Transclusion%20%5B%5BTransclusion%20Basic%20Usage%5D%5D%20%5B%5BTransclusion%20in%20WikiText%5D%5D%20%5B%5BTransclusion%20and%20Substitution%5D%5D>.
>>  
>>
>> -m
>> On Saturday, May 1, 2021 at 3:35:51 PM UTC+2 Max Rozeman wrote:
>>
>>> Thank you for your replies, Joost and Mario. 
>>>
>>> For the solution suggested by Mario, I have created the testKeys tiddler 
>>> with the space-separated list (without commas). 
>>>
>>> In another tiddler I tested it with the following: <>> filter:"[priority[1]sortby{!!testKeys}]">>  The output is in alphabetical 
>>> order. I don't know what could be wrong or missing.
>>>
>>> On Saturday, May 1, 2021 at 10:10:37 PM UTC+10 PMario wrote:
>>>
>>>> On Saturday, May 1, 2021 at 11:53:38 AM UTC+2 dode...@gmail.com wrote:
>>>>  
>>>>
>>>>> <$list filter="[tag[Tasks]each[status]get[status]*sortby{!!sortkey}]*
>>>>> ">
>>>>
>>>>
>>>> Hi Max, 
>>>>
>>>> I'd use something like: [tag[asdf]sortby{testKeys}], where testKeys is 
>>>> a  single tiddler that contains the sort order
>>>>
>>>> So tesKeys tiddler should contain a "space-separated" list eg: SC SP ER 
>>>> MV IR SN CT AC CO   ...  no commas! 
>>>>
>>>> With your filter, the sortkeys field needs to be part of every tiddler. 
>>>> .. That's a lot of redundant work, especially if you need to change 
>>>> something and you have 100+ tiddlers. 
>>>>
>>>> have fun!
>>>> mario
>>>>
>>>

-- 
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/26fe47c4-5c8d-4e73-bc8e-94a76b8b9937n%40googlegroups.com.


[tw5] Re: Custom sort order

2021-05-02 Thread Max Rozeman
Sorry -- that was a typing mistake, not a direct copy-paste. I did include 
the exclamation marks in my attempt, and the list was alphabetical. The 
documentation link is very useful more generally; -- there is more depth of 
information on that site there than I previously realised, so I'll read it 
more and hopefully learn to problem-solve better. I don't know where to 
start with this sorting problem, except reading about `sortby` and trying 
each content type for saving the `testKeys` tiddler. No success so far.


On Sunday, May 2, 2021 at 12:08:16 AM UTC+10 PMario wrote:

> <>  
>
> No exclamation marks. The have a meaning. See: more info in the docs 
> <https://tiddlywiki.com/#Transclusion:Transclusion%20%5B%5BTransclusion%20Basic%20Usage%5D%5D%20%5B%5BTransclusion%20in%20WikiText%5D%5D%20%5B%5BTransclusion%20and%20Substitution%5D%5D>.
>  
>
> -m
> On Saturday, May 1, 2021 at 3:35:51 PM UTC+2 Max Rozeman wrote:
>
>> Thank you for your replies, Joost and Mario. 
>>
>> For the solution suggested by Mario, I have created the testKeys tiddler 
>> with the space-separated list (without commas). 
>>
>> In another tiddler I tested it with the following: <> filter:"[priority[1]sortby{!!testKeys}]">>  The output is in alphabetical 
>> order. I don't know what could be wrong or missing.
>>
>> On Saturday, May 1, 2021 at 10:10:37 PM UTC+10 PMario wrote:
>>
>>> On Saturday, May 1, 2021 at 11:53:38 AM UTC+2 dode...@gmail.com wrote:
>>>  
>>>
>>>> <$list filter="[tag[Tasks]each[status]get[status]*sortby{!!sortkey}]*">
>>>
>>>
>>> Hi Max, 
>>>
>>> I'd use something like: [tag[asdf]sortby{testKeys}], where testKeys is 
>>> a  single tiddler that contains the sort order
>>>
>>> So tesKeys tiddler should contain a "space-separated" list eg: SC SP ER 
>>> MV IR SN CT AC CO   ...  no commas! 
>>>
>>> With your filter, the sortkeys field needs to be part of every tiddler. 
>>> .. That's a lot of redundant work, especially if you need to change 
>>> something and you have 100+ tiddlers. 
>>>
>>> have fun!
>>> mario
>>>
>>

-- 
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/bd7f885a-b530-4b49-9508-7f919465791cn%40googlegroups.com.


[tw5] Re: Custom sort order

2021-05-01 Thread Max Rozeman
Thank you for your replies, Joost and Mario. 

For the solution suggested by Mario, I have created the testKeys tiddler 
with the space-separated list (without commas). 

In another tiddler I tested it with the following: <>  The output is in alphabetical 
order. I don't know what could be wrong or missing.

On Saturday, May 1, 2021 at 10:10:37 PM UTC+10 PMario wrote:

> On Saturday, May 1, 2021 at 11:53:38 AM UTC+2 dode...@gmail.com wrote:
>  
>
>> <$list filter="[tag[Tasks]each[status]get[status]*sortby{!!sortkey}]*">
>
>
> Hi Max, 
>
> I'd use something like: [tag[asdf]sortby{testKeys}], where testKeys is a  
> single tiddler that contains the sort order
>
> So tesKeys tiddler should contain a "space-separated" list eg: SC SP ER MV 
> IR SN CT AC CO   ...  no commas! 
>
> With your filter, the sortkeys field needs to be part of every tiddler. .. 
> That's a lot of redundant work, especially if you need to change something 
> and you have 100+ tiddlers. 
>
> have fun!
> mario
>

-- 
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/e0cff470-2f1d-43ec-a297-f305786d80bcn%40googlegroups.com.


[tw5] Re: Default text and tags for new tiddlers

2021-04-30 Thread Max Rozeman
Thank you Mario! That is very helpful information. A custom button is even 
better than what I was hoping for.

Max

On Thursday, April 29, 2021 at 9:13:37 PM UTC+10 PMario wrote:

> Hi Max,
>
> You can save the attachment and then drag&drop import it. It will create a 
> new NewHere (Custom) button, that will use a template to create the new 
> tiddler. 
>
> The attachment contains: 
>
>1. $:/config/NewTiddler/Template/Name
>2. $:/config/NewTiddler/Template
>3. $:/core/ui/Buttons/new-here-using-template
>
> 1) can be used to switch between different templates
> 2) is the template tiddler. 
> 3) is the new button
>
> If you want to see them in the right sidebar, you'll need to remove the $ 
> from the name AND the code. 
>
> have fun!
> mario
>
>

-- 
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/14af10ae-7561-4d79-ae7b-061130495aben%40googlegroups.com.


[tw5] Custom sort order

2021-04-30 Thread Max Rozeman
I use a 2-character prefix for tiddler headings, and 9 different 
2-character prefixes for tiddler headings. Tiddler headings are often 
listed using <>. The problem is that the tiddler headings 
need to be sorted in a particular non-alphabetical order: (SC, SP, ER, MV, 
IR, SN, CT, AC, CO). An easy solution would be to add prefixes to the 
prefixes, e.g.: (1 SC, 2 SP, 3 ER, ...) and sort headings using 
[sort[title]], but that would be messy. Is there a better way that doesn't 
require additional prefixes?

-- 
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/be512b39-2f11-4556-a4ae-3dd3decf590bn%40googlegroups.com.


[tw5] Re: Default text and tags for new tiddlers

2021-04-29 Thread Max Rozeman
I have followed the instructions found on this message board to 
automatically add text from "mytiddler" to new tiddlers, and it works 
correctly only when I use the "Create a new tiddler" button on the page 
toolbar. When I use the button on the tiddler View toolbar: "Create a new 
tiddler tagged with this one", the new tiddler is blank. How can I set up 
the button: "Create a new tiddler tagged with this one" to add the text 
from "mytiddler" to all new tiddlers created with that button? 

On Tuesday, June 30, 2020 at 12:45:00 PM UTC+10 Riz wrote:

> 1. Create one Tiddler with your required tags and text. Let us say this 
> Tiddler is named "mytiddler"
> 2. Go to advanced search>shadows tab and search for Tiddler named 
> "$:/core/ui/Actions/new-tiddler". 
> 3. Change the text in "$:/core/ui/Actions/new-tiddler" to the following
>
> <$action-sendmessage $message="tm-new-tiddler" $param="mytiddler"/>
>

-- 
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/54022510-4591-4037-9cd9-c0c3afcaad14n%40googlegroups.com.