Brainstorming Media Types for T/Foswiki TML WikiText
Motivation
Having a media-type for Foswiki TML markup is useful:
- ... if we wanted to allow HTTP Content-negotiating for the un-(HTML)-rendered TML version of a page. An HTTP client simply sets an
Accept: text/x-foswiki
header
- ... so we can treat Foswiki TML the same way as any other MIME-typeable content, Eg:
- "Typed topics" so we could store things other than TML in them:
%TOPICINFO{contenttype="text/x-foswiki"}%
vs %TOPICINFO{contenttype="image/svg+xml"}%
- Return an
Content-Type: text/x-foswiki
header if returning a purely TML response
- Foswiki::Render might one day care about (and know how to render) multiple media types, of which Foswiki's TML should be one.
Documentation
text/wiki
isn't officially an IANA registered MIME/Media Type type. Indeed, stuff that requires lots of processing to really understand properly (some Foswiki pages do look like line noise!) should probably be in
application/*
rather than
text/*
.
So,
RFC:4288 outlines how media types should work.
Proposal:
Content |
MIME-Type |
WikiSyntax |
text/x-foswiki |
WikiSyntax + Un-expanded %MACROs |
application/x-foswiki |
Alternatives:
-
text/x-wiki.tml
, text/x-wiki.tml+foswiki
, text/x-wiki.tml+twiki
-
text/vnd.foswiki.tml
registered with IANA, or
-
text/x-tml+foswiki
-
text/x-wiki+foswiki
-
text/x-wiki+tml; variant=foswiki
vs text/x-wiki+tml; variant=twiki
What MIME types are other wikis using? What should Foswiki use?
Other wikis/markups:
- MoinMoin seems to have code for (and discussion of):
-
text/x.moin.wiki
-
text/wiki
-
text/moin-wiki
-
text/x.moin.creole
- SocialTextcurrently uses
- A quick IRC survey on #mediawiki revealed little, except that developers there thought they were using text/x-wiki (or ought to be). Then TimStarling chimed in saying that getting
text/wiki
officially registered with IANA was impossible, so everybody should be using text/vnd.foo.wiki
- A quick IRC survey on #xwiki revealed little, except that
text/wiki+xwiki
seemed plausible
- TikiWiki's (apparently stalled) IETF RFC wanted to define a syntax which would use
text/wiki
- Markdown discussion:
-
text/x-markdown
-
text/vnd.daringfireball.markdown
- this message mentions that IANA has an online form which supposedly makes
text/vnd.vendor.foo
registrations a lot easier than text/foo
, but is still non-trivial.
- this message reminds us that the purpose of a
type/subtype
string is to avoid two different communities sharing the same media type for different content; and also questions whether a text/vnd.vendor.foo
registration is at all of any more value than an text/x-foo
experimental type, other than 'IANA-compliant smugness'.
- CPAN-API
-
text/x-pod
-
text/x-markdown
- JSPWiki mentions
-
text/x-wiki.jspwiki
-
text/x-wiki.creole
- TRAC hacks mentions in their WikiCreoleRendererPlugin
Ancient (stalled, inconclusive) discussions on this problem:
Discussion
Added markdown notes, re-arranged preference for
text/x-foswiki
See also:
this post telling us to give up on creating yet-another-obscure-media-type.
Well, maybe not us specifically, but the so-called 'RESTful' crowd anyway.
As for the RESTful crowd:
http://www.innoq.com/blog/stilkov/2011/12/media-types/
--
PaulHarvey - 01 Feb 2012
Macro-expanded TML is a superset of HTML, so an
Accept
header of
text/html,text/x-foswiki
makes perfect sense and avoids conflict with (tm)wiki. Logically
application/x-foswiki
also makes sense. Whether the
x-
prefix or
vnd
prefix applies seems to me to be a bit random.
--
CrawfordCurrie - 01 Feb 2012
I think you're supposed to register
vnd.*
properly, and that's supposed to be rather easy, but perhaps "easy" is relative to getting a new subtype registered (which is almost less painful than having your teeth extracted, but not quite)
--
PaulHarvey - 02 Feb 2012