Is it possible to "archive" tiddlers in a single file wiki?

I have a subset of tiddlers that have useful data. They are different compared to the rest of my tiddlers as in that I need them less often, or I might need them in the future. In a more formal way, the probability that I’ll need them in the future is neither 0, nor 1, but it’s closer to 0 than to 1.

The most brutal way to separate them is to export them to another, “archive” wiki, and delete them from the original one.

But if I wanted to keep them in the original wiki, yet make them not show up in filter results, are there any tricks for doing this?

I could tag them all with a special tag, then explicitly exclude them in filters, but this also means I’d have to modify all the already existing filters, and I don’t like this perspective.

There is a way:

  1. Filter them out and export them to a single JSON file.
  2. Delete (brutally) those tiddlers.
  3. MAKE A COPY OF JSON FILE and Rename copy as a TXT file.
  4. Import that TXT file. -It will be one single tiddler. Contents (text field) will be searchable.
  5. Should you want to hide that tiddler, give a title prefixed with: $:/ (as I’m sure you know).

You will have the backup JSON file on your disk. But if you would like to take an additional step of being able to re-export to individual tiddlers from the new single-text archive tiddler you’ve created do this:

  1. Create a cusom JSON (raw text) exporter -see: https://tiddlywiki.com/#Creating%20a%20custom%20export%20format
  2. Follow these steps:
  • Create a tiddler with the following fields:
    – ‘‘tags’’: [[$:/tags/Exporter]]
    – ‘‘description’’: Description of this exporter: JSON (raw text) file
    – ‘‘extension’’: .json)
  • Set the following content:
\define renderContent()
{{{ $(exportFilter)$ ||$:/core/templates/plain-text-tiddler}}}
\end
<<renderContent>>

The variable exportFilter contains a filter defining which tiddlers should be exported.

Try this plugin

https://tiddlywiki.com/static/Trashbin%20by%20Mohammad.html

Cheers
CB

Just rename thoses tiddlers with a $:/archive/ prefix.
They will not be visible in the classical research, and you still can find the with the explorer tab in the more sidebar.

Any $:/ prefix will do the trick as it will be interpreted by Tiddlywiki as a system tiddler.

3 Likes

Nice :+1:

And to rename many tiddlers at once, I guess I can use TW-Commander.

Yes.
And to personalize a bit your wiki, you can create a copy of the explorer tiddler named for example $:/my/MoreSideBar/Archive, tag it with $:/tags/MoreSideBar or $:/tags/SideBar and in the text field type <<tree "$:/archive/">> and you have your own tab listing your archived tiddlers…

$__my_MoreSideBar_Archive.json (185 Bytes)

Enjoy.

2 Likes

(post deleted by author)

I’ve been toying around with designing an archival tool that stores a selection of tiddlers as a set of data tiddlers: https://demo-archivaltool.tiddlyhost.com

It produces results like

1 Like

A great deal of flexibility can be achieved if the archive format uses the same JSON structure as an $:/Import tiddler.

The archive tiddler could have plugin-type="archive". Currently, when this tiddler is viewed it would be presented using the same layout as when viewing a plugin tiddler, but would not actually BE a plugin. To use a different layout, we could add a “ViewTemplateBody” cascade (e.g. “$:/config/ViewTemplateBodyFilters/archive”) with contents:

[field:plugin-type[archive]then[$:/core/ui/ViewTemplate/body/archive]]

The archive tiddler could also be viewed for interactive “unpacking” by setting plugin-type="import". Note that importing from this tiddler overwrites its contents with the TWCore standard “The following tiddlers were imported” output. To avoid destroying the archive, we could just clone it before importing, and then import from the cloned tiddler.

The archive tiddler could also be converted directly to an actual plugin simply by setting plugin-type="plugin". As soon as this field is changed and the tiddler is saved, the contents of the archive will exist as individual shadow tiddlers. As with the “import” process, we could avoid destroying the archive just by cloning it and then changing the plugin-type in the cloned tiddler.

-e

2 Likes

Actualy I did something similar for what I call Data Tiddlers (plugin-type=data). The data tiddlers exist as shadows until intentionally edited, come out of the archive in effect (tiddlers). I also added a tab to the plugins along with plugins/themes designed to handle data tiddlers.

Something I have intended to do for a long time is build a mechanisum to update the data plugin tiddler, in this case the archive tiddler, by writting back all the edited tiddlers into the archive and updating a version. I must admit it seems to have a high cognative demand, so have experimented but not built it yet.

An interesting use would be to

  1. Build a data/archive plugin from filtered or selected tiddlers (option to delete on archive)
    • move or copy tiddlers to archive/data plugin
  2. export a “data/archive” plugin
  3. import it elsewhere,
  4. archive more tiddlers (option to delete on archive)
  5. return to 1 and move onto another wiki

Similarly one could do with this;

  • code and plugins to build a package that would accumulate content from multiple wikis and happily be imported to multiple wikis.
  • One could remove the achive data plugin and reimport only when needed or to archive more tiddlers including updated ones
  • Capture a set of config and interface customisations - config plugin
  • use this to capture changes to a wiki as a reviewer and send to the wiki owner for review and acceptance (include a diff viewer) difference between tiddler and shadows.
    • I have long wanted to provide this as a type of multi-user/contributor method

This is related to Allow control of fieldnames included in JSON and CSV exports Export to tiddler not only download files

Save into a archive/data would also benifit from setting an archive timestamp

[Edited] See example here https://test-data.tiddlyhost.com/

1 Like

This may be the answer JSONUpdate Plugin thanks @CasperBooWisdom

Perhaps a button or two in advanced search filter to trigger packing nominated tiddler into a JSON tiddler (of tiddlers)?

  • Perhaps if set with a plugin type such as plugin or data we can see the tiddlers as shadow tiddlers :thinking: