I made a task list with a sort of reverse multi level grouping #2426
skaramicke
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a lot of different types of tasks in my main vault and I wanted a dynamic overview of them that is primarily grouped by the type of task.
Illustration of the problem
Imagine these two notes:
Note 1:
Project A.md
Note 2:
Project B.md
Overview:
Overview.md
What the code does
The code extracts tasks from all pages in the current note's folder and its subfolders. The tasks are first grouped by the section titles, and then by which note they're from.
Each file header links to which ever section of the note the tasks are in.
The Code
The code goes inside what ever dataviewjs keyword you're using, like this:
The javascript code
Reusing the code
Since I wanted to use the same code in multiple places, for instance in multiple levels of my projects folder tree, I put the code in a template file and include it like so:
That way I can make changes to a single file, instead of 20 or so files.
Visuals
/Projects/Example Overview.md
/Projects/Bike/Bike Overview.md
I'm still figuring out how to make it as readable as possible. I found it easier to find a specific project's tasks when the part of the folder structure that is the same as the previous one is greyed out; but it looks a bit wonky. As the code is written now, I can't know if the first folder has siblings paths anywhere in the tree, so I abandoned the idea of making a nested list of indented headers. Also I couldn't find a good way to indent the
dv.tasklist
itself anyway.Please Feedback!
Any suggestions on how to improve it are very welcome!
A lot of this is naively coded. I've been using dataview for a week. If there are simpler ways of doing this that doesn't sacrifice the features I've outlined, I'm all ears.
Beta Was this translation helpful? Give feedback.
All reactions