Stupid tiddler tricks: the local iframe


I mentioned last time that I use TiddlyWiki as an archive of news articles (among many, many other things) and that my current wiki is a hair over 17 megabytes in size. I also mentioned an older wiki in the progress of being slowly imported and reorganized, but didn’t mention that it’s over 52 MB.

Wikis that size are slow. They aren’t just slow when rendering the missing and orphan lists (which I only use during my daily maitenance anyway and leave alone the rest of the time) – A 50 MB wiki navigates slowly and loads even more slowly. So I really, really want it not to get too much larger, but I don’t want to stop collecting tiddlers…

News articles are the biggest offender – most articles are only a few KB, but some longreads can be hundreds of KB, and I have a few thousand articles and counting. Without some kind of trick to keep those articles’ size under control, my wiki would become tectonically slow and threaten to crash my browser if I ever dared try to open it.

Luckily, there is a trick, the second half of which is replacing the body of an article with this:

<iframe src="FILEADDRESS" width="100%" height="500" scrolling="auto"></iframe>

…obviously, replacing “FILEADDRESS” with a file address, which can be a relative link like “Archives/News/Stupidly Long Longread.html”.

The first half of this trick is creating the file Stupidly Long Longread.html. I have a template saved in my Archives subfolder:

<html>
<head>
<title>
TITLE
</title>
</head>

<body style="background-color:lightblue;">
<p><b>
TITLE
</b></p>

BODY
</body>
</html>

I copy and paste that file, then open it up in a text editor. The paste locations are pretty self-explanatory: “TITLE” will show up at the top of the page and in the browser tabs (if I decide to open the article in a separate tab), and “BODY” is where I paste in the article’s source code.

(The bit about background color could be any style that fits with your wiki’s palette and your tastes. You may not find it necessary, but the default is black text on a transparent background, and if you use a dark palette like I do, It would be unreadable.)

The whole process takes a minute or two, and every time I do it I’ve shrunk my wiki by most of the size of that article, the cumulative effect of which… well, my outdated wiki’s Archives subfolder currently holds 596 files totaling 43.8 MB.

Categories: PiecesTags:

1 comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: