obsidian-tasks icon indicating copy to clipboard operation
obsidian-tasks copied to clipboard

Support custom Task Count message in Tasks query [to remove need for an explanatory heading before the Tasks block]

Open shauncassini opened this issue 1 year ago • 3 comments

⚠️ Please check that this feature request hasn't been suggested before.

  • [X] I searched previous Ideas in Discussions didn't find any similar feature requests.
  • [X] I searched previous Issues didn't find any similar feature requests.
  • [X] I am only requesting a single feature. Multiple changes should be split into individual requests, with links between them.
  • [X] I believe my requested feature will be generally applicable to other users, not just me: it is not uniquely tied to my personal workflow.

🔖 Feature description

Hello! It would be useful to format the task count message displayed at the end of a query.

✔️ Solution

Example syntax for this could be tasks.query.message("%c task%s created"). Here, %c would parse as the count variable and %s would be _ if %c==1 and s otherwise (for plural English words).

Result: 2 tasks created or 1 task created Screenshot from 2023-10-29 13-41-13

This way we don't have to add headers above queries - we can get the context we need from the query message.

❓ Alternatives

No response

📝 Additional Context

No response

shauncassini avatar Oct 29 '23 13:10 shauncassini

Hi @shauncassini,

Thanks very much for the suggestion.

This sentence really makes the intention clear.

This way we don't have to add headers above queries - we can get the context we need from the query message.

This reminded me of #2198. I'll add a comment there....

claremacrae avatar Oct 29 '23 14:10 claremacrae

I've tweaked the summary slightly so the intent is clear when reading the Issues list...

claremacrae avatar Oct 29 '23 14:10 claremacrae

Hi @claremacrae, thanks for the quick response and for tweaking the summary. I'll keep an eye out on this!

shauncassini avatar Oct 29 '23 14:10 shauncassini