I guess ultimately I want something like SQL, in SQL I can do multiple 
levels of sorting, and I can also run a function on input and then have 
that output be the input of another function. So I can do SELECT * FROM 
foobar WHERE (CAST(length AS NUMBER)) < 10 ORDER BY length, title DESC; <-- 
Probably incorrect SQL syntax but trying to illustrate what I mean.

I was thinking something like "[tag[foobar]has[length] 
let:pseudolength[int(length)] lessthan:pseudolength[10] 
sort[pseudolength,title]"  where pseudolength is a temporary field created 
by the let operator, and int(length) will convert a alphanumeric field into 
a numberic field (e.g. "10 feet" becomes 10, and it has type int), when 
sort comes along it can take multiple fields, and because the pseudolength 
field is of type int it sort it numerically, whilst title is sorted 
alphabetically. Something like this, or being able to specify some custom 
javascript like a callback for converting or sorting, would be nice.

On Saturday, 14 October 2017 06:31:59 UTC+11, Jed Carty wrote:
>
> I can see how we can do all of that other than the zero padding in just 
> wikitext, but without the zero padding the sort will break because it would 
> be an alphanumeric sort. Perhaps we need to make a padding filter, it 
> shouldn't be too difficult to implement and I think it has come up before.
>
> For anyone who doesn't know the details of the sorting, the problem is 
> that there are two types of sorting done in tiddlywiki, it can be numeric, 
> where things are ordered according to numeric values and 10 comes after 2 
> because the number 10 is greater than 2. The other sort is an alphanumeric 
> sort where 10 comes before 2 because the first character in 10 comes before 
> the first character in 2 when sorted in the order that the characters are 
> sorted in the character encoding used. If you have something that has both 
> numbers and letters in it than it can not be sorted using the numeric 
> method using built-in functions.
>

-- 
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 post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2a755632-df3b-47d2-9712-d860d81d66aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to