Repository navigation
Conversation
|
I fully agree with the syntax using the
|
- the three examples of a pipe between components now write the sigil on every option, the form proposed in 0025 (#162) - no change to what this proposal defines: its pipe is inside the braces
|
The need is real. Today The line I would draw: what the recipe text means belongs to cooklang, and so does data that tools have to share in order to agree. Aggregating amounts, rounding them, choosing which unit to show, subtracting a pantry: none of that says anything about cooklang. That second half is what alternatives are mostly for. Numbered so they are easy to reply to. Why I would not do this
What I would rather do to start with This is a library feature, not a spec change, on purpose, and tmlmt's first point above says why from the other side: the parsed model is out of scope for the spec. A need met below the spec is one cooklang never has to carry. The template already asks every proposal what applications should do, so this is the right level, not the wrong thread.
Not a view, just where I am
Either way I would do the callback first. It is small, it does something that cannot be done today, and it does not become redundant if densities or ingredient data do land in cooklang later: the data answers the cases it has rows for, the callback answers the rest. So this is a no to the mechanism, not to the need, and an order of work for the rest. The internals of cooklang-rs first, so a conversion like this has somewhere to live, then the spec follows what works. Same thing I said on #148, and I would rather write it up once than repeat it in every thread. |
Summary
|:@flour{2%cups|260%g}. The first is the primary (as the author measured it), the others are author-supplied equivalents. All scale by the same factor.quantity/unitsas the primary and adds analternativeslist, so existing consumers keep working.unit systemmetadata key from Proposal: add unit system metadata #148 with a list form that names each position:unit system: [us customary, metric]. Apps use it to label a unit toggle and to resolve units spelled the same in several systems (cup,pint).Motivation
Baking and UK/US recipes are routinely published with two measurements ("2 cups (260 g) flour"). Today one of them ends up in the note or as plain text and stops scaling. Client conversion (#148) can't convert volume to weight without densities and can't reproduce an author's own rounded figures. This proposal complements #148 rather than replacing it.
Addresses discussions #84, #142 and #51, and cooklang/cookcli#432.
Rendered proposal