Menu

Commit [r3345]  Maximize  Restore  History

Refactoring of the known MIME type associations.

This is now configurable, in the `[mimeviewer]` section:
* the `mime_map` list is used for declaring new MIME types
and enumerating associated keywords or file extensions
* additionally, one can set `enscript_modes` and `silvercity_modes`,
which are lists of MIME type, mode and quality ratio associations
for those renderers.

This can be used for:
* assigning extra keywords/file suffixes to an
already known MIME type (#1283)
* adding support to new languages (#2874)
* force usage of Enscript instead of SilverCity
(or vice-versa) by overriding the default quality ratio
* adding extra languages to customized SilverCity (#2198)

Example:
{{{
[mimeviewer]
mime_map = text/x-idl:ice,text/x-dylan:dylan:dyl
enscript_modes = text/x-python:python:5,text/x-dylan:dylan
silvercity_modes = text/x-java:Java:5
}}}

cboos 2006-05-24

changed /trunk/trac/mimeview/api.py
changed /trunk/trac/mimeview/enscript.py
changed /trunk/trac/mimeview/silvercity.py
/trunk/trac/mimeview/api.py Diff Switch to side-by-side view
Loading...
/trunk/trac/mimeview/enscript.py Diff Switch to side-by-side view
Loading...
/trunk/trac/mimeview/silvercity.py Diff Switch to side-by-side view
Loading...
MongoDB Logo MongoDB