funcmap
The funcmap setting lets you assign your own formatting functions to specific item types
Value
An Object containing zero or more type-specific properties - named after the Zotero item types - and an (optional) DEFAULT
property.
Type-specific properties
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 a function name.
For example, defining funcmap.book
with the value "customBookFormat"
will have the extension use the customBookFormat
function for all items of type book
.
DEFAULT property
If the funcmap.DEFAULT
property is defined, the extension will always fall back on the function it names if no specific function has assigned to an item's type.
>> The extension's built-in metadata template will never be used.
Usage in the extension
When importing an item's data into Roam, the extension will first check the item's type (i.e, its data.itemType
property) and use it to look for the name of the formatting function that should be used to produce Roam blocks.
The extension's query path will check the existence of the following, and use the first defined value :
zoteroRoam_settings.funcmap[itemType]
, which can be used to provide a specific formatting function for a particular item type. See Type-specific properties.zoteroRoam_settings.funcmap.DEFAULT
, which can be used to provide a user-defined default formatting function. See DEFAULT property.The extension's built-in formatting function,
getItemMetadata
.
Examples
Last updated