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

Note Review #242

Open
jupart opened this issue Feb 15, 2023 · 0 comments
Open

Note Review #242

jupart opened this issue Feb 15, 2023 · 0 comments

Comments

@jupart
Copy link

jupart commented Feb 15, 2023

An important part of my workflow is reviewing notes to prune, organize, and combine notes. I've written a script to iterate over notes in a notebook, display them, and prompt for deletion, edit, or simply skipping. I think this functionality might be more useful integrated in nb, but think of this as a proof of concept.

#!/usr/bin/fish
#
# must pass valid notebook name

set -l notebook $argv[1]
if not nb notebook $notebook
    echo "Run nb_review with a valid nb notebook"
    return
end
set -l nb_filenames (nb $notebook:run ls)

for filename in $nb_filenames
    set -l id (nb $notebook:index get_id $filename)
    nb $notebook:show $id | cat
    read answer -p "echo; set_color -o -u red; printf '(d)elete (e)dit (c)ontinue'; set_color normal; printf ': '"
    switch $answer
        case "d"
            echo "Deleting $filename"
            nb $notebook:delete --force $id
        case "e"
            nb $notebook:edit $id
        case "c"
            echo "Skipping $filename"
    end
    clear
end
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

1 participant