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] Add tasks to a todo and add command for reindexing #316

Open
amanger-qual opened this issue May 2, 2024 · 3 comments
Open

Comments

@amanger-qual
Copy link

I'm loving nb and how it's letting me store information in a whole new way! I generally use glow to view the files because the nb show command show the front matter metadata.

I stared using nb to track programming tasks and new notebooks that I need to create; however i found that I can't add a task to a todo without editing the todo file myself. Could a command be introduced to add tasks to todos after the fact? It would also be great if todos indexed separately from notebooks, but maybe it works just fine for everyone else :)

I'd also love to be able to reindex all the nb items. When an item is deleted or moved, I currently need to open up the .index file and manually reorder the lines to get the index value assignment to be sequential and in the order I desire. If there was a command like nb reindex or nb index -r, that would make this a lot easier!

Again, love this project! I'd love to help contribute if I knew more about this kind of development, but my skill set isn't quite there. Hopefully one day soon!

@verajosemanuel
Copy link

same here. Tried to add a TASK to an existing TODO but unable to find how. any hint?

xwmx added a commit that referenced this issue May 22, 2024
@holmescharles
Copy link

I also crave being able to add a task to an existing todo. Right now I have to manually add it to a note via "edit". That's not so bad, but if a todo lacks any tasks at all, I also have to manually add the Tasks section. I wish this was handled for me.

@xwmx
Copy link
Owner

xwmx commented Jun 14, 2024

Glad you like nb!

nb index Subcommand

There is actually an nb index subcommand. It has a couple subcommands that might be useful here. nb index edit is currently only available with the latest development version:

nb index rebuild [--ancestors]
Rebuild the index, listing files by last modified, reversed. Some ids will change. Prefer nb index reconcile.
nb index reconcile [--ancestors] [--commit]
Remove duplicates and update index for added and deleted files.
nb index edit
Open the index file in `$EDITOR`.

Tasks

The nb tasks subcommand is currently limited to listing tasks and marking them done or undone. The logic for other task operations seems a little complicated, so I haven't tackled it yet. For example, tasks can show up anywhere in a document, and there can be multiple task lists in a single document. Tasks are indexed on the fly, so removing a task changes the index for all subsequent tasks in the document, which makes deleting multiple tasks more complicated.

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

4 participants