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

adding bookmark to other notebook not working when following doc description #348

Open
sarcastyx opened this issue Dec 25, 2024 · 2 comments

Comments

@sarcastyx
Copy link

Hi xwmx, I tried checking the existing open and closed issues to see if this might have been logged but couldn't find anything similar to my experience so thought I'd at least log it.

According to the the nb docs for adding a bookmark
I should be able to do something like:
nb bookmark [<notebook>:][<folder-path>/] <url> ...
to add a bookmark to a notebook I don't currently have open.

My issue that I found, was that when I was in a notebook (ie emacs) and wanted to place a new url bookmark I came across in another notebook named (zsh). If I followed the syntax in the docs, my bookmark would end up in the emacs notebook and not in the zsh notebook. So I would have to manually move the bookmark to the notebook I wanted to place it in.
The command I used is:
nb bookmark zsh: "https://postgresqlstan.github.io/cli/zsh-run-help/" --tags zsh,info.utils
The bookmark would end up in the current notebook I had opened (ie emacs).

I tried just using nb bookmark zsh: "URL", but that still didn't work. The url would end up in what ever notebook I happen to have open.

So don't know if it might be the docs or the nb functionality not matching to what is noted.
Thought you would like to know.

Oh and thank you so much for your work on this script, I'm finding it very useful. I used jrnl before I came across this script and I'm finding I like nb a lot more useful. So thank you again for your effort in building this script.

~ Sarcastyx

xwmx added a commit that referenced this issue Dec 27, 2024
@sarcastyx
Copy link
Author

Wow, thanks @xwmx . I just pulled from master and tried the fix.

That's some great turn around time. I actually wasn't expecting to see a fix till maybe after new year's.
Hey if you don't mind me asking, I'm about average at doing bash scripting. Is there a manual or tutorial you might recommend to maybe help me up my game? At the moment I'm reading https://github.com/The-Order-of-Penguins/Books/blob/master/linux-command-line-and-shell-scripting-bible-by-richard-blum-christine-bresnahan.pdf
But I could always use more info to help me improve.

Well I hope you had a Great Xmas and I just want to wish you a Great New Year coming up.
~ Sarcastyx

@xwmx
Copy link
Owner

xwmx commented Dec 30, 2024

@sarcastyx Awesome. Glad it's working. This was a condition that got missed in the tests, and the fix is now available in version 7.15.1. The bookmark subcommand can be omitted when creating a bookmark, which is how I always use it:

# create a bookmark for example.com
nb https://example.com

# create a bookmark for example.com with options
nb https://example.com --tags tag1,tag2 --comment "Example comment."

That book looks really good with a lot of good information. I use Stack Overflow / Stack Exchange, Wikipedia, and a variety of resources including:

If you try to stick to POSIX features, which I do, it can make things simpler and there is a lot of good information here:

ShellCheck is very useful and educational and I definitely recommend it:

One of key ways I approach shell scripting is treating it like a musical instrument with its own unique advantages and constraints, and to focus on ways to leverage the advantages. For example, performing streaming operations with pipes is really easy in shell compared to other languages, so finding ways to implement ideas using pipelines is usually pretty satisfying and fun.

Other than that, I find it's most useful to come up with things to implement and then figure out how to do it. With shell, the tools all take different options often formatted differently, so part of the fun is figuring out how each tool works.

Glad you like nb and I hope you find this useful. Happy New Year to you, too!

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

2 participants