Extension defaults
A summary of the default parameters used by the extension to make API calls to Zotero, and format items in Roam.
About the limit parameter
limit parameterItem formatting in Roam
getItemMetadata
// This is taken directly from the extension's code file
zoteroRoam.formatting.getItemMetadata = function(item) {
let metadata = [];
if (item.data.title) { metadata.push(`Title:: ${item.data.title}`) }; // Title, if available
if (item.data.creators.length > 0) { metadata.push(`Author(s):: ${zoteroRoam.formatting.getCreators(item)}`) }; // Creators list, if available
if (item.data.abstractNote) { metadata.push(`Abstract:: ${item.data.abstractNote}`) }; // Abstract, if available
if (item.data.itemType) { metadata.push(`Type:: [[${zoteroRoam.formatting.getItemType(item)}]]`) }; // Item type, from typemap or zoteroRoam.typemap (fall back on the raw value)
metadata.push(`Publication:: ${ item.data.publicationTitle || item.data.bookTitle || "" }`)
if (item.data.url) { metadata.push(`URL : ${item.data.url}`) };
if (item.data.dateAdded) { metadata.push(`Date Added:: ${zoteroRoam.utils.makeDNP(item.data.dateAdded, {brackets: true})}`) }; // Date added, as Daily Notes Page reference
metadata.push(`Zotero links:: ${zoteroRoam.formatting.getLocalLink(item)}, ${zoteroRoam.formatting.getWebLink(item)}`); // Local + Web links to the item
if (item.data.tags.length > 0) { metadata.push(`Tags:: ${zoteroRoam.formatting.getTags(item)}`) }; // Tags, if any
let children = zoteroRoam.formatting.getItemChildren(item, {pdf_as: "links", notes_as: "formatted"});
if(children.pdfItems){
metadata.push(`PDF links : ${children.pdfItems.join(", ")}`);
}
if(children.notes){
let notesBlock = {string: `[[Notes]]`, children: []};
notesBlock.children.push(...children.notes.flat(1));
metadata.push(notesBlock);
}
return metadata;
}typemap
Last updated