[TW5] How to show all modified or created tiddles before saving?

68 views
Skip to first unread message

Siniy-Kit

unread,
Nov 21, 2019, 8:39:27 AM11/21/19
to TiddlyWiki
Hi. I use single-file tiddlywiki.html for making mini-sites (many static pages). I want make static pages only from tiddles I have modified or created before saving. How can i get $list of this kind of tiddlers?

Jeremy Ruston

unread,
Nov 21, 2019, 8:59:49 AM11/21/19
to 'Mark S.' via TiddlyWiki
Hi Siniy-Kit

Hi. I use single-file tiddlywiki.html for making mini-sites (many static pages). I want make static pages only from tiddles I have modified or created before saving. How can i get $list of this kind of tiddlers?

The “haschanged” operator filters tiddlers that have been modified since the wiki was loaded:


So you should be able to use something like [all[tiddlers]haschanged[]] to get a list of changed tiddlers for rendering.

Best wishes

Jeremy



--
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 tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/cf59af1a-ddcc-43c1-a431-49764fb8f4f2%40googlegroups.com.

TonyM

unread,
Nov 22, 2019, 10:44:48 PM11/22/19
to TiddlyWiki
Siniy-kit,

Jeremys suggestion works out of the box, however if you return to the save wiki over a number of days haschenged only reflects what has changed since the last reload. 

but you could add a exported date field and button to click when you publish a static tiddler. It would then be possible to create a custom list of tiddlers who have a modified date greater than the published date. I have done this by editing the current export method (Any export stamps the current tiddler), see below.

I see export uses exportButton macro here $:/core/macros/export and Identified if I add an action I can update tiddlers exported as follows
<$action-setfield $tiddler=<<storyTiddler>> $timestamp="no" $field=exported $value=<<now "YYYY0MM0DD0hh0mm0ss0XXX">> />

Just after 
<$action-sendmessage $message="tm-download-file" ....

Then each tiddler exported (currentTiddler) will have a time date stamp in exported (does not affect the modified time)

A List can then list all tiddlers with a modified date > than the export date, as soon as you export it it leaves the list, if you edit it (but not export it) it [re-]appears in the list.

You could make list show only selected tiddlers with a tag or something else, or only on tiddlers already exported - eg has an exported field. So you have to export it at least once to flag it as a tiddler possibly needing export.

Regards
Tony

TonyM

unread,
Nov 23, 2019, 1:10:18 AM11/23/19
to TiddlyWiki
Post script

Placing the set field before the download action will include the exported date in the downloaded tiddlers e.g. tid or JSON files.

Also I used storyTiddler as an alternative to currentTiddler as currentTiddler is used for another purpose in the export process.

Regards
Tony

Reply all
Reply to author
Forward
0 new messages