typemap

Specification and examples for user-defined typemap

Value

An Object containing one or more properties named after the Zotero item types.

Each property should be defined as follows :

  • Name : the property name has to follow the Zotero data scheme. An old nomenclature of item types is available here.

  • Value : the property's value should be a string, corresponding to the name of the Roam tag/page to use to categorize the type of the item.

For example, defining typemap.bookSection with the value 'Chapter' will have the extension create a block Type:: [[Chapter]] instead of Type:: [[Book Section]] for items of type bookSection.

Usage in the extension

The utility function zoteroRoam.formatting.getItemType function (which is called in getItemMetadata) looks for an item type's label in zoteroRoam_settings.typemap (if it exists), otherwise it falls back on the extension's default typemap object (zoteroRoam.typemap).

If you've defined your own formatting functions, and never use getItemMetadata, then you probably don't need typemap - unless you're using zoteroRoam.formatting.getItemType in your own functions.

Examples

โœ๏ธ Assigning custom labels for a few item types :

// Other item types will be associated with their label from zoteroRoam.typemap

zoteroRoam_settings = {
    // dataRequests: {...},
    typemap: {
        bookSection: 'Chapter',
        conferencePaper: 'Paper',
        journalArticle: 'Paper'
    }
}

Last updated