notes
The notes setting lets you customize how Zotero notes are processed for Roam import
Last updated
The notes setting lets you customize how Zotero notes are processed for Roam import
Last updated
By default, the extension will call the built-in parser function zoteroRoam.utils.formatItemNotes(...)
, give it as input a nested Array structure (use: 'text'
) where each string element will be a Roam block (elements obtained by splitting the note on split_char: '\n'
).
This replicates the default behavior of v0.5.
However, if you are using the zoteroRoam.formatting.getChildren
utility in your custom metadata formatting function, know that it will now use the settings above to format your notes - instead of always using the extension's built-in.
So, if you change these settings, the output will be modified accordingly without you having to rewrite your function's code ๐
Simply change split_char
to be whatever character you'd like.
Write your function, with the syntax window.myParser = function(notes){...}
, and supply its name as the value for the func
argument. Set the use
parameter as needed :
If you decide to write your own parsing function, know that you'll have to clean all the HTML markup yourself. You can use the utility function zoteroRoam.utils.parseNoteBlock(item){...}
which accepts a block (a string) as input, and returns its cleaned version.
Name
Default value
Description
use
'text'
The type of input that should be received by the formatting function.
Should be either :
'text'
(default) : an Array of Arrays, where each child Array contains the HTML text of all notes - split into blocks based on split_char
'raw'
: an Array of objects, where each object contains all the raw data for a note item, as received by the Zotero API
split_char
'\n'
The character(s) to use to split a note item into Roam blocks.
This is only used if use
is 'text'
.
func
'zoteroRoam.utils.formatItemNotes'
The name of the function to be used to parse notes for import into Roam.
This should be defined in conjunction with use
:
if you're writing a function that parses the HTML content, set use: 'text'
if you're writing a function that makes use of the raw Zotero data for each note, set use: 'raw'
.