UPDATE: I’ve now published these bookmarklets to http://www.tiddlywiki.com/#TiddlyBookmarklets
So, I’ve been preparing for the release of TiddlyWiki 2.2 and have just run into a niggling little problem that’s ended up triggering something quite fun.
I’m at the point where I’m preparing the content for the new release, taking the existing tiddlywiki.com content, folding in the new beta documentation and making sure that everything is up to date and cross-references. The problem arises because the new release adds a “changecount” extended field to each tiddler. It tracks how many times that tiddler has been modified since it was created or received from a server. Our current build process will propagate an extended attribute like that all the way from me making some minor edit in my local copy of tiddlywiki.com up to publication on the internet. That’s a problem, because we should be distributing tiddlywiki.com with clean content, with no “changecount” field.
Various more or less terrible solutions occurred to me immediately:
- Doing a search and replace in the final index.html file to remove all the “changecount” attributes just before publication
- Modifying the build process to clear out the “changecount” attribute
- Writing a new macro that presents a button that scrubs “changecount” attributes from every tiddler
The problems with these solutions being “tedium”, “not knowing Ruby” and “inappropriateness” respectively. Inappropriateness being that such a macro would have to form part of the standard distribution/build process, and yet it seems rather a hack that shouldn’t really be needed.
I knocked up a couple of proof of concept TiddlyBookmarklets to explore what can be done:
- ScrubTiddlyFields – Strips out all the extended fields from a TiddlyWiki document, including that pesky “changecount” field
- ScrubTiddlyShadows -Restores any overridden shadow tiddlers in the current TiddlyWiki document. Handy when you’ve gone mad with PageTemplate customisations and your TiddlyWiki document won’t display properly
- TiddlyRescue – Strips out the raw content of a TiddlyWiki document and displays it in a new window. Handy when you’ve inadvertently been editing an online version of TiddlyWiki that isn’t letting you save changes in the usual way.
Here’s how to use them:
- Drag one of the links above straight into your browser links bar
- Alternatively, right-click on the links and select “Create favourite” or “Create bookmark”
- Navigate to a TiddlyWiki document such as http://www.tiddlywiki.com/
- Select your new bookmarklet to execute it
UPDATE: Looks like I don’t know enough about WordPress to make the bookmarklet links work properly (thanks Ace_NoOne). I’m fiddling about to try to get them working…