이 문서는 https://tiddlywiki.com/languages/ko-KR/에서 티들리위키의 정적 HTML 표현의 일부입니다

sortsub Operator (Examples)

2020년 11월 18일 오전 10:33

These examples make use of the following variables:

  • compare-by-title-length: [length[]]
  • compare-by-text-length: [get[text]else[]length[]]
  • compare-by-newest-of-modified-and-created-dates: [get[modified]else[19700101]]

[sortsub:number<compare-by-title-length>limit[10]]

[!sortsub:number<compare-by-title-length>limit[10]]

[sortsub:number<compare-by-text-length>limit[10]]

[!sortsub:number<compare-by-text-length>limit[10]]

[tag[Field Operators]sortsub:date<compare-by-newest-of-modified-and-created-dates>]

You can use the search-replace Operator in combination with the sortsub Operator to ignore stop words like "A" and "The" at the beginning of titles when sorting. (Note for example that "A Tale of Two Cities" sorts under "T" rather than "A")

[enlist<book-list>sortsub<compare-without-stopwords>]

You can also customise the listing so that "A Tale of Two Cities" is listed as "Tale of Two Cities, A" but still links to the correct tiddler.

<ul>
<$list filter="[enlist<book-list>sortsub<compare-without-stopwords>]">
<li><$link><$text text={{{[<currentTiddler>search-replace:i:regexp[(^The |A )(.*)],[$2, $1]]}}}/></$link></li>
</$list>
</ul>

That renders as: