NOTE: The below applies to TiddlyWikis generated by TiddlyWeb, not
TiddlyWiki in general.

On Wed, 14 Jul 2010, rakugo wrote:

In the case of an image, I would therefore expect the content of that
tiddler to be the data representing that image.
A data uri, as in the example contains the mime-type, so the type
field seems a bit redundant as a result (as you can extract it from
the data).

In the latest release of TiddlyWebWiki, the above is effectively what
we have done. The choice to do it that way basically comes down to one
thing: it's simple and predictable.

Tiddlers are packaged in the generated tiddlywiki file in one of three
ways:

* they are a "normal" tiddler, meaning they have no special
  content-type and are packaged as you would expect: wikitext
  inside the div.

* they are a pseudo-binary tiddler: The text inside the div is a
  textual representation of some non wikitext format, such as
  image/svg+xml. There is a server.content-type attribute which has
  the relevant mime type of the content.

* they are a binary tiddler: The text inside the div is a base64
  encoded representation of a non-textual thing, such as image/png.
  There is a server.content-type attribute which has the relevant mime
  type of the content.

server.content-type is being used for the time being until there is
some consensus on where the type information should go.

FND created a plugin called BinaryTiddlersPlugin which does the bare
minimum basics of properly rendering base64 stuff into either img or
anchor tags with data uris. Beyond the basics is the realm of
additional plugins.

You'll note some caveats with all this:

* _Any_ binary content is sent out with the TiddlyWiki. This means
  that if for some reason there is a 1GB movie tiddler on the server,
  and you ask for it in a TiddlyWiki, you'll get a giant tiddler in
  your TiddlyWiki.

* For the time being data:uris are being used. Some browsers don't
  support them. Some browsers limit the amount of data that can be in
  them.

* Because of changes in TiddlyWeb with how "binary" and
  "pseudo-binary" are distinguished on the server, some tiddlers may
  be base64 when they should be text.

We'll let this stuff ride for a while and adjust as feedback happens.

I can predict one thing that might need to happen is that sending the
binary content may be a configuration option. If it is not set, then
do links as before.

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

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to