Daniel Kinzler | 25 Apr 2012 18:09
Picon
Favicon
Gravatar

Mime-Type for wikitext

Hi all!

I just noticed that MediaWiki uses two different mime types for wikitext:

* application/x-wiki is used by AjaxResponse, OutputPage and StreamFile.
* text/x-wiki is used by RawAction.php (i.e. when you use action=raw)

Is there a good reason for this, or is it just an oversight? I suggest to use
the same mime type everywhere, and keep the old one for compatibility reasons -
i.e. we should use application/x-wiki consistently, and RawAction could support
text/x-wiki as an alias.

That being said... the *correct* mime type would imho be
application/x-mediawiki. But i don't insist on it :)

-- daniel
Brion Vibber | 25 Apr 2012 18:42
Picon

Re: Mime-Type for wikitext

It's a human-readable text format, so I'd advocate for text/x-wiki. I don't know where or how the application/x-wiki came about.

-- brion

On Apr 25, 2012 9:09 AM, "Daniel Kinzler" <daniel <at> brightbyte.de> wrote:
Hi all!

I just noticed that MediaWiki uses two different mime types for wikitext:

* application/x-wiki is used by AjaxResponse, OutputPage and StreamFile.
* text/x-wiki is used by RawAction.php (i.e. when you use action=raw)

Is there a good reason for this, or is it just an oversight? I suggest to use
the same mime type everywhere, and keep the old one for compatibility reasons -
i.e. we should use application/x-wiki consistently, and RawAction could support
text/x-wiki as an alias.

That being said... the *correct* mime type would imho be
application/x-mediawiki. But i don't insist on it :)

-- daniel


_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Gabriel Wicke | 25 Apr 2012 19:07
Favicon

Re: Mime-Type for wikitext

On 04/25/2012 06:42 PM, Brion Vibber wrote:
> It's a human-readable text format, so I'd advocate for text/x-wiki. I
> don't know where or how the application/x-wiki came about.

This was pretty much the reason why I picked it for action=raw back then.

I like Daniel's idea to use something more specific to MediaWiki though.
Maybe text/x-mediawiki?

Gabriel
Brion Vibber | 25 Apr 2012 19:10
Picon

Re: Mime-Type for wikitext

On Wed, Apr 25, 2012 at 10:07 AM, Gabriel Wicke <wicke <at> wikidev.net> wrote:
On 04/25/2012 06:42 PM, Brion Vibber wrote:
> It's a human-readable text format, so I'd advocate for text/x-wiki. I
> don't know where or how the application/x-wiki came about.

This was pretty much the reason why I picked it for action=raw back then.

I like Daniel's idea to use something more specific to MediaWiki though.
Maybe text/x-mediawiki?

I'm down with that. :)

-- brion
_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Daniel Kinzler | 25 Apr 2012 20:33
Picon
Favicon
Gravatar

Re: Mime-Type for wikitext

On 25.04.2012 19:10, Brion Vibber wrote:
> On Wed, Apr 25, 2012 at 10:07 AM, Gabriel Wicke <wicke <at> wikidev.net
> <mailto:wicke <at> wikidev.net>> wrote:
> 
>     On 04/25/2012 06:42 PM, Brion Vibber wrote:
>     > It's a human-readable text format, so I'd advocate for text/x-wiki. I
>     > don't know where or how the application/x-wiki came about.
> 
>     This was pretty much the reason why I picked it for action=raw back then.
> 
>     I like Daniel's idea to use something more specific to MediaWiki though.
>     Maybe text/x-mediawiki?
> 
> 
> I'm down with that. :)

Well... changing the mime type now might break a bunch of clients that rely on
it, no? At least in cases where it's actually used in a ContentType header.

For practical reasons, I suggest to stay with application/x-wiki, and make
action=raw use that too, unless ctype=text/x-wiki. then it should use
text/x-wiki in the ContentType header too.

-- daniel
Brion Vibber | 25 Apr 2012 20:39
Picon

Re: Mime-Type for wikitext



On Wed, Apr 25, 2012 at 11:33 AM, Daniel Kinzler <daniel <at> brightbyte.de> wrote:
On 25.04.2012 19:10, Brion Vibber wrote:
> On Wed, Apr 25, 2012 at 10:07 AM, Gabriel Wicke <wicke <at> wikidev.net
> <mailto:wicke <at> wikidev.net>> wrote:
>
>     On 04/25/2012 06:42 PM, Brion Vibber wrote:
>     > It's a human-readable text format, so I'd advocate for text/x-wiki. I
>     > don't know where or how the application/x-wiki came about.
>
>     This was pretty much the reason why I picked it for action=raw back then.
>
>     I like Daniel's idea to use something more specific to MediaWiki though.
>     Maybe text/x-mediawiki?
>
>
> I'm down with that. :)

Well... changing the mime type now might break a bunch of clients that rely on
it, no? At least in cases where it's actually used in a ContentType header.

For practical reasons, I suggest to stay with application/x-wiki, and make
action=raw use that too, unless ctype=text/x-wiki. then it should use
text/x-wiki in the ContentType header too.

