patrickmccallum / mimetype-io

The code for mimetype.io
https://mimetype.io
MIT License
63 stars 13 forks source link

[IMPROVEMENT] Rework mime data #3

Closed patrickmccallum closed 11 months ago

patrickmccallum commented 1 year ago

Just opening an issue for reworking mimeData.json to a different format.

Considering something like a CSV or just a less duplicatey and confusing JSON structure. No urgency.

patrickmccallum commented 11 months ago

Just adding to this, I need a way to specify a mimetype may be another that doesnt also update the other mimetype to point back to it. Many cases where current behaviour would cause confusion, e.g. ISO data.

luckv commented 11 months ago

Do you have a a schema or some type of the mimeData.json? I'd like to help.

patrickmccallum commented 11 months ago

I've updated mimeData to follow the required format of

{
    "name": string, // The type name, also used for URL path 
    "description": string, // Should be markdown
    "furtherReading": [
      {
        "url": string,
        "title": string
      },
    ],
    "links": {
      "deprecates": string[], // Will auto create pages with the same information but flagged as deprecated
      "relatedTo": string[], // Will create links in the footer, no auto-page creation
      "parentOf": string[], // Will auto create pages with the same information but marked with a "prefers x" text
      "alternativeTo": string[] // Will auto create pages with the same information but with no disclaimer
    },
    "fileTypes": string[],
    "notices": {
      "hasNoOfficial": false, // If there is no official mimetype anywhere and just what we see used around the place
      "communityContributed": false, // If this was contributed by the community
      "popularUsage": string | null // If there's a more popularly used tag outside of the official
    }
}

This should solve our mime data problems for now.

luckv commented 11 months ago

Ok