obsidian-plugin-todo icon indicating copy to clipboard operation
obsidian-plugin-todo copied to clipboard

Feature Request: Exclude subtasks

Open harmtemolder opened this issue 4 years ago • 5 comments

If a parent todo is already in the list, I would like the option to exclude all of its subtasks. So only include top-level todos from my notes.

harmtemolder avatar Apr 16 '21 00:04 harmtemolder

Right now todos are found by a regex on a file’s contents (at TodoParser.ts#L5):

const pattern = /(-|\*) \[(\s|x)?\]\s(.*)/g;

Let me think:

  1. Todos without any leading spaces may always be added, because they don’t have a parent. That’s not so difficult:
    const pattern = /^([-*]) \[([ x])\] (.*)$/gm;
    
  2. Todos with leading spaces may only be added if none of their ancestors is a todo. Is such logic even possible with regex?

harmtemolder avatar Apr 16 '21 02:04 harmtemolder

Right now todos are found by a regex on a file’s contents (at TodoParser.ts#L5):

const pattern = /(-|\*) \[(\s|x)?\]\s(.*)/g;

Let me think:

  1. Todos without any leading spaces may always be added, because they don’t have a parent. That’s not so difficult:
    const pattern = /^([-*]) \[([ x])\] (.*)$/gm;
    
  2. Todos with leading spaces may only be added if none of their ancestors is a todo. Is such logic even possible with regex?

Have you succeeded with this self-modification attempt?

To plugin author: that might be great to put that regex into settings, with some community updated templates provided.

My first concern after start was that as if i do checkbox, that's not always a myown todo. So i would really be happy to split syntax of MD checkboxes with todo with some additional symbol.

Moreover, such an additional symbols might turn out a great shortcuts for tags, e.g.:

  • [ ]+0 = #today
  • [ ]+x = #someday
  • [ ]+N = scheduled + N calendar days etc

artk42 avatar Jun 17 '21 13:06 artk42

Have you succeeded with this self-modification attempt?

I have, to some extent: #19. Not sure if @larslockefeer is active here, but I’d love to help the plugin with this and other pull requests. Maybe I’ll just fork and improve there instead...

harmtemolder avatar Jun 17 '21 18:06 harmtemolder

Hey! I'm a bit occupied at the moment with some personal matters (moving etc.). I'm wrapping that up in the coming month, after which I plan to get back to all activity here. Have ideas for fixes for most of the issue reports and had a cursory look at the PRs but need to do some in-depth reviewing etc. before I can merge.

Does it work for you if I get back to this in July? Thanks 🙇

larslockefeer avatar Jun 18 '21 08:06 larslockefeer

Does it work for you if I get back to this in July?

Sure, no worries

harmtemolder avatar Jun 18 '21 12:06 harmtemolder