On Fri, 13 Jul 2012, Jeremy Ruston wrote:

Is this a reasonable use of content type parameters? Is TiddlyWeb set
up to deal with parameterised content types?

2: It would make quite a few things in TiddlyWeb much more complex.
TiddlyWeb chooses serializers[1] and renderers[2] based on mime type _not_
on parameters to those mime types (in fact it chops off stuff after
the ";" as irrelevant and uses the mime type as a key in a dict that
maps mime type to function). The assumption is that something which is
text/x-tiddlywiki (for example) will be rendereded by the renderer for
x-tiddlywiki. So it would treat "text/x-tiddlywiki; vocabulary=(tw2)"
and "text/x-tiddlywiki; vocabulary=(tw5)" the same and render and
serialize them with the same tool.

Right, I think under this proposal TiddlyWeb would still only need to
look at the mime type itself to choose the serialiser and renderer.
tw5ikifier can wikify both tw5 and tw2 syntax. The only requirement
would be that TiddlyWeb could pass the content type parameter through
to it.

This still leaves serialization as a problem. Consider the following
situation:

* there exists a recipe containing some tiddlers
* person X wants to GET them presented in a tiddlywiki classic
* person Y wants to GET them presented in a tiddlywiki5

Using existing code, if person X does this:

  curl -H "Accept: text/vnd.tiddlywiki;vocabulary(tw2)" \
     http://example.com/recipes/foo/tiddlers

and person Y does this:

  curl -H "Accept: text/vnd.tiddlywiki;vocabulary(tw5)" \
     http://example.com/recipes/foo/tiddlers

They will _both_ get a classic TiddlyWiki.

The option to get any arbitrary set of tiddlers in any arbitrary
representation is the _core_ of TiddlyWeb, so the above needs to have
the correct behavior.

Options are:

* use explicity mime types[1]
* have a tiddlywiki serialization which talks multiple vocabs,
  essentially being a parent over other serializations
* (something I can't think of yet)

[1] I'll say this a bit more strongly than I did before: Doing
something other than explicit mime types strikes me as opening a can
of complexity and confusion that will have unintended and unexpected
side effects. It is something I really don't want to see. Content
negotiation is already a murky sea of unpredictable behavior and
tooling. If you want to be able to use multiple types of tiddlers in a
way that is most flexible with the most environments, be generic, hew to
the methods and standards that people are already using.

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

--
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