-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IDEA] The docs for :then
and :else
filter run prefixes should mention each other
#8933
Comments
May I suggest extending this sentence in the
by this
in which you could link to the :else filter run prefix. |
IMO this sentence is way to long. I did read it 3 times and I do not know what you try to say. May be split it into 3 sentences. -- Can you link to an example? |
Feel free to improve on it. What I am trying to say is that if
then the :else[] filter run would then also be evaluated since its input would be the empty list output by :then. This is probably not what the user wants. By passing its own input in this case, the :then[] filter run prevents the :else[] filter run from being evaluated. This is usually the intended behavior since the preceding run did produce a result and therefore should not trigger the :else[]. I do not know how to make it clearer. If you routinely rely on it for conditional branching within filters you will quickly come to appreciate this behavior. |
I personally have no idea, what you mean. Do you have some examples. The filter syntax is very complex and processing it "by heart" without concrete examples is close to impossible. At least for me. |
Here's an example of a typical usage pattern for me: Suppose you have a checkbox that sets the tiddler $:/state/checkbox-state to either tagged or untagged.
(This is just for illustration. There would probably be better ways to do this.) BTW, what I would really like to see is a suffix to |
If someone ever stumbles upon this thread with the same problem, here is the a
Simply replace the contents of $:/core/modules/filterrunprefixes/then.js with the above. |
Hi @rmunn thank you, the improvements you suggest in the OP would be very helpful. |
I think the docs for the
:then
filter run prefix and the:else
filter run prefix should mention each other. Just a "See also" at the end would be enough; if you're using:then
then you probably want to know about:else
, and vice versa. They're both accessible through clicking the "Named Filter Run Prefix" as well as through many other wikiwalking paths, but these seem like two documentation tiddlers that should really cross-link to each other.Same with the
then
andelse
filter operators: their doc tiddlers should probably have "See alsoelse
" and so on.Finally, while I'm at it, since
:then
mentions thethen
filter operator andthen
also mentions:then
, it would be good forelse
and:else
to mention each other as well.I plan to submit a PR for this soon, though probably not today.
The text was updated successfully, but these errors were encountered: