emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Joseph Turner <joseph@ushin.org>
To: emacs-orgmode@gnu.org
Cc: manikulin@gmail.com
Subject: Re: Adding text/org MIME type to jshttp/mime-db
Date: Sat, 03 Aug 2024 10:37:09 -0700	[thread overview]
Message-ID: <875xsh5wze.fsf@ushin.org> (raw)
In-Reply-To: <20dcde53-c4aa-4db6-9143-9e6ea6a62215@gmail.com> (Max Nikulin's message of "Sat, 3 Aug 2024 17:25:38 +0700")

Max Nikulin <manikulin@gmail.com> writes:

> On 02/08/2024 02:55, Joseph Turner wrote:
>> Support for "text/org" in <https://github.com/jshttp/mime-db> would
>> let
>> the Agregore browser (<https://agregore.mauve.moe/>) render Org
>> files.
>> Then hyperdrive.el users could share Org files to be viewed in
>> Agregore.
>> John Kitchin opened a PR back in 2017, which was rejected:
>> https://github.com/jshttp/mime-db/pull/82
>
> I missed it at first, but it was *closed*, but not *rejected*.
>
> <https://github.com/jshttp/mime-db/commit/5797174e5434a8d2978d9fdc13ec6a47ba20a02f>
> 2017-07-25T01:12:28Z
>> Add text/x-org
>> closes #82

Thank you for catching my oversight!!

I dug a little deeper and discovered that the popular NPM packages that
make use of jshttp/mime-db rank the source of each MIME type and discard
duplicates which have lower "preference".  For example, the
jshttp/mime-types utility does this:

  // source preference (least -> most)
  var preference = ['nginx', 'apache', undefined, 'iana']

and then discards duplicate mappings which are of lower preference.

https://github.com/jshttp/mime-types/blob/eca390b71004a70f4551197638c077cdba8cf954/index.js#L155

I think https://github.com/broofa/mime does something similar.

The result is that the two popular NPM utilities for getting a MIME type
from a file extension (see <https://www.npmjs.com/search?q=mime>) ignore
the ".org" -> "text/x-org" mapping in favor of ".org" ->
"application/vnd.lotus-organizer".

> So you can use text/x-org.
>
>> After I posted a comment on the thread, the maintainer responded:
>> 
>>> I would suggest opening a new PR.
>
> I think, text/org may be added as well (without removing of
> text/x-org).

Shall we consider this this after we find a way for these low-preference
mappings to be useful?

> Perhaps a worg page may be created to clarify current state of media
> type for org files. The question is what is the appropriate directory.

I agree that it would be good to track this information in one place so
we don't repeat ourselves ;)

Thanks,

Joseph


  reply	other threads:[~2024-08-03 17:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-01 19:55 Adding text/org MIME type to jshttp/mime-db Joseph Turner
2024-08-02 10:46 ` Max Nikulin
2024-08-03 10:25 ` Max Nikulin
2024-08-03 17:37   ` Joseph Turner [this message]
2024-08-03 18:05     ` Joseph Turner
2024-08-04 10:33     ` Max Nikulin
2024-08-05  3:19       ` Joseph Turner
2024-08-05 10:35         ` Max Nikulin
2024-08-05 19:29           ` Joseph Turner
2024-08-05 18:35     ` Ihor Radchenko
2024-08-09 12:57       ` Joseph Turner
2024-08-10 13:15         ` Ihor Radchenko
2024-08-10 18:46           ` Joseph Turner
2024-08-11 15:05             ` Ihor Radchenko
2024-08-13 19:02               ` Joseph Turner
2024-08-13 19:11                 ` Ihor Radchenko
2024-08-14 15:36                   ` Ihor Radchenko
2024-08-17  1:19                     ` Joseph Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875xsh5wze.fsf@ushin.org \
    --to=joseph@ushin.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=manikulin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).