I apologize in advance if I am not using cooklang in the intended manner, but I think I have discovered a use case that is not included in the specification or example recipes.
In most recipes, physical preparation instructions for ingredients (like dicing, chopping, mincing, cutting on bias, etc.) are specified with the ingredient quantities. For example, a recipe calling for 2 cups of finely chopped carrots would have the following entry for carrots in the Ingredients list:
Ingredients:
2 cups carrot, finely chopped
When I'm writing this recipe in cooklang, I want the preparation instructions for carrots to appear in the Ingredients section of the output of $ cook recipe read. I could include the preparation instructions in a comment, but that wouldn't show up in the output. In order to have the preperation instructions appear in the Ingredients section, I included them inside the curly braces {} after the unit when defining the ingredient. Here's an example:
Add @carrots{2%cup, finely chopped}
The desired output of $ cook recipe read would be:
In this example, cooklang thinks that the entire string following the % character inside {} is the unit. When cooklang attempts to use the plural form of the unit (since the recipe requires 2 cups plural of carrots), cooklang appends an "s" to the last word in the string (chopped) instead of the actual unit (cup).
I think I've accidentally uncovered two issues here:
How should users include preparation instructions for ingredients so they appear in the Ingredients section of the output of $ cook recipe read?
Is the unit parser behaving as intended in this case?
One option would be to have cooklang consider only the word immediately after the % character to be the unit, and ignore everything else.
I apologize in advance if I am not using cooklang in the intended manner, but I think I have discovered a use case that is not included in the specification or example recipes.
In most recipes, physical preparation instructions for ingredients (like dicing, chopping, mincing, cutting on bias, etc.) are specified with the ingredient quantities. For example, a recipe calling for 2 cups of finely chopped carrots would have the following entry for carrots in the Ingredients list:
When I'm writing this recipe in cooklang, I want the preparation instructions for carrots to appear in the Ingredients section of the output of
$ cook recipe read
. I could include the preparation instructions in a comment, but that wouldn't show up in the output. In order to have the preperation instructions appear in the Ingredients section, I included them inside the curly braces{}
after the unit when defining the ingredient. Here's an example:The desired output of
$ cook recipe read
would be:However, the actual output of
$ cook recipe read
is:In this example, cooklang thinks that the entire string following the
%
character inside{}
is the unit. When cooklang attempts to use the plural form of the unit (since the recipe requires 2 cups plural of carrots), cooklang appends an "s" to the last word in the string (chopped) instead of the actual unit (cup).I think I've accidentally uncovered two issues here:
$ cook recipe read
?One option would be to have cooklang consider only the word immediately after the
%
character to be the unit, and ignore everything else.