Pulling tasks from a folder for a daily task list

Things I have tried

I was able to create an unlinked list of tasks from a given directory to drop in a daily note using dataview and some regex. The problem is that the dataview block runs every time the note is opened and refreshes the state of the tasks on the daily page. I’m thinking templater might be the better approach.

What I’m trying to do

I’m trying to roll a non-analog version of the cortex theme system. One folder has notes that contain a handful of daily/weekly habits (format doesn’t matter but we can just say they are tasks) to track. I’d like to get my daily template to scan this folder and create a static set of tasks with no backlinking (e.g. make bed, brush teeth). A separate note will corelate trends, probably using dataview.

I’ve looked on this forum and the github page for templetar but I can’t find any examples of scanning and parsing a folder in templetar. Anyone have any examples that I can start building from?

Have you tried the Tasks plugin my Martin Schenck in the community plugins?

I’ve looked at it but it seems to have the same “limitation” as dataview. It creates a dynamic task list. I’m looking for a way to create a static snapshot of the tasks in another folder when I crank out a daily note.

Agree. Actually, a broader problem. It would be good to have a way to capture as static output (HTML/markdown) any dynamic page, whether from the tasks plaugin, page with tasks or dataview generated content or others.

1 Like

So I’ve found this little bit of Typescript that iterates through each file in the vault

app.metadataCache.getCachedFiles().forEach(filename => { 
        let { tags } = app.metadataCache.getCache(filename)

I could adapt it to filter out anything that’s not in the target directory but that’s… inelegant to say the least. Is there a way to specify a target directory in there? I’ve been coming up short on my search for documentation.

1 Like

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