On Wednesday, January 8, 2020 at 7:57:42 PM UTC-8, Mohammad wrote:
>
> Tiddlywiki stores global variables in tiddler fields.
> For example all state tiddlers in widgets like reveal, checkbox, 
> edit-text, ...
> Considering both single file wiki and Node.js wiki what are your 
> recommendation in using
>
>    - $:/temp/mytiddlers
>    - $:/state/mytiddlers
>
> Both $:/temp and $:/state are ignored when determining if the document is 
"dirty" (see $:/core/SaverFilter)... and by default both are saved when you 
save the file (except for $:/state/popup, which are NOT saved... see 
$:/core/save/all)

However, conceptually, $:/temp tiddlers should be "throw-away"... able to 
be discarded when not actually in use, while $:/state tiddlers should 
reasonably be expected to persist across sessions.

To enforce this difference, I routinely create a tiddler, tagged with 
$:/tags/Macro, containing:
\define publishFilter() -[prefix[$:/temp]]

This variable is automatically included by the $:/core/save/all filter.  
The effect is that $:/temp tiddlers are NOT saved when you save the file 
and are, in effect, automatically discarded at the end of the session.

Thus, if I want a reveal state to always revert to closed on startup, I 
will use a $:/temp tiddler, but if I want the reveal state to persist 
across sessions, I will use a $:/state tiddler

-e


-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/bba92dd0-d17d-48ba-ac3f-2b6a62a5d258%40googlegroups.com.

Reply via email to