List of MIME types known and handled by a future version of moin. See also: http://www.iana.org/assignments/media-types
Type: text
Our MIME media types should form a hierarchy and we currently use the "x." tree because all this is still rather experimental and in development
MIME standard mandates that subtypes of text use CRLF for line breaks.
Maybe we can later move stuff to "vnd.moin.*".
Subtype: plain
used for uploaded generic text files
Subtype: x.moin.wiki
MoinMoin Wiki format.
- Parameter: revision
- gives moin wiki markup standard revision (== the moin revision supporting it)
- it is still unclear whether and how we can USE the revision parameter (e.g. for migration scripts or parsers), but maybe just having that information is better than not having it
Subtype: x.moin.creole
Wiki format derived from Creole.
Subtype: x.moin.userprofile
MoinMoin user profile (do we need this? there is no data in user profiles currently)
Charset handling
We'll require that our metadata gives mimetype including charset parameter for text type.
If someone uploads a text item, we do:
- decode using the given charset from content-type/metadata (default to ascii if not given)
- if it succeeds, we save to storage (we also store the charset to metadata).
- if it fails, try decode using 'utf-8' - if that succeeds, we save and store charset=utf-8 to metadata
- if above does not succeed, we reject the save. That's the only way to avoid inconsistent metadata and data.
Type: image
Subtype: png etc.
uploaded pictures
Subtype: x.moin.tdraw
MoinMoin twikidraw drawing (*.draw, *.png, *.map) contained in a tar file (*.tdraw)
Type: application
Subtype: x.moin.document (for now x-moin-document)
Highlevel tree-like document format
Type: x-moin
This experimental/unregistered media type is used for internal things that does not fit in the normal categories. They never describe actual data.
Subtype: macro
Describes a macro
- Parameter: name
- Name of the macro.
Subtype: format
Old format names
other
- (other type) an uploaded file
auto detect
using file(1) or magic(5) directly
Implementations in Python:
http://www.demonseed.net/~jp/code/magic.py (hard coded magic)
http://itconnection.ru/pipermail/zopyrus/2002-December/001924.html (reads magic(5) files)
- file(1) comes with an experimental Python binding
requires file(1)/libmagic http://hupp.org/adam/hg/python-magic/
using other means:
images and sound files can be detected with imghdr and sndhdr respectively
the mimetypes library can guess mime type based on the file name (mostly the extension)
1 (00:24) < TheSheep> you should use vendor-specific mime types
2 (00:24) < TheSheep> ones that you can register
3 (00:25) < TheSheep> vnd.moinmoin.wiki and vnd.moinmoin.creole for example
4 (00:26) < TheSheep> http://www.alvestrand.no/pipermail/ietf-types/2009-May/002190.html <-- example registration request
5 (00:26) < TheSheep> you probably want wiki version in the optional parameters
6 (00:26) < TheSheep> and probably encoding