List Range: Produce Output in a Specified Range

This is a simple macro to generate output for a filter in a specified range! For example if your filter produces 100 output, you can call macro to display only output 10 to 20.

Use case: make a simple pagination macro!

Code and Demo

  1. Open
  2. Create a new tiddler tagged it with $:/tags/Macro
  3. Put the below script as its text
\define list-range(filter, lower, upper)
<$list filter=<<__filter__>>  counter=n>
<$list filter="""
 :intersection[<n>compare:integer:lteq[$upper$]]""" variable=null> 
<$text text={{{ [<n>pad[3]addsuffix[. ]] }}}/><$link/><br>
  1. Save


Display output 10-20 of tiddlers tagged with [tag[Filter Operators]] and sorted by title.

  1. Create a new tiddler
  2. Call list-range as below
<<list-range filter:"[tag[Filter Operators]sort[title]]" lower:10 upper:20>>


  1. append Operator
  2. asin Operator
  3. atan Operator
  4. atan2 Operator
  5. average Operator
  6. backlinks Operator
  7. before Operator
  8. bf Operator
  9. butfirst Operator
  10. butlast Operator
  11. ceil Operator


  1. Propose other simple filters
  2. Produce the result using one $list widget

Instead of lb and rb, make the parameters (attributes) more meaningful.

Other than that, cool macro! :medal_sports:

The original post updated to address @CodaCoder comment.

lb → lower (bound)
rb → upper (bound)

1 Like