Brainstorming Media Types for T/Foswiki TML WikiText


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.


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.

Content MIME-Type
WikiSyntax text/x-foswiki
WikiSyntax + Un-expanded %MACROs application/x-foswiki

  • 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: Ancient (stalled, inconclusive) discussions on this problem:


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:

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

BasicForm edit

TopicClassification BrainStorming
TopicSummary What MIME types are other wikis using? What should Foswiki use?
InterestedParties PaulHarvey
Topic revision: r5 - 02 Feb 2012, PaulHarvey
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy