new-computers / arena-toolkit

Access to tools
MIT License
23 stars 4 forks source link

Config Files #2

Open callil opened 6 years ago

callil commented 6 years ago

Each tool should have to define a content type it is available for. For instance, print-arena should only be invoked on channels.

for instance:

  "name": "Print Are.na",
  "version": "0.1.0",
  "description": "Generate a PDF from your channels",
  "contentTypes": ["channels"]

or something to this effect. Then this can get used here maybe?

config = require 'configuration.json'
newTool( 'arena_toolkit_music' ,  config);
g-a-v-i-n commented 6 years ago

I propose we use something like the validator config for this config file:

const config = {
    whitelists: {
      class: ['Attachement', 'Media'],
      providerName: ['YouTube', 'Vimeo', 'SoundCloud'],
      extension: ['mp3', 'flac', 'wav'],
      state: ['available'],
    },
    match: {
      hasLargeImage: block => testImageSize(block),
    },
}

this way the config is extensible with custom match tests