nice clean recipes pear.dunkirk.sh
recipes
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add better checks on prettify quantities

+121 -6
+5 -6
internal/extract/schema/jsonld.go
··· 371 371 372 372 func parseIngredient(text string) models.Ingredient { 373 373 text = strings.TrimSpace(text) 374 - text = prettifyQuantities(text) 375 374 376 375 if m := ingredientRangeRe.FindStringSubmatch(text); len(m) == 4 { 377 - return models.Ingredient{RawText: text, Quantity: m[1], Unit: m[2], Name: m[3]} 376 + return models.Ingredient{RawText: prettifyQuantities(text), Quantity: m[1], Unit: m[2], Name: m[3]} 378 377 } 379 378 if m := ingredientFracAdjUnitRe.FindStringSubmatch(text); len(m) == 5 { 380 379 name := strings.TrimSpace(m[2]) + " " + m[4] 381 - return models.Ingredient{RawText: text, Quantity: m[1], Unit: m[3], Name: name} 380 + return models.Ingredient{RawText: prettifyQuantities(text), Quantity: m[1], Unit: m[3], Name: name} 382 381 } 383 382 if m := ingredientFracRe.FindStringSubmatch(text); len(m) == 4 { 384 - return models.Ingredient{RawText: text, Quantity: m[1], Unit: m[2], Name: m[3]} 383 + return models.Ingredient{RawText: prettifyQuantities(text), Quantity: m[1], Unit: m[2], Name: m[3]} 385 384 } 386 385 if m := ingredientNoUnitRe.FindStringSubmatch(text); len(m) == 3 { 387 - return models.Ingredient{RawText: text, Quantity: m[1], Name: m[2]} 386 + return models.Ingredient{RawText: prettifyQuantities(text), Quantity: m[1], Name: m[2]} 388 387 } 389 - return models.Ingredient{RawText: text} 388 + return models.Ingredient{RawText: prettifyQuantities(text)} 390 389 } 391 390 392 391 var decimalRe = regexp.MustCompile(`\b(\d+\.\d+)\b`)
+116
test-recipe.html
··· 1 + <!DOCTYPE html> 2 + <html lang="en"> 3 + <head> 4 + <meta charset="utf-8"> 5 + <meta name="viewport" content="width=device-width,initial-scale=1"> 6 + <title>Chili Crisp Fettuccine Alfredo</title> 7 + <meta property="og:title" content="Chili Crisp Fettuccine Alfredo"> 8 + <meta property="og:image" content="https://cdn.hackclub.com/019dcbbf-f8e8-79a9-9ed0-d95da1dddb76/image.png"> 9 + <script type="application/ld+json"> 10 + { 11 + "@context": "https://schema.org", 12 + "@type": "Recipe", 13 + "name": "Chili Crisp Fettuccine Alfredo", 14 + "description": "A spicy twist on classic fettuccine alfredo with crispy chili oil, marinated chicken, and a creamy Parmesan sauce.", 15 + "image": "https://cdn.hackclub.com/019dcbbf-f8e8-79a9-9ed0-d95da1dddb76/image.png", 16 + "recipeYield": "2 servings", 17 + "prepTime": "PT30M", 18 + "cookTime": "PT20M", 19 + "totalTime": "PT50M", 20 + "recipeIngredient": [ 21 + "1 chicken breast", 22 + "salt to taste", 23 + "1 tsp smoked paprika powder", 24 + "1 tsp garlic powder", 25 + "1/2 tsp black pepper powder", 26 + "1 tbsp oil", 27 + "9 oz fettuccine", 28 + "1 cup pasta water", 29 + "2 tbsp oil", 30 + "4 tbsp butter", 31 + "1 tbsp chili oil", 32 + "2 tsp all purpose flour", 33 + "1.5 cup heavy whipping cream", 34 + "1 tsp garlic powder", 35 + "1/2 tsp black pepper", 36 + "1 tsp dried parsley", 37 + "1 tsp smoked paprika powder", 38 + "3/4 cup Parmesan cheese", 39 + "2 tsp lemon juice" 40 + ], 41 + "recipeInstructions": [ 42 + { 43 + "@type": "HowToStep", 44 + "text": "Pat chicken breast dry and season with salt to taste, smoked paprika powder, garlic powder, and black pepper powder. Add oil and mix well to combine. Let marinate for 30 minutes." 45 + }, 46 + { 47 + "@type": "HowToStep", 48 + "text": "Bring a large pot of generously salted water to a boil. Cook fettuccine until al dente. Reserve 1 cup pasta water, then drain." 49 + }, 50 + { 51 + "@type": "HowToStep", 52 + "text": "Heat oil in a pan. Add the marinated chicken and cook for 4-5 minutes per side on medium-high heat depending on thickness. Remove the chicken and set aside." 53 + }, 54 + { 55 + "@type": "HowToStep", 56 + "text": "In the same pan, add butter. Once melted, add chili oil and cook for 30 seconds. Add all purpose flour and whisk constantly for 30-40 seconds to cook out the raw taste — do not brown." 57 + }, 58 + { 59 + "@type": "HowToStep", 60 + "text": "Pour in heavy whipping cream (room temperature). Add salt to taste, garlic powder, black pepper, dried parsley, and smoked paprika powder. Stir to combine." 61 + }, 62 + { 63 + "@type": "HowToStep", 64 + "text": "Simmer gently for 3-4 minutes, stirring, until slightly thickened. Reduce heat to low, then stir in Parmesan cheese (freshly grated) until melted and smooth. Add lemon juice. Taste and adjust salt or lemon as needed." 65 + }, 66 + { 67 + "@type": "HowToStep", 68 + "text": "Add the cooked fettuccine to the sauce. Toss gently, adding the reserved pasta water a little at a time until the sauce is silky and coats the pasta well. Slice the rested chicken and add to the pan. Toss again and simmer on low for 1-2 minutes to let everything come together." 69 + }, 70 + { 71 + "@type": "HowToStep", 72 + "text": "Garnish with extra Parmesan, parsley, or a pinch of black pepper." 73 + } 74 + ] 75 + } 76 + </script> 77 + </head> 78 + <body> 79 + <h1>Chili Crisp Fettuccine Alfredo</h1> 80 + <p>A spicy twist on classic fettuccine alfredo with crispy chili oil, marinated chicken, and a creamy Parmesan sauce.</p> 81 + <img src="https://cdn.hackclub.com/019dcbbf-f8e8-79a9-9ed0-d95da1dddb76/image.png" alt="Chili Crisp Fettuccine Alfredo"> 82 + <h2>Ingredients</h2> 83 + <ul> 84 + <li>1 chicken breast</li> 85 + <li>salt to taste</li> 86 + <li>1 tsp smoked paprika powder</li> 87 + <li>1 tsp garlic powder</li> 88 + <li>1/2 tsp black pepper powder</li> 89 + <li>1 tbsp oil</li> 90 + <li>9 oz fettuccine</li> 91 + <li>1 cup pasta water</li> 92 + <li>2 tbsp oil</li> 93 + <li>4 tbsp butter</li> 94 + <li>1 tbsp chili oil</li> 95 + <li>2 tsp all purpose flour</li> 96 + <li>1.5 cup heavy whipping cream</li> 97 + <li>1 tsp garlic powder</li> 98 + <li>1/2 tsp black pepper</li> 99 + <li>1 tsp dried parsley</li> 100 + <li>1 tsp smoked paprika powder</li> 101 + <li>3/4 cup Parmesan cheese</li> 102 + <li>2 tsp lemon juice</li> 103 + </ul> 104 + <h2>Instructions</h2> 105 + <ol> 106 + <li>Pat chicken breast dry and season with salt to taste, smoked paprika powder, garlic powder, and black pepper powder. Add oil and mix well to combine. Let marinate for 30 minutes.</li> 107 + <li>Bring a large pot of generously salted water to a boil. Cook fettuccine until al dente. Reserve 1 cup pasta water, then drain.</li> 108 + <li>Heat oil in a pan. Add the marinated chicken and cook for 4-5 minutes per side on medium-high heat depending on thickness. Remove the chicken and set aside.</li> 109 + <li>In the same pan, add butter. Once melted, add chili oil and cook for 30 seconds. Add all purpose flour and whisk constantly for 30-40 seconds to cook out the raw taste — do not brown.</li> 110 + <li>Pour in heavy whipping cream (room temperature). Add salt to taste, garlic powder, black pepper, dried parsley, and smoked paprika powder. Stir to combine.</li> 111 + <li>Simmer gently for 3-4 minutes, stirring, until slightly thickened. Reduce heat to low, then stir in Parmesan cheese (freshly grated) until melted and smooth. Add lemon juice. Taste and adjust salt or lemon as needed.</li> 112 + <li>Add the cooked fettuccine to the sauce. Toss gently, adding the reserved pasta water a little at a time until the sauce is silky and coats the pasta well. Slice the rested chicken and add to the pan. Toss again and simmer on low for 1-2 minutes to let everything come together.</li> 113 + <li>Garnish with extra Parmesan, parsley, or a pinch of black pepper.</li> 114 + </ol> 115 + </body> 116 + </html>