1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-27 01:14:44 +00:00

update WidgetVariable documentation

This commit is contained in:
Eucaly 2014-10-03 07:15:06 +08:00
parent d9ccac21d0
commit 52a2d5ade2
4 changed files with 18 additions and 12 deletions

View File

@ -1,5 +1,5 @@
created: 20141002133113496 created: 20141002133113496
modified: 20141002142932824 modified: 20141002230631361
tags: Reference tags: Reference
title: Variables title: Variables
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
@ -11,3 +11,5 @@ You can define your own [[Variables in WikiText]] or use built-in variables.
More detailed information of built-in variables could be found in below: More detailed information of built-in variables could be found in below:
<<list-links "[tag[Variables]]">> <<list-links "[tag[Variables]]">>
See also DumpVariablesMacro

View File

@ -1,11 +1,12 @@
caption: currentTiddler caption: currentTiddler
created: 20141001232824187 created: 20141001232824187
modified: 20141002133837818 modified: 20141002161518301
tags: Variables tags: Variables
title: WidgetVariable: currentTiddler title: WidgetVariable: currentTiddler
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
<<< ! Mechanism
The ''currentTiddler'' variable containes the title of the current tiddler. The ''currentTiddler'' variable containes the title of the current tiddler.
The ListWidget assigns the list result to the ''currentTiddler'' variable, unless the `variable` attribute is specified. The ListWidget assigns the list result to the ''currentTiddler'' variable, unless the `variable` attribute is specified.
@ -13,7 +14,8 @@ The ListWidget assigns the list result to the ''currentTiddler'' variable, unles
A couple of [[Widgets]] and [[Macros]] by default apply to the tiddler according to the ''currentTiddler'' variable. A couple of [[Widgets]] and [[Macros]] by default apply to the tiddler according to the ''currentTiddler'' variable.
The TranscludeWidget (or WikiText `{{||TemplateTitle}}`) transcludes a tiddler without changing the ''currentTiddler'' variable. The TranscludeWidget (or WikiText `{{||TemplateTitle}}`) transcludes a tiddler without changing the ''currentTiddler'' variable.
<<<
! Using currentTiddler Variable
These mechanisms together allow you to write references like `<$view field="title" format="link"/>` in TemplateTiddlers or inside the ListWidget hierarchy without explicitly specifying the tiddler that it applies to. These mechanisms together allow you to write references like `<$view field="title" format="link"/>` in TemplateTiddlers or inside the ListWidget hierarchy without explicitly specifying the tiddler that it applies to.

View File

@ -1,15 +1,16 @@
caption: transclusion caption: transclusion
created: 20141002004621385 created: 20141002004621385
modified: 20141002133923307 modified: 20141002162057822
tags: Variables tags: Variables
title: WidgetVariable: transclusion title: WidgetVariable: transclusion
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
! Mechanism
The ''transclusion'' variable is set automatically by the transclude widget to contain a string that identifies the position of the current node within the widget tree. In the sidebar it is set to `{|$:/core/ui/PageTemplate/sidebar|||}` and within the tiddler "HelloThere" in the story river it is set to `{HelloThere|HelloThere|||}`. Each nested level of transclusion appends another curly bracketed list of symbols. The ''transclusion'' variable is set automatically by the transclude widget to contain a string that identifies the position of the current node within the widget tree. In the sidebar it is set to `{|$:/core/ui/PageTemplate/sidebar|||}` and within the tiddler "HelloThere" in the story river it is set to `{HelloThere|HelloThere|||}`. Each nested level of transclusion appends another curly bracketed list of symbols.
The QualifyMacro uses the ''transclusion'' variable to identify the stack of transcluded tiddlers. The QualifyMacro uses the ''transclusion'' variable to identify the stack of transcluded tiddlers.
! Example: ! Example
``` ```
\define mymacro() \define mymacro()

View File

@ -1,11 +1,11 @@
caption: Variables
created: 20141002141231992 created: 20141002141231992
modified: 20141002144153170 modified: 20141002230751664
tags: WikiText tags: WikiText
title: Variables in WikiText title: Variables in WikiText
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
caption: Hard Linebreaks
! Defining Variables
! Defining Variables
Variables contains values defined by [[Widgets]]. Variables contains values defined by [[Widgets]].
Variables are available within the widget that defines them, and the child widgets in the widget tree. Variables are available within the widget that defines them, and the child widgets in the widget tree.
@ -18,10 +18,11 @@ Variables are defined by:
! Using Variables ! Using Variables
Variables are used with: Variables are used in:
* Variable substitution `$(name)$` * Variable substitution `$(name)$`
* Concise shortcut `<<name>>` * Concise shortcut `<<name>>`
* [[Filter expression|Introduction to Filters]] `[operator<variable-operand>]` * [[Filter expression|Introduction to Filters]] `[operator<variable-operand>]`
* Some default behaviors of [[Widgets]]
Built-in [[variables|Variables]] are useful for dynamic WikiText. See also [[currentTiddler|WidgetVariable: currentTiddler]] variable and built-in [[variables|Variables]].