1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-10 12:46:39 +00:00

Docs update for startup actions

This commit is contained in:
Jermolene 2018-03-23 11:48:48 +00:00
parent 44a7ca7e43
commit b7746b0c55

View File

@ -10,7 +10,7 @@ During startup, TiddlyWiki executes any ActionWidgets found in tiddlers with the
* <<tag "$:/tags/StartupAction/Browser">> (only executed when running in the browser)
* <<tag "$:/tags/StartupAction/Node">> (only executed when running under Node.js)
For example, the following action widgets when placed in a tiddler tagged <<tag "$:/tags/StartupAction/Browser">> will cause the sidebar to be hidden by default when the screen width is less than 1000 pixels:
Startup actions are useful for customising TiddlyWiki according to environmental factors such as the screen size. For example, the following action widgets when placed in a tiddler tagged <<tag "$:/tags/StartupAction/Browser">> will cause the sidebar to be hidden by default when the screen width is less than 1000 pixels:
```
<$reveal type="lt" state="$:/info/browser/screen/width" text="3000">
@ -21,3 +21,11 @@ For example, the following action widgets when placed in a tiddler tagged <<tag
<$action-setfield $tiddler="$:/state/sidebar" $value="yes"/>
</$reveal>
```
Note that global macros are not available within startup action tiddlers by default. If you need to access them then you'll need to explicitly include them:
```
<$importvariables filter="[[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
...actions that depend upon global macros...
</$importvariables>
```