mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-01-24 03:44:41 +00:00
Compare commits
9 Commits
bind-scrol
...
this-tiddl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
127ffbb078 | ||
|
|
9926e356c9 | ||
|
|
3b794fae7f | ||
|
|
4919b4f239 | ||
|
|
a61d644307 | ||
|
|
09cc3b0b73 | ||
|
|
2a2fd1caa8 | ||
|
|
cf25f57acf | ||
|
|
574b90cf7a |
@@ -279,6 +279,8 @@ TranscludeWidget.prototype.getTransclusionTarget = function() {
|
|||||||
defaultType: this.transcludeType
|
defaultType: this.transcludeType
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Set 'thisTiddler'
|
||||||
|
this.setVariable("thisTiddler",this.transcludeTitle);
|
||||||
// Return the parse tree
|
// Return the parse tree
|
||||||
if(parser) {
|
if(parser) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
29
editions/test/tiddlers/tests/data/this-tiddler/Simple.tid
Normal file
29
editions/test/tiddlers/tests/data/this-tiddler/Simple.tid
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
title: ThisTiddler/Simple
|
||||||
|
description: Simple usage of thisTiddler variable
|
||||||
|
type: text/vnd.tiddlywiki-multiple
|
||||||
|
tags: [[$:/tags/wiki-test-spec]]
|
||||||
|
|
||||||
|
title: Output
|
||||||
|
|
||||||
|
\whitespace trim
|
||||||
|
\import Macro
|
||||||
|
\define print-this-tiddler()
|
||||||
|
<$text text=<<thisTiddler>>/>
|
||||||
|
\end
|
||||||
|
|
||||||
|
(<$text text=<<thisTiddler>>/>)
|
||||||
|
|
||||||
|
(<<print-this-tiddler>>)
|
||||||
|
|
||||||
|
(<<imported-print-this-tiddler>>)
|
||||||
|
|
||||||
|
+
|
||||||
|
title: Macro
|
||||||
|
|
||||||
|
\define imported-print-this-tiddler()
|
||||||
|
<$text text=<<thisTiddler>>/>
|
||||||
|
\end
|
||||||
|
+
|
||||||
|
title: ExpectedResult
|
||||||
|
|
||||||
|
<p>(Output)</p><p>(Output)</p><p>(Output)</p>
|
||||||
@@ -134,7 +134,11 @@ This is an example tiddler. See [[Table-of-Contents Macros (Examples)]].
|
|||||||
</dl>
|
</dl>
|
||||||
<blockquote class="doc-example-result">
|
<blockquote class="doc-example-result">
|
||||||
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
|
<$reveal default="$egvar$" type="match" text="NO-SUCH-VAR">
|
||||||
$eg$
|
|
||||||
|
$$$text/vnd.tiddlywiki
|
||||||
|
$eg$
|
||||||
|
$$$
|
||||||
|
|
||||||
</$reveal>
|
</$reveal>
|
||||||
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
|
<$reveal default="$egvar$" type="nomatch" text="NO-SUCH-VAR">
|
||||||
<<$egvar$>>
|
<<$egvar$>>
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
created: 20230304123606350
|
||||||
|
modified: 20230304124149055
|
||||||
|
tags: [[currentTiddler Variable]] [[Variable Examples]]
|
||||||
|
title: thisTiddler Variable (Examples)
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<$macrocall $name=".example" n="1" eg="""<$text text=<<thisTiddler>>/>"""/>
|
||||||
|
|
||||||
|
<$macrocall $name=".example" n="2" eg="""\define example() <$text text=<<thisTiddler>>/>
|
||||||
|
<<example>>
|
||||||
|
"""/>
|
||||||
12
editions/tw5.com/tiddlers/thisTiddler Variable.tid
Normal file
12
editions/tw5.com/tiddlers/thisTiddler Variable.tid
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
caption: currentTiddler
|
||||||
|
created: 20230304122810114
|
||||||
|
modified: 20230304123557862
|
||||||
|
tags: Variables [[Core Variables]]
|
||||||
|
title: thisTiddler Variable
|
||||||
|
type: text/vnd.tiddlywiki
|
||||||
|
|
||||||
|
<<.from-version "5.3.0">> The <<.def thisTiddler>> [[variable|Variables]] is set by the <<.wlink TranscludeWidget>> widget to contain the title of the tiddler that was transcluded. This means that within a tiddler <<.def thisTiddler>> will contain the title of that tiddler. It is not affected by macros, which means that within a macro <<.def thisTiddler>> will contain the title of the tiddler from which the macro was invoked. Intermediate, nested macro calls are ignored.
|
||||||
|
|
||||||
|
Compare <<.vlink storyTiddler>> and <<.vlink currentTiddler>>.
|
||||||
|
|
||||||
|
<<.variable-examples "thisTiddler">>
|
||||||
Reference in New Issue
Block a user