Embed note content in a data view output

What I’m trying to do

I have a daily journaling practice. Part of this is that when I’m writing, I want to be 100% focused on writing. I write a separate note for each day’s journal entry (instead of a daily note) so that there aren’t other distractions like tasks, todos etc.

So far I’ve been putting each journal entry in a separate note under a folder called ‘journal’. Each note is a couple of paragraphs, and the front matter has a tag journal-entry as well as entry-date.

I occasionally like to read and reflect on my journal entries and this is usually better to see in chronological order. To better suit this workflow, I want to create a journal “overview” note where I can scroll through the journal contents in reverse chronological order using dataview.

Things I have tried

My initial plan was to get the file along with the dates using dataview, and render it as a list of ![[ journal/file-name ]] so that it would embed the note contents. But alas. it doesn’t seem to work.

var pages = dv.pages("#journal-entry")
				.map(page => "![[" + page.file.name.toString() + "]]");
dv.list(pages)

What I expect to get: a list of full-embeds of the respective files’ contents. Something that would effectively amount to this:

* ![[journal/2021-04-02]]
* ![[journal/2021-04-01]]

What I get: a list of file names. The “![[” prefix and the “]]” suffix in the dataviewjs snippet seems to have disappeared in the output.

* journal/2021-04-02
* journal/2021-04-01

Is there a limitation with dataview to embed note contents? Is there a better way to achieve what I’m after?

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.