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: Support for adding title when adding a bookmark #60

Open
byalextran opened this issue Apr 3, 2020 · 9 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@byalextran
Copy link

When adding a bookmark, you can add a description using a semicolon (e.g. p tag1 tag2 ; description).

I'd love the ability to also add a custom title as opposed to what the title of the page is. Perhaps with a colon?

  • p tag1 ; description : title
  • p tag1 : title
@spamwax spamwax added enhancement New feature or request help wanted Extra attention is needed labels Apr 3, 2020
@spamwax
Copy link
Owner

spamwax commented Apr 3, 2020

Sounds reasonable, but due to time constraints I can't work on it at the moment, but PRs are welcome.

@byalextran
Copy link
Author

i've never done anything in rust or with alfred workflows before, however, i'm open to tinkering around. since i'm not familiar with the codebase, it'd be helpful if you gave me a high-level overview of what changes need to be made (and where) to implement this.

granted, i could probably figure it out by looking around ... however, i'm thinking you could probably save me quite a bit of time with just a few minutes of yours.

@spamwax
Copy link
Owner

spamwax commented Apr 5, 2020

Great!
The main executable does its job by running different sub-commands (src/commands/*).
The one that deals with parsing what user entered after p is src/commands/list.rs

; is a special character that splits the user input into list of tags and description.
Then list.rs searches cached list of tags for the last word user has entered. When user hits enter, an alfred Item that contains all of the tags is sent to next step in Workflow.

For this to work, we need to first decide how the user can ask for a custom title (something along the lines you suggested above) and do proper parsing. Then if a title is provided, we can add a new variable(title) around line 143 in list.rs

Additionally src/commands/post sub-command should change to receive a title argument. Within post.rs if title is set then instead of using browser title, we use the supplied title.

The cli.rs lets you change what optional arguments each subcommand currently accepts. Look at the Post struct

If these are done correctly, then changing the Alfred workflow itself will be very easy.

@byalextran
Copy link
Author

awesome, super helpful. no promises, but this feature would be extremely useful to me. so i've got motivation to get it working. 😀

@spamwax
Copy link
Owner

spamwax commented Apr 5, 2020

Just curious, what's your use case that having custom title is helpful

@byalextran
Copy link
Author

not all page titles are descriptive enough or contain the keywords i would instinctively use to search for that bookmark. so being able to specify a custom title ensures it's accurate and searchable for me.

also, i like having my titles formatted a specific way (which includes removing a lot of cruft).

@spamwax
Copy link
Owner

spamwax commented Apr 5, 2020

I see. I typically do that "organization" either in tags or description of the bookmark. Most of the time my pset tagonly is set to "tag only search"

@byalextran
Copy link
Author

i just recently decided to use pinboard as my bookmark repo instead of chrome. so right now trying to figure out the system that works best for my needs.

i'll most likely end up using the description/tags for part of my organization. but would still like the efficiency of customizing the title in alfred without having to save the bookmark and then edit the title in pinboard.

you know us alfred users, we're all about that efficiency. 😝

@spamwax
Copy link
Owner

spamwax commented Apr 5, 2020

😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants