mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-05-01 18:27:13 +00:00
Document the tv-* variables
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
created: 20150220161908000
|
||||
modified: 20150221222104000
|
||||
modified: 20150228134138000
|
||||
title: Core Variables
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The following [[variables|Variables]] are built into ~TiddlyWiki's core:
|
||||
|
||||
<<list-links "[tag[Core Variables]]">>
|
||||
<<list-links "[tag[Core Variables]] -[tag[Configuration Variables]]">>
|
||||
|
||||
The core will also use various configuration variables and macros if you define them:
|
||||
|
||||
<<list-links "[tag[Configuration Variables]]">>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
created: 20150221141507000
|
||||
modified: 20150221144853000
|
||||
modified: 20150228103440000
|
||||
tags: [[transclusion Variable]] [[Variable Examples]]
|
||||
title: transclusion Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This example shows how to distinguish between the sidebar and other environments:
|
||||
|
||||
<$macrocall $name=".example" n="3"
|
||||
<$macrocall $name=".example" n="1"
|
||||
eg="""We are
|
||||
<$list
|
||||
filter="[<transclusion>prefix[{|$:/core/ui/PageTemplate/sidebar|||}]]"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
created: 20150228135051000
|
||||
modified: 20150228135737000
|
||||
tags: [[tv-config-toolbar-class Variable]] [[Variable Examples]]
|
||||
title: tv-config-toolbar-class Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<style>
|
||||
.green-background {
|
||||
background-color: green;
|
||||
fill: white;
|
||||
}
|
||||
</style>
|
||||
|
||||
<$macrocall $name=".example" n="1"
|
||||
eg="""<$set name="tv-config-toolbar-class" value="tc-btn-invisible">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
"""/>
|
||||
|
||||
<$macrocall $name=".example" n="2"
|
||||
eg="""<$set name="tv-config-toolbar-class" value="green-background">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
"""/>
|
||||
|
||||
The `green-background` [[CSS|Cascading Style Sheets]] class is declared in a stylesheet within this tiddler.
|
||||
@@ -0,0 +1,19 @@
|
||||
created: 20150228140420000
|
||||
modified: 20150228141418000
|
||||
tags: [[tv-config-toolbar-icons Variable]] [[Variable Examples]]
|
||||
title: tv-config-toolbar-icons Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$macrocall $name=".example" n="1"
|
||||
eg="""<$set name="tv-config-toolbar-icons" value="no">
|
||||
<$set name="tv-config-toolbar-text" value="yes">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
</$set>
|
||||
"""/>
|
||||
|
||||
<$macrocall $name=".example" n="2"
|
||||
eg="""<$set name="tv-config-toolbar-icons" value="yes">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
"""/>
|
||||
@@ -0,0 +1,17 @@
|
||||
created: 20150228140420000
|
||||
modified: 20150228140516000
|
||||
tags: [[tv-config-toolbar-text Variable]] [[Variable Examples]]
|
||||
title: tv-config-toolbar-text Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$macrocall $name=".example" n="1"
|
||||
eg="""<$set name="tv-config-toolbar-text" value="no">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
"""/>
|
||||
|
||||
<$macrocall $name=".example" n="2"
|
||||
eg="""<$set name="tv-config-toolbar-text" value="yes">
|
||||
{{$:/core/ui/Buttons/new-tiddler}}
|
||||
</$set>
|
||||
"""/>
|
||||
@@ -0,0 +1,11 @@
|
||||
created: 20150228124038000
|
||||
tags: [[tv-get-export-image-link Variable]] [[Variable Examples]]
|
||||
title: tv-get-export-image-link Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This example fetches [[the TiddlyWiki icon|http://www.tiddlywiki.com/favicon.ico]]:
|
||||
|
||||
<$importvariables filter="$:/editions/tw5.com/macro-examples/tv-get-export-image-link">
|
||||
<$codeblock code={{$:/editions/tw5.com/macro-examples/tv-get-export-image-link}}/>
|
||||
<$macrocall $name=".example" n="1" eg="""[img[favicon.ico]]"""/>
|
||||
</$importvariables>
|
||||
@@ -0,0 +1,14 @@
|
||||
created: 20150228115959000
|
||||
modified: 20150228120621000
|
||||
tags: [[tv-wikilink-tooltip Variable]] [[Variable Examples]]
|
||||
title: tv-wikilink-tooltip Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This example shows a way of giving links a tooltip derived from the target tiddler's <<.field caption>> field:
|
||||
|
||||
<$importvariables filter="$:/editions/tw5.com/macro-examples/tv-wikilink-tooltip">
|
||||
<$codeblock code={{$:/editions/tw5.com/macro-examples/tv-wikilink-tooltip}}/>
|
||||
<$macrocall $name=".example" n="1" eg="""Here is a link to [[backlinks Operator]] with a custom tooltip."""/>
|
||||
</$importvariables>
|
||||
|
||||
Here is [[a standard link|HelloThere]] for comparison.
|
||||
@@ -0,0 +1,17 @@
|
||||
created: 20150228103411000
|
||||
modified: 20150228104438000
|
||||
tags: [[tv-wikilinks Variable]] [[Variable Examples]]
|
||||
title: tv-wikilinks Variable (Examples)
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$macrocall $name=".example" n="1"
|
||||
eg="""HelloThere,
|
||||
[[HelloThere]],
|
||||
<$link to="HelloThere">is //this// a link?</$link>"""/>
|
||||
|
||||
<$macrocall $name=".example" n="2"
|
||||
eg="""<$set name="tv-wikilinks" value="no">
|
||||
HelloThere,
|
||||
[[HelloThere]],
|
||||
<$link to="HelloThere">is //this// a link?</$link>
|
||||
</$set>"""/>
|
||||
10
editions/tw5.com/tiddlers/variables/namespace.tid
Normal file
10
editions/tw5.com/tiddlers/variables/namespace.tid
Normal file
@@ -0,0 +1,10 @@
|
||||
created: 20150228132024000
|
||||
modified: 20150228133745000
|
||||
title: namespace Variable
|
||||
tags: Variables [[Core Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: namespace
|
||||
|
||||
The <<.def namespace>> [[variable|Variables]] is used internally by [[HTML|HyperText Markup Language]] widgets to keep track of the correct namespace for the [[DOM|Document Object Model]] elements they generate.
|
||||
|
||||
An `svg` or `math` element supplies a distinct namespace for itself and any child elements it contains.
|
||||
@@ -0,0 +1,12 @@
|
||||
created: 20150228120919000
|
||||
modified: 20150228130407000
|
||||
title: tv-auto-open-on-import Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-auto-open-on-import
|
||||
|
||||
The <<.def tv-auto-open-on-import>> [[variable|Variables]] controls whether the `tm-import-tiddlers` message causes the tiddler [[$:/Import]] (which lists the pending imports) to open in the story river.
|
||||
|
||||
By default, the tiddler is opened. But if this variable has the value <<.value no>>, it isn't.
|
||||
|
||||
An example of setting this variable to <<.value no>> can be found in the upgrade plugin within the [[TiddlyWiki Upgrade Wizard|http://www.tiddlywiki.com/upgrade.html]]. People can drag their wiki files onto the wizard without triggering the normal import display.
|
||||
@@ -0,0 +1,14 @@
|
||||
created: 20150228134732000
|
||||
modified: 20150228135803000
|
||||
title: tv-config-toolbar-class Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-config-toolbar-class
|
||||
|
||||
The <<.def tv-config-toolbar-class>> [[variable|Variables]] controls the value of the [[CSS|Cascading Style Sheets]] `class` attribute on the HTML element for a toolbar button.
|
||||
|
||||
It can be set prior to transcluding such a button.
|
||||
|
||||
In most environments, it defaults to <<.value tc-btn-invisible>>, which removes the button's background colour and border.
|
||||
|
||||
<<.variable-examples "tv-config-toolbar-class">>
|
||||
@@ -0,0 +1,14 @@
|
||||
created: 20150228135910000
|
||||
modified: 20150228141357000
|
||||
title: tv-config-toolbar-icons Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-config-toolbar-icons
|
||||
|
||||
The <<.def tv-config-toolbar-icons>> [[variable|Variables]] controls whether toolbar buttons display icons.
|
||||
|
||||
<<.this-is-toolbar-config-variable $:/config/Toolbar/Icons>>
|
||||
|
||||
<<.variable-examples "tv-config-toolbar-icons">>
|
||||
|
||||
See also <<.vlink tv-config-toolbar-text>>.
|
||||
@@ -0,0 +1,14 @@
|
||||
created: 20150228135910000
|
||||
modified: 20150228141403000
|
||||
title: tv-config-toolbar-text Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-config-toolbar-text
|
||||
|
||||
The <<.def tv-config-toolbar-text>> [[variable|Variables]] controls whether toolbar buttons display text.
|
||||
|
||||
<<.this-is-toolbar-config-variable $:/config/Toolbar/Text>>
|
||||
|
||||
<<.variable-examples "tv-config-toolbar-text">>
|
||||
|
||||
See also <<.vlink tv-config-toolbar-icons>>.
|
||||
@@ -0,0 +1,17 @@
|
||||
created: 20150228122257000
|
||||
modified: 20150228130940000
|
||||
title: tv-get-export-image-link Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-get-export-image-link
|
||||
|
||||
The <<.def tv-get-export-image-link>> [[variable|Variables]] controls the value of the `src` attribute on the HTML `img` element generated by the <<.wlink ImageWidget>> widget when the value of its `source` attribute is not the title of a tiddler.
|
||||
|
||||
The variable should be a [[macro|Macros]] with the following parameter:
|
||||
|
||||
;src
|
||||
: The value of the `source` attribute -- equivalent to the image name specified in <$link to="Images in WikiText">the shorthand syntax</$link> `[img[source]]`
|
||||
|
||||
The ability to override image URIs in this way can be useful when one is using the [[Node.js configuration|TiddlyWiki on Node.js]] to export a static version of a wiki.
|
||||
|
||||
<<.variable-examples "tv-get-export-image-link">>
|
||||
17
editions/tw5.com/tiddlers/variables/tv-get-export-link.tid
Normal file
17
editions/tw5.com/tiddlers/variables/tv-get-export-link.tid
Normal file
@@ -0,0 +1,17 @@
|
||||
created: 20150228114004000
|
||||
modified: 20150228130943000
|
||||
title: tv-get-export-link Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-get-export-link
|
||||
|
||||
The <<.def tv-get-export-link>> [[variable|Variables]] controls the value of the `href` attribute on the HTML `a` element generated by the <<.wlink LinkWidget>> widget.
|
||||
|
||||
<<.this-is-static-link-variable>>
|
||||
|
||||
The variable should be a [[macro|Macros]] with the following parameter:
|
||||
|
||||
;to
|
||||
: The title of the target tiddler of the link, with no escaping
|
||||
|
||||
See also <<.vlink tv-wikilink-template>>. If both that variable and this one exist, this one dominates.
|
||||
15
editions/tw5.com/tiddlers/variables/tv-get-export-path.tid
Normal file
15
editions/tw5.com/tiddlers/variables/tv-get-export-path.tid
Normal file
@@ -0,0 +1,15 @@
|
||||
created: 20150228130131000
|
||||
modified: 20150228131730000
|
||||
title: tv-get-export-path Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-get-export-path
|
||||
|
||||
The <<.def tv-get-export-path>> [[variable|Variables]] specifies the full pathname to which the <<.clink rendertiddlers RenderTiddlersCommand>> [[Node.js|TiddlyWiki on Node.js]] command writes each tiddler.
|
||||
|
||||
The variable should be implemented as a <<.js-macro-link "JavaScript macro">> with the following parameter:
|
||||
|
||||
;title
|
||||
: The title of the tiddler
|
||||
|
||||
If no such macro exists, the tiddlers are written to files whose names are [[percent-encoded|Percent Encoding]], in the command's output folder.
|
||||
23
editions/tw5.com/tiddlers/variables/tv-wikilink-template.tid
Normal file
23
editions/tw5.com/tiddlers/variables/tv-wikilink-template.tid
Normal file
@@ -0,0 +1,23 @@
|
||||
created: 20150228105954000
|
||||
modified: 20150228131300000
|
||||
title: tv-wikilink-template Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-wikilink-template
|
||||
|
||||
The <<.def tv-wikilink-template>> [[variable|Variables]] controls the value of the `href` attribute on the HTML `a` element generated by the <<.wlink LinkWidget>> widget.
|
||||
|
||||
<<.this-is-static-link-variable>>
|
||||
|
||||
The variable is treated as if it was a [[macro|Macros]] with the following parameters:
|
||||
|
||||
;uri_encoded
|
||||
: The title of the target tiddler of the link, but [[percent-encoded|Percent Encoding]]
|
||||
;uri_doubleencoded
|
||||
: The value of the <<.param uri_encoded>> parameter but percent-encoded again, i.e. with its `%` characters further converted to `%25`
|
||||
|
||||
> `\define tv-wikilink-template() ../tiddlers/$uri_encoded$.html`
|
||||
|
||||
The variable defaults to `#$uri_encoded$`.
|
||||
|
||||
See also the <<.vlink tv-get-export-link>> variable, which dominates over this one.
|
||||
12
editions/tw5.com/tiddlers/variables/tv-wikilink-tooltip.tid
Normal file
12
editions/tw5.com/tiddlers/variables/tv-wikilink-tooltip.tid
Normal file
@@ -0,0 +1,12 @@
|
||||
created: 20150228115540000
|
||||
modified: 20150228130451000
|
||||
title: tv-wikilink-tooltip Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-wikilink-tooltip
|
||||
|
||||
The <<.def tv-wikilink-tooltip>> [[variable|Variables]] specifies the default value for the <<.attr tooltip>> attribute of the <<.wlink LinkWidget>> widget.
|
||||
|
||||
It is often defined as a [[macro|Macros]], and its value parsed as inline WikiText.
|
||||
|
||||
<<.variable-examples "tv-wikilink-tooltip">>
|
||||
18
editions/tw5.com/tiddlers/variables/tv-wikilinks.tid
Normal file
18
editions/tw5.com/tiddlers/variables/tv-wikilinks.tid
Normal file
@@ -0,0 +1,18 @@
|
||||
created: 20150228102737000
|
||||
modified: 20150228130415000
|
||||
title: tv-wikilinks Variable
|
||||
tags: Variables [[Core Variables]] [[Configuration Variables]]
|
||||
type: text/vnd.tiddlywiki
|
||||
caption: tv-wikilinks
|
||||
|
||||
The <<.def tv-wikilinks>> [[variable|Variables]] controls the behaviour of the <<.wlink LinkWidget>> widget.
|
||||
|
||||
The widget normally produces a link to a tiddler. But if this variable has the value <<.value no>>, the widget suppresses the link and simply displays the text that would otherwise have served as the link.
|
||||
|
||||
You can suppress links for a whole tiddler by placing the following line at the start of the tiddler's text:
|
||||
|
||||
> `\define tv-wikilinks() no`
|
||||
|
||||
This variable has no effect on external links, as those do not involve the <<.wid link>> widget.
|
||||
|
||||
<<.variable-examples "tv-wikilinks">>
|
||||
Reference in New Issue
Block a user