You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently List-Items and Tasks are organized by their Indenting Hierarchy.
This is fine when you use Outlining for organizing your Files.
But Outlining is quite restrictive with empty Lines, Tables, Images, Blocks etc.
Therefore some people like me rather use Headings,
which can form an alternative Hierarchy between List Items, even when they are not indented.
It would be nice to have this alternative Hierarchy available in dataview,
preferably even with nested Items, as they are in Tasks and List-Items.
If this is too much of a change or unwanted, it would be helpful
to have at least the nested Headers attached to each List-Item.
I have prepared a possible Pull-Request as a Proof of Concept: master...SpocWeb:obsidian-dataview:master
It adds a new "headings": HeadingCache[] Element to each Task and List-Item
wich contains the XPath of the Headings it is located in.
The code is very efficient. After the Section is determined, which already happens now,
it just continues to go up the Header-List, collecting Headings, until the beginning or it encounters a Heading1,
so it should have no measurable impact.
I was not sure how to serialize() this new headings Element,
therefore I convert it into a List of the Heading-Strings
prepended with '#'s according to the Heading Level.
This is a minimal change which allows me, in a first Step
to group Tasks and Lists by the Headings they are nested in:
Input-File: pbj.md
Peanut Butter and Jelly
Level2
Ingredients
Bread
Marmelade
Peanut Butter
Jelly
anotherHeading2
Instructions
Go hog wild
numbered
Numbered Task 3
unnumbered
Query:
task
where meta(section).subpath
group by headings
Result:
Peanut Butter and Jelly
Ingredients
(4)
Bread
Marmelade
Peanut Butter
Jelly
Peanut Butter and Jelly
Instructions
(1)
Numbered Task 3
The text was updated successfully, but these errors were encountered:
Currently List-Items and Tasks are organized by their Indenting Hierarchy.
This is fine when you use Outlining for organizing your Files.
But Outlining is quite restrictive with empty Lines, Tables, Images, Blocks etc.
Therefore some people like me rather use Headings,
which can form an alternative Hierarchy between List Items, even when they are not indented.
It would be nice to have this alternative Hierarchy available in dataview,
preferably even with nested Items, as they are in Tasks and List-Items.
If this is too much of a change or unwanted, it would be helpful
to have at least the nested Headers attached to each List-Item.
I have prepared a possible Pull-Request as a Proof of Concept:
master...SpocWeb:obsidian-dataview:master
It adds a new
"headings": HeadingCache[]
Element to each Task and List-Itemwich contains the XPath of the Headings it is located in.
The code is very efficient. After the Section is determined, which already happens now,
it just continues to go up the Header-List, collecting Headings, until the beginning or it encounters a
Heading1
,so it should have no measurable impact.
I was not sure how to
serialize()
this newheadings
Element,therefore I convert it into a List of the Heading-Strings
prepended with '#'s according to the Heading Level.
This is a minimal change which allows me, in a first Step
to group Tasks and Lists by the Headings they are nested in:
Input-File: pbj.md
Peanut Butter and Jelly
Level2
Ingredients
anotherHeading2
Instructions
Query:
Result:
Peanut Butter and Jelly
Ingredients
(4)
Peanut Butter and Jelly
Instructions
(1)
The text was updated successfully, but these errors were encountered: