Choose what a connector does with tags, favorites and pictures

Choose where a service's tags land, whether its favorites become Marfa favorites, and whether a kind such as pictures comes in.

A service often holds more than records: the tags you set, a favorite mark and saved pictures. On the mapping, you choose where the tags land, whether the favorite comes in, and whether a kind such as pictures comes in. Edit a file and save it with marfa plugins mapping set. No command takes a flag for them. Each command needs connectors.manage. Connectors are in alpha: what alpha means.

The examples use a plugin whose bookmark kind brings tags and favorites and whose picture kind ships turned off.

Read what the plugin offers

marfa plugins mapping show <plugin>

A kind shows tags or favorite only if its plugin says it brings them. A kind that doesn't has neither, and a save that names one for it is refused 400 validation_error, naming kinds.<kind>.tags or kinds.<kind>.favorite.

Choose where tags and favorites land

MemberValueWhat it does
tagsmarfaThe service's tags become Marfa tags. This is the default.
tagsnoneThe kind keeps no tags.
tags{ field: <name> }The tags go into a field of the kind's target type, as a list of text.
favoritetrueThe service's favorite becomes Marfa's favorite tag. This is the default.
favoritefalseThe favorite is not carried.

A field that holds tags must be one the kind's target_type declares as an array of string, and the kind's fields must not also fill it, because a field has one writer. If a save leaves out fields, Marfa uses the plugin's default fields without the tags field, so the save isn't refused. If the save's fields fills the tags field, it is refused. Marfa also refuses a field it can't use, naming kinds.<kind>.tags.field, or the entry in fields, naming kinds.<kind>.fields.<field>. For a kind that is off, Marfa checks only the mapping's shape, so its target type needs no such field.

A save is the whole mapping: a kind or member you leave out is stored as its default, even if an earlier save chose otherwise. This keeps the tags in a field and stops favorites:

mapping.yaml
kinds:
  bookmark:
    tags:
      field: keywords
    favorite: false
Terminal
marfa plugins mapping set <plugin> mapping.yaml
saved the mapping of <plugin> at version 1

Turn on a kind a plugin ships off

A plugin can ship a kind turned off, such as one that brings the pictures of a bookmark. Until you save a mapping, marfa plugins mapping show answers enabled: false for it. Set enabled: true to turn it on. A save that leaves the kind out stores the plugin's default, so it stays off.

mapping.yaml
kinds:
  picture:
    enabled: true

What a change leaves alone

Saving a choice changes no item, and choosing another place for tags or turning a choice off removes no tag already on an item. Remove tags you no longer want yourself. A later version of the plugin that changes a kind's default leaves a kind you saved as it was. A change of tags needs no rewrite, which moves items to another type.

On this page