Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider adding opendocument and officedocument templates mime ? #709

Closed
6 of 11 tasks
sly7-7 opened this issue Dec 24, 2024 · 7 comments · Fixed by #710, #712, #713, #714 or #718
Closed
6 of 11 tasks

Consider adding opendocument and officedocument templates mime ? #709

sly7-7 opened this issue Dec 24, 2024 · 7 comments · Fixed by #710, #712, #713, #714 or #718
Labels
enhancement Add new functionality

Comments

@sly7-7
Copy link
Contributor

sly7-7 commented Dec 24, 2024

Description

Hello, at this time, it seems templates from ms office and openoffice/libreoffice templates are considered either application/zip or at best as there document counter parts. So I was wondering if it would be possible to better analyze these files. For example, using mime, it detects these mime types for the following extensions:

I don't know much about mime types or file signatures, so I don't know they are good candidates, neither how to do the detections.

Existing Issue Check

  • I have searched the existing issues and could not find any related to my problem.

File-Type Scope Acknowledgment

  • I understand that file-type detects binary file types and not text or other formats.
@sly7-7 sly7-7 added the enhancement Add new functionality label Dec 24, 2024
@sly7-7
Copy link
Contributor Author

sly7-7 commented Dec 24, 2024

🤔 Reading at the source code, maybe the only thing is to add some mime check here:

function getFileTypeFromMimeType(mimeType) {

I think that's worth a try.

@Borewit
Copy link
Collaborator

Borewit commented Dec 27, 2024

I don't know much about mime types or file signatures, so I don't know they are good candidates, neither how to do the detections.

This is the formal MIME-type registration: https://www.iana.org/assignments/media-types/media-types.xhtml

Many MIME-types which are in use, do unfortunately lack a formal registration at IANA. If that registration is missing, we can base it on the original specification, an RFC, Wikipedia, or any other reference which suggests what the best MIME-type is.

It is required to document where you get it from, for traceability. If someone, has a better suggestion, we can easily trace where the existing type came from, and which one is the best to use.

@sly7-7
Copy link
Contributor Author

sly7-7 commented Dec 27, 2024

Thank you, I was answering in the closed PR.
I've made small searches and found mimetype.io and then also found https://www.iana.org/assignments/media-types/media-types.xhtml#application you just mentioned.
So for the further PRs, I will document/link to these sources in the description (like you did when editing #710).
Also I saw you prefer "Partially resolves" rather than "Related", so I will reference this "meta" issue as you did. (I intentionally used related instead of resolves because I didn't want this issue to be closed on each merge)

@Borewit
Copy link
Collaborator

Borewit commented Jan 3, 2025

@sly7-7 , given you follow the same pattern with previous related PRs, I have no problem if you combine the remaining templates in a combined PR, do you agree @sindresorhus ?

@sly7-7
Copy link
Contributor Author

sly7-7 commented Jan 3, 2025

I'm on vacation, I will do that on Monday if @sindresorhus is ok with that

@sindresorhus
Copy link
Owner

👍

@sly7-7
Copy link
Contributor Author

sly7-7 commented Jan 6, 2025

@Borewit @sindresorhus #718 is ready for review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment