-
Notifications
You must be signed in to change notification settings - Fork 528
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
Ingredient grouping & equipment support for saltpepperskillet #1334
base: main
Are you sure you want to change the base?
Conversation
def ingredient_groups(self): | ||
return group_ingredients( | ||
self.ingredients(), | ||
self.soup, | ||
".wprm-recipe-ingredient-group h4", | ||
".wprm-recipe-ingredient", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point we should probably consider making WPRM ingredient-group support available as a Mixin
(or perhaps a few mixins with different variants based on the WordPress plugin(s) in use) -- these defaults seem to appear fairly often.
if equipment_container: | ||
return [ | ||
item.get_text(strip=True) | ||
for item in equipment_container.find_all( | ||
"div", class_="wprm-recipe-equipment-name" | ||
) | ||
] | ||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if equipment_container: | |
return [ | |
item.get_text(strip=True) | |
for item in equipment_container.find_all( | |
"div", class_="wprm-recipe-equipment-name" | |
) | |
] | |
return None | |
if not equipment_container: | |
return None | |
return [ | |
item.get_text(strip=True) | |
for item in equipment_container.find_all( | |
"div", class_="wprm-recipe-equipment-name" | |
) | |
] |
...and maybe get_equipment
? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - thank you @jknndy!
No description provided.