-
Notifications
You must be signed in to change notification settings - Fork 7
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
add sections 4,5,6 to Amount explainer #36
Conversation
add flaws/limitations of existing features/proposals, how we can do better, and outline of a proposed solution. also subsections to more clearly delineate existing (working) features and prior (unimplemented) proposals
amount.md
Outdated
|
||
## Outline of proposed solution | ||
Proposal: a new HTML `<amount>` element (similar to `<data>` and `<time>`), with: | ||
* `value` attribute: optional numerical value, similar to the `<data>` element’s `value` attribute. Otherwise element contents are the value. |
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.
Can you articulate how the two interact? Is the text content a display of the value when there is a value? How would a value be derived from the content if it contains other decoration (for instance, how would <amount>35m</amount>
work)?
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.
Can you articulate how the two interact?
The answer is similar to how it works for data element, as noted. This section is intended to be a brief understandable outline of a solution, not the entirety of how everything works, that's for section 7 and 9.
Is the text content a display of the value when there is a value?
Yes, which is how it works in the data element.
How would a value be derived from the content if it contains other decoration (for instance, how would
<amount>35m</amount>
work)?
Short answer is HTML has algorithms in various places for parsing out numeric values from text. Longer answer I'll write up in sections 7 and 9.
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.
One final question: how do I choose Km/h rather than m/s? ("h" not being an SI unit)
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.
Interestingly enough, "km/h" is an SI unit, per https://en.wikipedia.org/wiki/Kilometres_per_hour at least:
The kilometre per hour (SI symbol: km/h; non-SI abbreviations: kph, km/hr).
Worth calling out compound SI units explicitly in summary outline. Will add a sentence accordingly to the unit attribute description.
amount.md
Outdated
User agents may fully algorithmically transform such a unit to the user’s locale (user opt-in) or other display preferences. | ||
* `currency` attribute: optional currency code (([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) to express a monetary amount. User agents could use an online exchange service to compute rough equivalents and note the source and time dependency (temporal context) of any such conversions. | ||
* The presence of both `units` and `currency' attributes is an error. The user agent must ignore both attributes. | ||
* If neither a `units` nor `currency` attribute are present, the amount is unitless and expresses a quantity. |
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 this is a quantity, is there a way to express what it is a quantity of? That is, <amount quantity="mince pie">5</amount>
or would you just do <amount>5</amount> mince pies
?
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.
<amount>5</amount>
mince pies?
This.
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.
Show some examples please.
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.
Good suggestion even for the outline. Some of this feedback I am going to write-up into an expanded guide for our explainers. Adding examples.
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.
Obviously it's a bit hard to review this when it is as incomplete as it is, but this seems fine.
amount.md
Outdated
## Existing features and prior proposals | ||
### Existing features |
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.
I was taught never to leave a section empty like this. Do you need the extra grouping?
## Existing features and prior proposals | |
### Existing features | |
## Existing features |
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.
Added a brief sentence and explanation of why the subsections, to avoid the empty higher level section. Note that many (at least W3C) specs have such "wrapper" sections that do nothing but contain subsections so I'm not sure that's a well-accepted "never" rule. Perhaps a difference in style guidance across standards orgs.
amount.md
Outdated
|
||
## Outline of proposed solution | ||
Proposal: a new HTML `<amount>` element (similar to `<data>` and `<time>`), with: | ||
* `value` attribute: optional numerical value, similar to the `<data>` element’s `value` attribute. Otherwise element contents are the value. |
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.
One final question: how do I choose Km/h rather than m/s? ("h" not being an SI unit)
amount.md
Outdated
User agents may fully algorithmically transform such a unit to the user’s locale (user opt-in) or other display preferences. | ||
* `currency` attribute: optional currency code (([ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)) to express a monetary amount. User agents could use an online exchange service to compute rough equivalents and note the source and time dependency (temporal context) of any such conversions. | ||
* The presence of both `units` and `currency' attributes is an error. The user agent must ignore both attributes. | ||
* If neither a `units` nor `currency` attribute are present, the amount is unitless and expresses a quantity. |
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.
Show some examples please.
add flaws/limitations of existing features/proposals, how we can do better, and outline of a proposed solution. also subsections to more clearly delineate existing (working) features and prior (unimplemented) proposals