The only one of these that I'm familiar with is text/x-wiki.

How exactly is application/x-wiki used, and by what?

AjaxResponse sounds like one of the obsolete things we want to kill and make sure is replaced with the API.

StreamFile is unlikely to be streaming wikitext on a regular basis, as we don't keep wikitext in files... it seems to be a random thing stuck in as a backup for "unknown" file types to try to avoid triggering the type detection that IE does for application/octet-stream.

I'm not sure what OutputPage would be doing outputting wikitext directly at any time... ah, this is for the Universal Edit Button <link> in the header. That points to an HTML page, and technically probably shouldn't use application/x-wiki. It uses it to say "this is a wiki edit button', and I think got obsoleted by the <link> after it which uses rel=edit instead.

RawPage does in fact return raw wikitext, for which we use text/x-wiki.

-- brion
_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Ori Livneh | 25 Apr 2012 19:10
Picon
Gravatar

Re: Mime-Type for wikitext


On Wednesday, April 25, 2012 at 10:07 AM, Gabriel Wicke wrote:

I like Daniel's idea to use something more specific to MediaWiki though.
Maybe text/x-mediawiki?
Let's register it in the standards tree! 
 
_______________________________________________
Wikitext-l mailing list
Wikitext-l <at> lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitext-l
Amgine | 25 Apr 2012 19:19
Picon

Re: Mime-Type for wikitext

On 25/04/12 10:07 AM, Gabriel Wicke wrote:
> On 04/25/2012 06:42 PM, Brion Vibber wrote:
>> It's a human-readable text format, so I'd advocate for text/x-wiki. I
>> don't know where or how the application/x-wiki came about.
> 
> This was pretty much the reason why I picked it for action=raw back then.
> 
> I like Daniel's idea to use something more specific to MediaWiki though.
> Maybe text/x-mediawiki?
> 
> Gabriel

This implies other text markup formats will be possible. Are there
mimetypes for other markup formats? There seems to be a pseudo standard
for text/x-web-format such as text/x-web-intelligent and
text/x-web-markdown.

Amgine
Daniel Kinzler | 25 Apr 2012 20:39
Picon
Favicon
Gravatar

Re: Mime-Type for wikitext

On 25.04.2012 19:19, Amgine wrote:
> This implies other text markup formats will be possible. Are there
> mimetypes for other markup formats? There seems to be a pseudo standard
> for text/x-web-format such as text/x-web-intelligent and
> text/x-web-markdown.

you mean for other wiki markups? don't know, but i guess there should be :)

hm, have a look here:

* http://meatballwiki.org/wiki/WikiTextMimeType
* http://www.communitywiki.org/cw/WikiMime

-- daniel
Platonides | 25 Apr 2012 19:15
Picon

Re: Mime-Type for wikitext

On 25/04/12 18:09, Daniel Kinzler wrote:
> Hi all!
> 
> I just noticed that MediaWiki uses two different mime types for wikitext:
> 
> * application/x-wiki is used by AjaxResponse, OutputPage and StreamFile.
> * text/x-wiki is used by RawAction.php (i.e. when you use action=raw)
> 
> Is there a good reason for this, or is it just an oversight? I suggest to use
> the same mime type everywhere, and keep the old one for compatibility reasons -
> i.e. we should use application/x-wiki consistently, and RawAction could support
> text/x-wiki as an alias.

I think it's done that way depending if we want it shown in the browser
or not.
On ?action=raw, we want it on the UA, saving would be bothersome, so we
tell it's "text".
On external edit application/x-wiki forces to open an external program
(supposedly a wiki editor). That's probably the reason
application/x-wiki  is used in OutputPage.php for $wgUniversalEditButton

StreamFile has a comment saying we want anything but a content type
known to Internet Explorer.

I don't know if there's a reason for AjaxResponse to use
application/x-wiki. IMHO that should depend on what it's responding!

> That being said... the *correct* mime type would imho be
> application/x-mediawiki. But i don't insist on it :)

Too late :)
Daniel Friesen | 25 Apr 2012 21:28

Re: Mime-Type for wikitext

On Wed, 25 Apr 2012 09:09:31 -0700, Daniel Kinzler <daniel <at> brightbyte.de>  
wrote:

> Hi all!
>
> I just noticed that MediaWiki uses two different mime types for wikitext:
>
> * application/x-wiki is used by AjaxResponse, OutputPage and StreamFile.
> * text/x-wiki is used by RawAction.php (i.e. when you use action=raw)
>
> Is there a good reason for this, or is it just an oversight? I suggest  
> to use
> the same mime type everywhere, and keep the old one for compatibility  
> reasons -
> i.e. we should use application/x-wiki consistently, and RawAction could  
> support
> text/x-wiki as an alias.
>
> That being said... the *correct* mime type would imho be
> application/x-mediawiki. But i don't insist on it :)
>
> -- daniel

text/vnd.mediawiki.wikitext

--

-- 
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

Gmane