mimetype icon indicating copy to clipboard operation
mimetype copied to clipboard

Add support for yaml and markdown file format

Open zuzuviewer opened this issue 1 year ago • 1 comments

  1. Specify the MIME type and extension for which to add support yaml and markdown

  2. Share an example file

  3. Optionally, add a reference to the specification of the file format. yaml markdown

zuzuviewer avatar Jun 10 '23 15:06 zuzuviewer

You can do this:

yamlDetector := func(raw []byte, limit uint32) bool {
	return true
}
mimetype.Lookup("text/plain").Extend(yamlDetector, "text/yaml", ".yaml")
mimetype.Lookup("text/plain").Extend(yamlDetector, "text/yaml", ".yml")

Or something more robust, such as loading the YAML file.

timrulebosch avatar Jul 10 '23 13:07 timrulebosch