One easy way to add “comments” to filter expressions is to add them as filter runs with the :except
prefix.
-[[This is a comment. It is technically a filter run.]]
The above will have no impact on the filter expression, unless you had the title “This is a comment. It is technically a filter run.” in the outputs from your previous filter runs, which is highly unlikely.
[tag[spam]] -[[Only get titles shorter than 8 characters]] :filter[length[]compare:integer:lt[8]]
There is an obvious problem: it doesn’t look like a comment because of all the [[]]
!!
So another way I came up with was using the quote syntax. Did you know that "this filter run"
is equivalent to [[this filter run]]
?
So the above can be written as:
[tag[spam]] -"Only get titles shorter than 8 characters" :filter[length[]compare:integer:lt[8]]
If you’d like to make it even more distinct, you could always add your own “syntax” (conventions/style) inside the quotes.
[tag[spam]] -" /* Only get titles shorter than 8 characters */ " :filter[length[]compare:integer:lt[8]]
[tag[spam]] -" <!-- Only get titles shorter than 8 characters --> " :filter[length[]compare:integer:lt[8]]
[tag[spam]] -" ###Only get titles shorter than 8 characters### " :filter[length[]compare:integer:lt[8]]
And if, on principle, you’d like to eliminate all possibility of the comment affecting the filter results due to the exact same text being the in the output of the previous filter runs (even though this would never happen except deliberately), you can switch the prefix to =
(to avoid affecting the previous results through dominant appending) and add +[butlast[]]
to remove your comment from the results.
[tag[spam]] =" ###Only get titles shorter than 8 characters### " +[butlast[]] :filter[length[]compare:integer:lt[8]]