How to add "comments" to filter expressions

There is an idea about using hash # tags, extending your idea <#todo notes> could in fact be a hash tag #todo, the # is something you do not use as a variable, procedure or function so that it always returns nul, but it could be used as an attribute say to a hash tag procedure <<# todo>> that lists all tiddlers containing the hash tag #todo.

  • Observation, hash tags work here :nerd_face:

[Edited] If you place <# message here> or <#hashtag message here> in any non-existing parameter, of any filter operator it will make no difference and the content is not limited much; Only <>[]| cause a problem sometimes;

{{{ [tag[TableOfContents],<# "note" [[to]] [[ ]] {{ }} !>] }}}

Thus for reoccurring or reusable comments you could use #n as discussed above, to save repeating yourself, and if necessary turn it into a visible note;

\procedure #1() all contents below
\function #2() "More notes"

{{{ [tag[TableOfContents],<#1>] }}}

<<#1>>

{{{ [tag[TableOfContents],<#2>] }}}

Show #2: <<#2>>
  • We could even place a condition, eg a verbose switch, in the procedure.
  • Both procedures and functions (filters) offer different opportunities to include other content, that you can only see if used as a stand alone variable.

First idea

How about this:

<<list-links filter:"""
[tag[HelloThere]]  -"/* This is a comment */"

""">>

It is very unlikely to have a tiddler with the title: `/* something here */
BUT if you are still worry about such title then yo may use

<<list-links filter:"""
[tag[HelloThere]]  -"|* This is a comment *|"

""">>

This is the safest, as having pipe | in the title is not allowed. No need for function definition.

Second idea
For those interested in function, when a function does not exist TW ignores it. So,

<<list-links filter:"""
[tag[HelloThere]]  [.\*[I am a strange function and I do not exist]]

""">>
  • Who has a function name like .\*? Nobody :wink:
  • Do you need to define the .\* or the end user has to have .\*? Well NO :wink:
3 Likes