[IDEA] Archiving tiddlers, for Projectify users and potentially others

157 views
Skip to first unread message

dieg...@gmail.com

unread,
May 3, 2021, 10:17:48 PM5/3/21
to TiddlyWiki
I work a lot with Nicos excellent Projectify plugin.

As a result, I have a lot of ephemeral tiddlers for my to-dos that once done, are no longer really needed as full tiddlers. I don't need to search them, tag them, etc.

Also, since I use node, I don't really want them cluttering the tiddlers folder, as I frequently go in there and do some searching outside TW.

As a result, I thought about "Archiving" them, or "flattening" them, into a single JSON tiddler for reference.

I came up with the following "Archive" button, which appends all tiddlers tagged with done to an Archive tiddler.

Code:
<$vars archiveTiddlerTitle="Archive"
       todoText=<<jsontiddlers "[tag[done]]" >>
       emptyJSON="[]" linebreak="

">
    <$set name="newArchiveText"
          filter="[<todoText>!match<emptyJSON>]"
          value={{{ [title<archiveTiddlerTitle>get[text]addsuffix<linebreak>addsuffix<todoText>] }}}
          emptyValue={{{ [title<archiveTiddlerTitle>get[text]] }}} >

        <$button>
            <$action-setfield $tiddler=<<archiveTiddlerTitle>>
                              $field="text"
                              $value=<<newArchiveText>> />
            <$action-deletetiddler $filter="[tag[done]]" />           
            Archive!
        </$button>

    </$set>
</$vars>


Some notes:
  • I had to solve an annoying issue with the <<jsontiddlers>> macro that when its empty, returns an "[]", which is actually not empty (is this intended?!)
  • Different archiving batches will just be appended as separate JSON objects, instead of merging everything back into one large JSON object.
  • There is no "unarchive" feature, and building one is probably beyond my abilities (thought might be a good use case for Joshua's JSON Mangler! if I understand it correctly!)

This could be of use for others to "flatten" large tag structures that you're done with and don't need flying around as separate tiddlers.

Your thoughts/suggestions/comments/etc are welcome!

Diego

Hans Huber

unread,
May 4, 2021, 2:55:58 AM5/4/21
to tiddl...@googlegroups.com
Diego

Sounds to me as if KOOKMAs trashbin plugin does exactly what you intend

HH

--
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/d14c93ef-456d-40cf-a51c-698c77c579adn%40googlegroups.com.

TW Tones

unread,
May 4, 2021, 6:57:36 PM5/4/21
to TiddlyWiki
Diego,

Good idea providing "full" archive to Projectify. If packaged perhaps you can "give" it to the author to include.

I want to do something similar with streams, but I need additional logic. I use a naming standard for stream (tiddlers) to hide them behind system tiddlers "$:/", however if one wants to keep them indefinitely and make them accessible, I rename them to non system tiddlers.

Obviously If I am on a tiddler with a lot of stream notes, I may want to archive the whole set but not remove regular tiddlers.

As mentioned by HH Mohamad's trashbin (KOOKMAs) plugin does this already,  I would like to see your solution, mohamads or the recent Basket tool generalised to provide better tiddler to json and back handling.

Just some thoughts
Tones
Reply all
Reply to author
Forward
0 new messages