1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 18:10:27 +00:00

Conditional shortcut docs: highlight use of "condition" variable

This commit is contained in:
Jeremy Ruston 2023-11-28 11:51:56 +00:00
parent 3b84088b27
commit 53d493b876

View File

@ -6,6 +6,8 @@ type: text/vnd.tiddlywiki
<<.from-version "5.3.2">> The conditional shortcut syntax provides a convenient way to express if-then-else logic within WikiText. It evaluates a filter and considers the condition to be true if there is at least one result (regardless of the value of that result).
Within an "if" or "elseif" clause, the variable `condition` contains the value of the first result of evaluating the filter condition.
A simple example:
<$macrocall $name='wikitext-example-without-html'
@ -55,7 +57,6 @@ src='\procedure test(animal)
Notes:
* Clauses are parsed in inline mode by default. Force block mode parsing by following the opening `<% if %>`, `<% elseif %>` or `<% else %>` with two line breaks
* Within an "if" or "elseif" clause, the variable `condition` contains the value of the first result of evaluating the filter condition
* Widgets and HTML elements must be within a single conditional clause; it is not possible to start an element in one conditional clause and end it in another
* The conditional shortcut syntax cannot contain pragmas such as procedure definitions