Mime type for .rhtml files
Submitted by Johan Tibell
Assigned to Shared Mime Info group
Description
.rhtml files are used by the Ruby on Rails framework. It's very to other formats that uses HTML with nested code such as .php
Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.
Can you show where this type of files could be used? How would we detect those files? Is there an existing mime-type for those?
I doubt it is possible to detect the mime-type with a fixed look-ahead into the file since you are not guaranteed (and not always likely) to run into both XHTML and Ruby code in a fixed number of steps. The only way I know of is using the file suffix. The mime-type would be useful since IDEs such as RadRails and others that provide syntax highlighting and editing could be registered as handlers for the mime-type. The file itself is used for web templating, i.e. the Ruby code in it is run and replaced by XHTML (much like a PHP file with mixed XHMTL and PHP). I'm not sure if there exist a widely used mime-type yet.
application/x-httpd-eruby is the mime type I've seen usually used, (eruby is a ruby processing system for in-lined code, rails uses a different processor called erb iirc) it's included in /etc/mime.types (mime-support) package in Ubuntu 6.06.
Please follow the instructions at: http://cgit.freedesktop.org/xdg/shared-mime-info/tree/HACKING#n31 for mime-type additions.
New instructions are available at https://gitlab.freedesktop.org/xdg/shared-mime-info/blob/master/HACKING
closed