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

Support gemini mime inference #36

Closed
Tim-ats-d opened this issue Dec 30, 2022 · 1 comment
Closed

Support gemini mime inference #36

Tim-ats-d opened this issue Dec 30, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@Tim-ats-d
Copy link
Member

Add support for .gmi file mime inference in Mehari.from_filename.

@Tim-ats-d Tim-ats-d added the enhancement New feature or request label Dec 30, 2022
@Tim-ats-d
Copy link
Member Author

Inferring gemini mime type from files with extension .gmi would make Mehari.from_filename semantics too complex. Adding an optional lang parameter used only in the case of a file containing Gemtext is questionable. It is better to implement a wrapper around this function on the user side, e.g.

let guess_from_filename ?lang ?charset fname =
  if String.ends_with ~suffix:".gmi" fname then
    Mehari.gemini ?lang ?charset ()
  else
    Mehari.from_filename ?charset fname

Tim-ats-d added a commit that referenced this issue Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant