Export tiddlers as Zip file (from single HTML)

189 views
Skip to first unread message

bimlas

unread,
Jul 28, 2020, 5:37:07 AM7/28/20
to TiddlyWiki
Dear all,

Before switching to a new note-taking program, we want to make sure that if we don't like it, we can easily export our notes from it. In TiddlyWiki, we have the option to bulk export in Advanced Search -> Filter, but there is no option to return our notes as separate text files (just as Node.js saves them).

In TiddlyWiki prerelease, the JSZip plugin can create a Zip archive from multiple tiddlers. Combining this with the existing ".tid file" exporter template becomes a bulk tiddler exporter.

I have attached a demo version, import it into the https://tiddlywiki.com/prerelease/ , go to $:/AdvancedSearch -> Filter and write a custom filter expression into the entry ("[!is[system]search[hello]limit[5]]" for example without quotes).

ATTENTION! Don’t export too many tiddlers at once because the TiddlyWiki window will not respond to anything until the export is complete.
Export_tiddlers_as_Zip_file.json

Saq Imtiaz

unread,
Jul 28, 2020, 5:51:47 AM7/28/20
to TiddlyWiki
Cool stuff Bimlas, thanks for sharing.

If I can find the time I'd like to work on a epub exporter based on the JSZip plugin as well.
I would be extremely happy if someone else beat me to it!

Mark S.

unread,
Jul 28, 2020, 9:55:12 AM7/28/20
to TiddlyWiki
NotoWritey uses  zip backup this way as well.


TW Tones

unread,
Jul 28, 2020, 8:46:52 PM7/28/20
to TiddlyWiki
Bimlas et al.

Thanks for sharing this. It does open some new workflow possibilities. I have being playing with the zip possibilities a little as well.
  • I attached a Favicons SVG you may want to use.
Some other thoughts;
  • To make it universal perhaps a zip to .txt files option even if the content is the same as tids, may be reassuring to some, given tids are a "tiddlywiki" file.
Some play with your solution
  • I just exported [haschanged]] filter which may be good for a progressive safety backup when making risky edits. 
    • The advantage being you can edit the "problem" tiddler in an external editor  (after expanding the zip)  and drag and drop to return it. 
    • A lot easier than looking for the offending tiddler in a json file.
    • Allows you to drag different zip bundles of changes back to the wiki and save them for history if needed
  • Extracting tiddlers in the zip to the local file system generates files with the same time stamp, so subsequent edits are obvious.
  • The fact one can preview the contents of a zip file before installing means packages of tiddlers can reviewed before dropping on a wiki (eg readme)
The Zip facility as a whole. 
  • I can drop any zip on the wiki, then export that zip and unzip making tiddlywiki the transport or zip publishing mechanism
    • In fact since a zip can contain anything including executable and transport or publishing.
  • It would be nice if we can add a path to files names inside the zip
  • Would it not be marvellous if we can now use a mailto with the zip file attached.
Next;
  • [selectively] Extracting tiddlers from the Zip "in wiki".
    • add adding a prefix as I do so.
Regards
TW Tones
$ _images_fa5_regular_file-archive.tid

TW Tones

unread,
Jul 28, 2020, 9:51:11 PM7/28/20
to TiddlyWiki
Bimlas et al...

I am correct in thinking we do not have a method to unzip a wiki within tiddlywiki?

  • Perhaps if it could do so and place the files into the import mechanism for selective import, but I am not so sure how we would handle non tid and non json files.
  • I wonder if the zip tool could create tiddlers that display the zips readme.txt if it exists, in the tiddler view so some metadata is present.
Food for thought

Regards
Tony


On Tuesday, July 28, 2020 at 7:37:07 PM UTC+10, bimlas wrote:

bimlas

unread,
Jul 30, 2020, 3:19:57 AM7/30/20
to TiddlyWiki
Saq,

So far, I didn't know exactly what the EPUB format is, but it's very useful: since it's much smaller than PDF, it could be preferred to PDF documents embedded in TiddlyWiki, but unfortunately Tiddly can't display it. I'm almost sure I'm going to write a plugin for this. Exporting EPUB doesn’t seem like a complicated task, I’ll see what I can do for the cause.

Tip: LibreOffice can export to this format, so if you want to save a webpage to include in your notes as a reference, copy that part of the webpage, paste it into LibreOffice and export it as an EPUB file.

Saq Imtiaz

unread,
Jul 30, 2020, 4:50:05 AM7/30/20
to TiddlyWiki
@bimlas I will be very happy if you find the time to work on this. 

Epub also offers a far better reading experience on mobile devices, including text scaling and reflow, which is why we use it at work for distributing information to field health care workers in rural areas.

The library used by the JSZip plugin can also be used to read zip files, so we could use that for an epub import/reader as well: https://stuk.github.io/jszip/documentation/howto/read_zip.html

Cheers,
Saq

TW Tones

unread,
Jul 30, 2020, 8:21:03 AM7/30/20
to TiddlyWiki
Bimlas,

I do recall some discussion of EPUB before so do research "tiddlywiki epub" a little before you go too far.

Saq,

I was looking for the import zip feature today. Alas not yet.

I almost Have my library creation zip, which is a more detailed version of the Original Post.

Regards
TW TOnes

TiddlyTweeter

unread,
Jul 30, 2020, 12:05:17 PM7/30/20
to TiddlyWiki
Ciao Bimlas

The e-book edition of TW will import e-pub format. See this for the main post and link:  


Best wishes
TT
Reply all
Reply to author
Forward
0 new messages