Repository navigation
Conversation
- one new canonical metadata key, `rating`: the recipe keeper's own rating, a number from 1 to 5, decimals allowed - a missing key, an empty value and `0` mean not rated - `N/5` is read as the number N; any other value is shown as text and is not rescaled - no aliases; importers do not write it; published recipes show it as the author's rating, never as an aggregate - no grammar change; one canonical test to add with the conventions row
|
Hi, thanks for the detailed proposal. I generally agree with everything. And instead of a row of stars, ratings could also be rendered like (⭐ 4.2/5). This would also be more consistent with how the server draws the other canonical pills. I have not looked into how other official apps do it though. Also, if at some point in the future there will be a notion to allow for other scales of ratings, that will allow for easier implementation then. I think it is a little limiting (for some people, maybe) to only allow a fixed scale. But I do agree with the arguments in the proposal. Introducing conversions may also lead to ambiguities where the float of 1.0 without a denominator (or a possible type error during conversion) could be misinterpreted as 1/5. So it probably really is best to stay with a fixed N/5 scale, at least for now. |
…(0026) - `rating: N` is N out of 5; `rating: N/M` is N out of M, for any whole M of 1 or more; the scale is never guessed from the value - N runs from 0 to M, decimals allowed; `0` is the lowest rating, no longer "not rated" - a missing key, empty or null value, or anything else is not rated; a linter reports values that are not a rating - display is the application's choice, not bound to stars, as long as the scale is visible; ratings compare by N divided by M - applications keep the file's scale when writing - second canonical test for `3/10`; the fixed 1-5 scale and zero as not rated move to alternatives considered
Adds one key to the canonical metadata:
rating, the recipe keeper's own rating of the recipe. It is a number out of 5, or out of another scale when the author writes one:rating: 4is 4 out of 5,rating: 3/10is 3 out of 10.Rendered proposal
Summary
rating: 4, orrating: 8/10for another scale. Higher is better. Decimals are allowed.N/Mis N out of M, for any whole M of 1 or more.4and4/5are the same rating. A bare number is never read as out of 10.0is the lowest rating, not "not rated".7,7/5,"★★★★☆",great). A linter reports the last kind.Motivation
The canonical metadata table has
difficulty,cuisine,dietandtags, and nothing for a rating, so everyone who rates their recipes picks a key and a shape of their own (stars: 2,rating: 4.5,rating: 4/5). No application can show the rating, sort by it, or keep it when the file is opened elsewhere. Not everyone rates out of five, so a key tied to five stars leaves some people out.Today the same value is also treated differently depending on how it is typed: with CookCLI 0.38.1 the web server shows
rating: 4/5as a plain label and shows nothing forrating: 4.Prompted by a community question about showing
rating: 4/5as stars incook server.Changes since the first draft
N/M, so8/10is now a rating instead of an invalid value, and applications are no longer bound to stars.0is now the lowest rating instead of meaning "not rated".3/10.Things worth a reviewer's attention
rating: 5ambiguous.85/100is a valid rating. A cap at 10 was considered; the proposal says why it was not taken.N/Mis not a fraction here, although elsewhere in Cooklang4/5is 0.8.ratingis canonical it leaves the custom keys, so an application that lists custom keys generically has to show the rating itself in the same release; for a value that is not a rating it may show the raw text.This PR contains the proposal only; the
conventions.mdrow and the canonical tests follow once it is accepted.