~ehmry/freedesktop_org

Nim library implementation of some Freedesktop.org standards
*.nimble: swap nim:bin key and value
Replace Nimble with CycloneDX

clone

read-only
https://git.sr.ht/~ehmry/freedesktop_org
read/write
git@git.sr.ht:~ehmry/freedesktop_org

You can also use your local clone with git send-email.

#freedesktop_org

Some Nim procedures for looking up freedesktop.org data.

#Samples

let path = "freedesktop_org.html"

let exec = defaultApplicationExec("text/html", path)
assert exec == @["firefox freedesktop_org.html"]

assert mimeTypeOf(path) == @["text/html", "application/xhtml+xml"]

let data = newStringStream(readFile path)
assert mimeTypeOf(data) == @["application/xhtml+xml", "text/html", "application/xml"]

#Alternatives

#Filetype

The filetype library also provides MIME type detection but ships with its own heuristics. This makes it work without relying on system MIME database but the standard freedesktop.org.xml file already comes with more MIME types than provided by the filetype library.

#std/mimetypes

The Nim standard library has a library with Mime-type to filename-extension mappings but is also not extensible at runtime.

#Acknowledgment

This library was initially written as part of the ERIS standardization project. As such this library was indirectly funded by NGI Assure, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program.

NGIAssure

Do not follow this link