Hi All,
I have callouts for different quotes in my different notes. They are using >[!quote] as callout syntax. I am trying to build a quotebook which can search through all my notes and list them in one place using dataviewjs.
script that i have been trying after some searching :
// You can update this to filter as you like - filtering for just your daily notes would be good
const pages = dv.pages()
// This regex will find the contents of a specifically formatted callout
// const regex = /\n```ad-(\w+)\r?\ntitle:(.+?)\r?\n(\*.+?)```/
const regex = />\s\[\!quote\]\s(.+?)((\n>\s.*?)*)\n/
const rows = []
for (const page of pages) {
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', 'Link'], rows)
But when I do that, I only see 3 quotes from 1 note file and nothing from others.
Could you please suggest what might be going wrong.
Here is what I see as result but only from 1 note file.