I’m starting out my journey with Obsidian. I’ve been using it for 2 weeks and now I would like to create a weekly summary note: a compilation of all my notes created last week.
To do so, I tried to:
link all the main notes (hubs) to the common note e.g. “week123”
create a note with the search query inside:
[[week123]] line:(-"line:")
that supposed to show me all the tagged notes. The problem is that the query simply shows me a list of matched notes. Instead, I would like to:
(a) embed the matched notes (these linked to [[week123]]) into the summary note
(b) expand all the links recursively so that I can see the content of all the linked notes (or at least these directly linked from tagged notes).
I use the Periodic Notes plugin’s Weekly Note feature for this, since it can use a template for weekly notes and expand date math in the templates. Here’s my template:
# {{date:YYYY-\Www}}
%% [[Weekly Review Checklist]] %%
## Review of last week
### Achievement: what was the most significant win last week?
### Habit failure(s)
### Habit success(es)
### Biggest lesson(s) learned last week?
## Preview of this week
### What’s the ultimate goal? Revisit it and rewrite it!
### Overview
%% [[⧉ Projects]] %%
%% [[☰ Projects]] %%
#### What's on your mind?
#### What's on the agenda for this week, in order?
### Vision
#### What lead measures are you tracking right now?
#### Progress goals: what must be done by the end of this week? Why?
#### Ten problems:
> Richard Feynman's "keep problems in your mind and apply the things you encounter to them regularly in order to solve them" trick.
## This week:
![[{{monday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{tuesday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{wednesday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{thursday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{friday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{saturday:YYYYMMDD#dddd MMMM D YYYY}}]]
![[{{sunday:YYYYMMDD#dddd MMMM D YYYY}}]]
You can get a list like that pretty easily with Dataview. Use the following script in a dataview codeblock.
LIST
FROM ""
WHERE date({{date-7d:YYYY-MM-DD}}T23:59) - file.mtime <= dur(24 hours) and date({{date-7d:YYYY-MM-DD}}T23:59) - file.mtime > dur(0 hours)
SORT file.mtime asc
To create an embed of each, though, you’ll have to do that manually. Luckily Templater can help. Once you’ve copied the list generated by the above Dataview script, run the following template with Templater:
<%*
var clipboard = await tp.system.clipboard();
clipboardLines = clipboard.match(/[^\r\n]+/g);
wikilinkList = "## Modified this week\n";
clipboardLines.forEach(element => wikilinkList = wikilinkList + "- ![[" + element + "]]\n");
this.app.workspace.activeLeaf.view.editor.replaceSelection(wikilinkList);
%>