liamcain / obsidian-creases

👕 Tools for effectively folding markdown sections in Obsidian
MIT License
228 stars 8 forks source link

Vague idea: automatically crease empty dataview results #59

Open antifuchs opened 5 months ago

antifuchs commented 5 months ago

My daily note templates have a "review" section where I have a dataview like the following:

    ```dataview
    TASK FROM "Journal"
    WHERE !completed AND date != date(today)
    GROUP BY date


I'd love for that section to be unfolded if the dataview query has results, and be folded when it doesn't. 

Currently I'm using "Start unfolded" in the creases template behavior setting, which works for the initial creation of the daily note, but if I don't get to review those tasks right at the start of my day, the section is folded and I might not get to remember to review them. 

So I think it would be neat if there was a "conditional crease" that checks if a contained dataview has results, and if so, unfolds the section.