Extract quotes with dataview

What I’m trying to do

I try to extract all the quotes from my notes. They are in this format:

“The quotation …”, author, source.
I’d like to be able to display them in table form, with a quotation column, another source and another author.

I think this can be solved with dataview’s regexmatch function, or extract

To achieve something like this you’ll need to parse the entire file using javascript, split into separate lines and then match against your pattern.

I’d strongly consider changing to some format which would be easier to locate. Like list/task items, with either dedicated tags or custom status. The author/source could then be inline fields readily available for processing through tools such as the Dataview plugin.

I had a setup along the following lines for a while - this might help suggest something suits you:

EXAMPLE QUOTATION FILE (1 file per quotation)

quote: Ignorance more frequently begets confidence than does knowledge.
source: Charles Darwin

> `=this.quote`

– **`=this.source`**

The last two lines display the quote and source when the YAML is hidden using preview mode.


list without id 
	 "[[" + file.name + "|" + truncate(quote,75) + "]]" + "<br />" + 
	"&nbsp; &nbsp; – " + source + "<br />" + "<br />"
from "Collections/Quotes"

This could be simplified a lot.

1 Like