reilleya / openMotor

An open-source internal ballistics simulator for rocket motor experimenters
GNU General Public License v3.0
368 stars 73 forks source link

MIME type for saved files? #173

Open petterreinholdtsen opened 3 years ago

petterreinholdtsen commented 3 years ago

Hi. For a GUI file browser on Linux to be able to open the saved files from openmotor, their MIME type need to be listed in the programs desktop file. The mime type should be as specific as possible, and it is an advantage for correctly identifying the files as openmotor files that the magic database of the file(1) tool is able to identify openmotor files as files with this MIME type.

Is there a MIME type identified for use with openmotor?

reilleya commented 3 years ago

No MIME type currently. The files have the extension .ric and contain YAML data. Is that specific enough to make one?

quigleyj97 commented 3 years ago

You can always just decide on an arbitrary one, MIME Types essentially boil down into fancy strings. You might want to sync with the maintainers of your Debian package to settle on a standard one, so they can implement it for Debian.

eg, application/vnd.openmotor

https://en.m.wikipedia.org/wiki/Media_type

On Dec 3, 2020, at 20:28, Andrew Reilley notifications@github.com wrote:



No MIME type currently. The files have the extension .ric and contain YAML data. Is that specific enough to make one?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/reilleya/openMotor/issues/173#issuecomment-738557291, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEBEI646HTMHDFZ6XOUWWT3STBQQNANCNFSM4UHFVKZA.

petterreinholdtsen commented 3 years ago

[Joe Quigley]

You can always just decide on an arbitrary one, MIME Types essentially boil down into fancy strings. You might want to sync with the maintainers of your Debian package to settle on a standard one, so they can implement it for Debian.

eg, application/vnd.openmotor

https://en.m.wikipedia.org/wiki/Media_type

It is also good to register the MIME type with IANA, see <URL: https://www.iana.org/form/media-types >.

As for MIME type string, I agree that it make sense to put it under the vnd tree. I also suspect it make sense to add +yaml at the end to indicate the underlying format, similar to the +xml, +json and +sqlite3 ones already registered with IANA. My quick and dirty proposal would thus be application/vnd.openmotor+yaml or text/vnd.openmotor+yaml.

Registering it early with IANA will avoid the confusion demonstrated in <URL: https://stackoverflow.com/questions/332129/yaml-media-type > about the YAML MIME type, and ensure all users of the software have a shared view on how to handle OpenMotor file MIME types.

Is the charset in these files fixed to UTF-8, or can it vary depending on the users environment?

-- Happy hacking Petter Reinholdtsen

petterreinholdtsen commented 3 years ago

So, anyone willing to decide on a MIME type and stick to it as the official one?

petterreinholdtsen commented 3 years ago

No one chimed in, so I guess no-one care. I thus make random decisions to move this forward. I am implementing application/vnd.openmotor+yaml in the Debian package as the MIME type for OpenMotor .ric files, as a subtype of application/x-yaml.

petterreinholdtsen commented 3 years ago

https://salsa.debian.org/debian/openmotor/-/commit/a60cc434c7d969782fccba00e4f6a7ae018d14a6 and https://salsa.debian.org/debian/openmotor/-/commit/e014c6cd2e9d09cf8d1b38c4b37603247c56a29b add a /usr/lib/mime/packages/openmotor and /usr/share/mime/packages/openmotor.xml to make sure Linux desktop file browsers understand that *.ric files should be handled by openmotor.

reilleya commented 3 years ago

Thank you Petter! I haven't given this project the time it deserves in a while, but I'm happy progress is being made. I hope to finish v0.5.0 before too long.

petterreinholdtsen commented 3 years ago

[Andrew Reilley]

Thank you Petter! I haven't given this project the time it deserves in a while, but I'm happy progress is being made. I hope to finish v0.5.0 before too long.

I am happy to be able to help. But I do hope you will take the time to register the MIME type with IANA, either the one I picked or some other one.

I further hope you will documented the MIME type you pick in the README and elsewhere, to make it more likely every user of the program end up using the same MIME type.

-- Happy hacking Petter Reinholdtsen

petterreinholdtsen commented 2 years ago

Hi. Did you have time to look at this the last year?