Modify SetWidget to include use to set global variables. (#7608)

* Modify SetWidget to include use to set global variables.

* Make sample variables easier to read.

* Change text to indicate use of pragma whitespace trim.

* Make compliant with 5.3.1 (?) release
This commit is contained in:
Marxsal 2023-11-21 03:55:54 -08:00 committed by GitHub
parent 1001590326
commit ad9cb8a0a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 1 deletions

View File

@ -1,6 +1,6 @@
caption: set
created: 20131115182700000
modified: 20220523075522407
modified: 20230720174707977
tags: Widgets
title: SetWidget
type: text/vnd.tiddlywiki
@ -120,3 +120,19 @@ src='<$set name="myTiddler" value="HelloThere">
</$set>'/>
<<<
!! Using the Set Widget to Create Global Variables
There are times when it makes sense to use the features of the [[SetWidget]] rather than procedures or functions to create global variables. This can be accomplished by placing the set variable widget in a tiddler that is tagged [[$:/tags/Global|SystemTag: $:/tags/Global]]. If multiple variables are required, the set variable widget can be nested as shown here:
<<<
<div class="doc-example">
```
<$set name="myGlobalVariable" value="I am global">
<$set name="myOtherGlobalVariable" value="I am also a global variable.">
</$set>
</$set>
```
</div>
<<<