From 42a3e31b1bca36c534bd0f64d20435a64d09f5d5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 7 May 2015 19:44:08 +0100 Subject: [PATCH] Tweaks to #1678 --- core/modules/widgets/vars.js | 2 +- editions/prerelease/tiddlers/VarsWidget.tid | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/core/modules/widgets/vars.js b/core/modules/widgets/vars.js index 1e08853e5..ce443aee5 100644 --- a/core/modules/widgets/vars.js +++ b/core/modules/widgets/vars.js @@ -3,7 +3,7 @@ title: $:/core/modules/widgets/vars.js type: application/javascript module-type: widget -This widget allows the user to set multiple variables in one go. +This widget allows multiple variables to be set in one go: ``` \define helloworld() Hello world! diff --git a/editions/prerelease/tiddlers/VarsWidget.tid b/editions/prerelease/tiddlers/VarsWidget.tid index b9f1a62fe..dcb7d5e98 100644 --- a/editions/prerelease/tiddlers/VarsWidget.tid +++ b/editions/prerelease/tiddlers/VarsWidget.tid @@ -6,15 +6,14 @@ caption: vars ! Introduction -The ''vars'' widget allows you to set multiple variables in one go. It thereby reduces code complexity that would arise when setting -many variables using the [[SetWidget]]. +The ''vars'' widget allows multiple variables to be set in one operation. In some situations it can result in simpler code than using the more flexible SetWidget. ! Content and Attributes The content of the `<$vars>` widget is the scope for the value assigned to the variable. |!Attribute |!Description | -|//{attributes not starting with $}// |Each attribute name specifies a variable name. The attribute value is used as variable assignement | +|//{attributes not starting with $}// |Each attribute name specifies a variable name. The attribute value is assigned to the variable | ! Examples @@ -30,7 +29,7 @@ Using the `<$vars>` widget, this situation may be handled in the following way: ``` -In contrast, here is the same example, but using the `<$set>` widget instead: +In contrast, here is the same example using the `<$set>` widget: ``` <$set name="greeting" value="Hi" /> @@ -42,11 +41,10 @@ In contrast, here is the same example, but using the `<$set>` widget instead: ``` - ! Remarks It should be noted that this widget differs from the set widget in the following ways: -* You cannot specify a fallback (also known as "emptyValue") -* You cannot use a filter to produce a conditional variable assignement - +* A fallback (also known as "emptyValue") cannot be specified +* Filters cannot be used to produce a conditional variable assignement +* Variable names must be literal strings