Binary Tiddlers in a TiddlyWebWiki

6 views
Skip to first unread message

rakugo

unread,
Jun 2, 2010, 9:39:28 AM6/2/10
to TiddlyWeb
I notice that TiddlyWebWiki supports binary tiddlers. In that I mean I
can create a tiddler eg. with title Image give it type: Image and
paste its base64 representation into the text and now when ever the
wiki serializer is run when I open the tiddler Image I get the default
tiddler text

<html><img src="http://tiddlyspace.org:8080/recipes/frontpage_public/
tiddlers/Image" /></html>

I think this needs revisiting. This is great until you want to support
things other than svg and I would suggest needs a review.
If I then create a tiddler called SVG with type image/svg+xml I don't
want the above to happen.
eg.
<html><img src="http://tiddlyspace.org:8080/recipes/frontpage_public/
tiddlers/SVG" /></html> is useless to me as I need the text in that
tiddler. Of course I can run some ajax to get hold of the tiddler eg.
make a call to http://tiddlyspace.org:8080/recipes/frontpage_public/tiddlers/SVG.txt
and parse the response, however, the very fact I have included the
file in the recipe suggests that I want access to it from the off
(maybe I want to tear it down and run it offline for instance).
Otherwise I might have put the svg/images files in a bag called svg/
images and referenced them from other tiddlers like <img src='http://
tiddlyspace.org:8080/bags/images/tiddlers/Image'/>

What seems a better approach to me is that the tiddler text should be
the text itself (even if it is base64 in the image case). I would
argue that it is up to plugins (eg. Eric's TaggedTemplateTweak or some
other code) to show the tiddler in the appropriate form. In the image
example above I might want to generate <html><img src="http://
tiddlyspace.org:8080/recipes/frontpage_public/tiddlers/Image" /></
html> in my javascript however feasibly I might also want to do
something magical with the base64 (eg. implement Mike's proof of
concept http://softwareas.com/embedded-images-in-tiddlywiki-under-ie6-via-mhtml-proof-of-concept)

Are there any issues with serving the tiddlers in this way? What are
the historic reasons for this behaviour?

chris...@gmail.com

unread,
Jun 2, 2010, 10:25:45 AM6/2/10
to TiddlyWeb
On Wed, 2 Jun 2010, rakugo wrote:

> I notice that TiddlyWebWiki supports binary tiddlers. In that I mean I
> can create a tiddler eg. with title Image give it type: Image and
> paste its base64 representation into the text and now when ever the
> wiki serializer is run when I open the tiddler Image I get the default
> tiddler text
>
> <html><img src="http://tiddlyspace.org:8080/recipes/frontpage_public/
> tiddlers/Image" /></html>

This is the result of a sort of "fail over to a safe position" thing
that came about when the binary tiddler work first started. At that
time I posted to the twdev mailing list asking if there was a
standard for managing binary content in tiddlers in a tiddlywiki.

The result of that conversation was that there were a few different
ways of doing things, each with benefits for different environments,
each with different impacts on different plugins and presentations.

The current method is a fallback that requires no plugins and,
perhaps more importantly, means you can't break the binary content
by doing an accidental edit.

I agree that it is not useful for lots of situations, but no one in
the TiddlyWiki community has yet come forward with a complete
suggestion on how such content should be managed. When such a
suggestion comes along, and there has been consensus that it is
workable then we can make TiddlyWebWiki hew to the new standard.

> What seems a better approach to me is that the tiddler text should be
> the text itself (even if it is base64 in the image case). I would
> argue that it is up to plugins (eg. Eric's TaggedTemplateTweak or some
> other code) to show the tiddler in the appropriate form. In the image
> example above I might want to generate <html><img src="http://
> tiddlyspace.org:8080/recipes/frontpage_public/tiddlers/Image" /></
> html> in my javascript however feasibly I might also want to do
> something magical with the base64 (eg. implement Mike's proof of
> concept http://softwareas.com/embedded-images-in-tiddlywiki-under-ie6-via-mhtml-proof-of-concept)

This is essentialy what I did originally and it caused several
problems:

* the content didn't show up nicely without additional plugins
* the content was easy to break (via an accidental edit) so it
wouldn't show up nicely

I would prefer that tiddlers (up to a certain style) were delived
with base64 data URI as the tiddler.text and fields containing some
metadata. Plugins, included with TiddlyWebWiki would recognize that
this was a binary tiddler and do the right things with the content:

* if it was image/* render it properly
* if it was some other MIME type do a different kind of link
* disable editing
* optional bonus points: make the plugins extensible so they could
enable editing for those MIME types where an editor plugin exists
in the current wiki.

--
Chris Dent http://burningchrome.com/~cdent/
[...]

rakugo

unread,
Jun 2, 2010, 10:34:01 AM6/2/10
to TiddlyWeb
This sounds like a very good solution.
Jon
> > concepthttp://softwareas.com/embedded-images-in-tiddlywiki-under-ie6-via-mht...)

chris...@gmail.com

unread,
Jun 3, 2010, 5:46:09 AM6/3/10
to TiddlyWeb
On Wed, 2 Jun 2010, rakugo wrote:

> This sounds like a very good solution.

You wanna do the legwork of promulgating it to twdev? The solution
isn't workable unless there's agreement amongst plugin authors for how
to deal with binary content. I know Eric S had some ideas.

Reply all
Reply to author
Forward
0 new messages