What I’m trying to do
I’m trying to use the method described here to pull specific callouts from my daily notes to a table. I have dataview plugin and am using Callout Manager to manage and create my callouts.
Things I have tried
I have tried the steps highlighted in the linked article and am getting this Evaluation Error
here is the code I’m running :
// You can update this to filter as you like - filtering for just your daily notes would be good
const pages = dv.pages("#dailynote")
// This regex will find the contents of a specifically formatted callout
// const regex = /\n```ad-(\w+)\r?\ntitle:(.+?)\r?\n(\*.+?)```/
const regex = />\s\[\!journal\]\s(.+?)((\n>\s.*?)*)\n/
const rows = []
for (const callout of contents.match(new RegExp(regex, 'sg')) || []) {
const file = app.vault.getAbstractFileByPath(page.file.path)
// Read the file contents
const contents = await app.vault.read(file)
// Extract the summary via regex
for (const callout of contents.match(new RegExp(regex, 'sg'))) {
const match = callout.match(new RegExp(regex, 's'))
rows.push([match[1], match[2], page.file.link])
}
}
dv.table(['Term', 'Definition', 'Link'], rows)