On Thursday, August 27, 2020 at 2:48:05 AM UTC-7, Sapphireslinger wrote:
>
> When I finish reading a book, what is the most elegant way to mark it as
> read?
There are LOTS of ways to do this. For this reply, let's just use the
method you described...
> *list ... all tiddlers possessing the field "finished-reading-date" ...
> and sort them by that field ...* *sort under year headings (and) month
> headings?*
>
*They are already tagged with the year I finished reading them (i.e 2020)
> and the month (i.e August).*
Here's a set of nested <$list> widgets to show the "Reading History":
<$list filter="[range[2018,2021]]" variable="year">
<$list filter="[tag<year>limit[1]]">
<<year>><br>
<$list
filter="[range[1,12]addprefix[$:/language/Date/Long/Month/]get[text]]"
variable="month">
<$list filter="[tag<year>tag<month>limit[1]]">
 <<month>><br>
<$list filter="[tag<year>tag<month>
has[finished-reading-date]sort[finished-reading-date]]">
  <$link /> (<$view
field="finished-reading-date"/>)<br>
</$list>
</$list>
</$list>
</$list>
</$list>
Notes:
* Line 1: $list iterates over a set of years using range[start,end] (adjust
start and end values to fit your data)
* Line 2: $list checks to see if at least 1 tiddler is tagged with that year
* Line 3: displays the year
* Line 4: $list iterates over a set of month names using range[1,12],
getting the month names from the TWCore shadows
* Line 5: $list checks to see if at least 1 tiddler is tagged with that
year and month
* Line 6: displays the month, indented by   (an "em" space character)
* Line 7: $list finds all tiddlers with the year and month tags that also
have a "finished-reading-date" field, and sorts by that field
* Line 8: displays a link to the matching tiddler and the value of the
"finished-reading-date" field, indented by two $emsp;
* Lines 9-13: close the $list widgets
enjoy,
-e
--
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/4e852597-630b-4309-9643-1089de380b3do%40googlegroups.com.