Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Exclude subtasks #17

Open
harmtemolder opened this issue Apr 16, 2021 · 5 comments
Open

Feature Request: Exclude subtasks #17

harmtemolder opened this issue Apr 16, 2021 · 5 comments

Comments

@harmtemolder
Copy link
Contributor

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
Copy link
Contributor Author

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?

@artk42
Copy link

artk42 commented Jun 17, 2021

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

@harmtemolder
Copy link
Contributor Author

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...

@larslockefeer
Copy link
Owner

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 🙇

@harmtemolder
Copy link
Contributor Author

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

Sure, no worries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants