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

Search through recipes given a keyword #36

Open
LuxMiranda opened this issue Oct 13, 2017 · 6 comments
Open

Search through recipes given a keyword #36

LuxMiranda opened this issue Oct 13, 2017 · 6 comments

Comments

@LuxMiranda
Copy link
Owner

LuxMiranda commented Oct 13, 2017

I'm thinking of something similar to grep but that searches instead through recipes. For now, just search through what showRecipe would typically display, we can get fancier later!

The interaction might look something like this:

$ herms --search "seaweed"

4. Spicy Tempeh Sushi: * 4 sheets nori seaweed
4. Spicy Tempeh Sushi: (3) Place the rise on the seaweed sheet
7. Seaweed and Hummus Platter: | Seaweed and Hummus Platter | 
7. Seaweed and Hummus Platter: * Packaged seaweed sheets
7. Seaweed and Hummus Platter: (5) Put the seaweed on the platter
11. Goldfish Cracker Feast: (3) Place the sour straws in wavy patterns along the plate to emulate the look of seaweed

You can see here that the recipe index and recipe name are given followed by the relevant line of text that has been found. Sometimes it finds the word in the title, sometimes in the ingredients, sometimes in the directions. It just needs to be a simple "I found the string you're looking for on this line!"

Tips:

  • Take inspiration from grep. Bold/color the output in a similar fashion.
  • Study the showRecipe function and all of its many facets

Good luck! Throw questions this way if you have any :)

@renanpvaz
Copy link
Contributor

renanpvaz commented Oct 3, 2018

Hey there, I think I could work on this.

@langston-barrett
Copy link
Collaborator

@renanpvaz That sounds wonderful! Please comment here or email me if any questions come up. As you begin coding, you may want to take a look at #76, which makes some significant changes and should be merged soon(ish) (to be sure we don't end up with conflicting changes).

@dreamsmasher
Copy link
Contributor

Early implementation in #123. However, colorization and bolding still need to be added, as well as support for multiple regular expressions at once.

Should we bold the titles of the matching recipes? Or the string matches?

@langston-barrett
Copy link
Collaborator

as well as support for multiple regular expressions at once

What would be the advantage of multiple regexes (rx1 and rx2) vs. a regex union like (rx1|rx2)?

Should we bold the titles of the matching recipes? Or the string matches?

I'd say the string matches, but that's just personal preference. I'm not too picky as long as it looks good!

@dreamsmasher
Copy link
Contributor

I think it's more user friendly to be able to specify multiple regexes in sequence, but if a user actually uses regex features instead of just strings, I figure they would know how to use unions as well. Just a thought.

I'll take a look into colorizing the string match output when I get a chance, really busy week :(

@langston-barrett
Copy link
Collaborator

I think it's more user friendly to be able to specify multiple regexes in sequence, but if a user actually uses regex features instead of just strings, I figure they would know how to use unions as well. Just a thought.

Fair enough, that's basically what I expected but wanted to be sure I wasn't missing anything. I'm happy either way (if we have support for multiple regexes or not).

I'll take a look into colorizing the string match output when I get a chance, really busy week :(

Sure thing, no need to hold up a nice new feature with window dressing.

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

No branches or pull requests

4 participants