silverbulletmd / silverbullet

The hackable notebook
https://silverbullet.md
MIT License
2.06k stars 146 forks source link

Option in frontmatter to tag all tasks #743

Open henrikx opened 4 months ago

henrikx commented 4 months ago

I'd like to see an option in the frontmatter to set tags that will be applied on all tasks described in the page.

Something like

---
tasktags: tag1 tag2
---

Which will implicitly tag all tasks in the page with #tag1 and #tag2

zefhemel commented 4 months ago

All page tasks are now added to all tasks (and items, and paragraphs and other things) through the itags (inherited tags) attribute, would that not work?

henrikx commented 4 months ago

@zefhemel That sounds like a good solution! However, when I visit a 📌 tag-page, the task section does not contain tasks that have the tag as inherited.

henrikx commented 4 months ago

https://github.com/silverbulletmd/silverbullet/blob/main/plugs/index/tag_page.ts#L34

The query here would need to be edited to get task where "${tagName}" in itags

henrikx commented 4 months ago

@zefhemel I'd be happy to submit a PR, but I am a bit unsure whether we should apply the change to the other queries as well?