Skip to content

Commit e9c97b3

Browse files
authored
Final preparations for v47 pourover (#1021)
* Final preparations for v47 pourover This PR incorporates additional fixes to #1001 found when assembling the "pour over" version of the specification for v47. * Update number.md * Update datetime.md Fix nesting level. Fix broken note. * Link to default-function head * syntax.md: save some steps on link fixing
1 parent 185f201 commit e9c97b3

File tree

4 files changed

+60
-59
lines changed

4 files changed

+60
-59
lines changed

spec/functions/datetime.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Date and Time Value Formatting
1+
### Date and Time Value Formatting
22

33
This subsection describes the _functions_ and _options_ for date/time formatting.
44

@@ -12,7 +12,7 @@ This subsection describes the _functions_ and _options_ for date/time formatting
1212
> The types of queries found in implementations such as `java.time.TemporalAccessor`
1313
> are complex and user expectations might be inconsistent with good I18N practices.
1414
15-
### The `:datetime` function
15+
#### The `:datetime` function
1616

1717
The function `:datetime` is used to format date/time values, including
1818
the ability to compose user-specified combinations of fields.
@@ -26,14 +26,14 @@ If no options are specified, this function defaults to the following:
2626
> in JavaScript and with `{d,date}` in ICU MessageFormat 1.0.
2727
> This is because, unlike those implementations, `:datetime` is distinct from `:date` and `:time`.
2828
29-
#### Operands
29+
##### Operands
3030

3131
The _operand_ of the `:datetime` function is either
3232
an implementation-defined date/time type
3333
or a _date/time literal value_, as defined in [Date and Time Operand](#date-and-time-operands).
3434
All other _operand_ values produce a _Bad Operand_ error.
3535

36-
#### Options
36+
##### Options
3737

3838
The `:datetime` function can use either the appropriate _style options_
3939
or can use a collection of _field options_ (but not both) to control the formatted
@@ -54,7 +54,7 @@ with _options_ on the _expression_ taking priority over any option values of the
5454
> [options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions#description)
5555
> in JavaScript's `Intl.DateTimeFormat`.
5656
57-
##### Style Options
57+
###### Style Options
5858

5959
The function `:datetime` has these _style options_.
6060

@@ -69,12 +69,13 @@ The function `:datetime` has these _style options_.
6969
- `medium`
7070
- `short`
7171

72-
##### Field Options
72+
###### Field Options
7373

7474
_Field options_ describe which fields to include in the formatted output
7575
and what format to use for that field.
7676

77-
> [!NOTE] > _Field options_ do not have default values because they are only to be used
77+
> [!NOTE]
78+
> _Field options_ do not have default values because they are only to be used
7879
> to compose the formatter.
7980
8081
The function `:datetime` has the following _field options_:
@@ -120,29 +121,29 @@ The function `:datetime` has the following _field options_:
120121
- `shortGeneric`
121122
- `longGeneric`
122123

123-
#### Resolved Value
124+
##### Resolved Value
124125

125126
The _resolved value_ of an _expression_ with a `:datetime` _function_
126127
contains an implementation-defined date/time value
127128
of the _operand_ of the annotated _expression_,
128129
together with the resolved options values.
129130

130-
### The `:date` function
131+
#### The `:date` function
131132

132133
The function `:date` is used to format the date portion of date/time values.
133134

134135
If no options are specified, this function defaults to the following:
135136

136137
- `{$d :date}` is the same as `{$d :date style=medium}`
137138

138-
#### Operands
139+
##### Operands
139140

140141
The _operand_ of the `:date` function is either
141142
an implementation-defined date/time type
142143
or a _date/time literal value_, as defined in [Date and Time Operand](#date-and-time-operands).
143144
All other _operand_ values produce a _Bad Operand_ error.
144145

145-
#### Options
146+
##### Options
146147

147148
The function `:date` has these _options_:
148149

@@ -158,7 +159,7 @@ it can include other option values.
158159
Any _operand_ option values matching the `:datetime` _style options_ or _field options_ are ignored,
159160
as is any `style` option.
160161

161-
#### Resolved Value
162+
##### Resolved Value
162163

163164
The _resolved value_ of an _expression_ with a `:date` _function_
164165
is implementation-defined.
@@ -167,22 +168,22 @@ An implementation MAY emit a _Bad Operand_ or _Bad Option_ error (as appropriate
167168
when a _variable_ annotated directly or indirectly by a `:date` _annotation_
168169
is used as an _operand_ or an _option_ value.
169170

170-
### The `:time` function
171+
#### The `:time` function
171172

172173
The function `:time` is used to format the time portion of date/time values.
173174

174175
If no options are specified, this function defaults to the following:
175176

176177
- `{$t :time}` is the same as `{$t :time style=short}`
177178

178-
#### Operands
179+
##### Operands
179180

180181
The _operand_ of the `:time` function is either
181182
an implementation-defined date/time type
182183
or a _date/time literal value_, as defined in [Date and Time Operand](#date-and-time-operands).
183184
All other _operand_ values produce a _Bad Operand_ error.
184185

185-
#### Options
186+
##### Options
186187

187188
The function `:time` has these _options_:
188189

@@ -198,7 +199,7 @@ it can include other option values.
198199
Any _operand_ option values matching the `:datetime` _style options_ or _field options_ are ignored,
199200
as is any `style` option.
200201

201-
#### Resolved Value
202+
##### Resolved Value
202203

203204
The _resolved value_ of an _expression_ with a `:time` _function_
204205
is implementation-defined.
@@ -207,7 +208,7 @@ An implementation MAY emit a _Bad Operand_ or _Bad Option_ error (as appropriate
207208
when a _variable_ annotated directly or indirectly by a `:time` _annotation_
208209
is used as an _operand_ or an _option_ value.
209210

210-
### Date and Time Operands
211+
#### Date and Time Operands
211212

212213
The _operand_ of a date/time function is either
213214
an implementation-defined date/time type
@@ -257,7 +258,7 @@ For more information, see [Working with Timezones](https://w3c.github.io/timezon
257258
> Support for these extensions is expected to be required in the post-tech preview.
258259
> See: https://datatracker.ietf.org/doc/draft-ietf-sedate-datetime-extended/
259260
260-
### Date and Time Override Options
261+
#### Date and Time Override Options
261262
262263
**_<dfn>Date/time override options</dfn>_** are _options_ that allow an _expression_ to
263264
override values set by the current locale,

spec/functions/number.md

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
## Numeric Value Selection and Formatting
1+
### Numeric Value Selection and Formatting
22

3-
### The `:number` function
3+
#### The `:number` function
44

55
The function `:number` is a selector and formatter for numeric values.
66

7-
#### Operands
7+
##### Operands
88

99
The function `:number` requires a [Number Operand](#number-operands) as its _operand_.
1010

11-
#### Options
11+
##### Options
1212

1313
Some options do not have default values defined in this specification.
1414
The defaults for these options are implementation-dependent.
@@ -83,27 +83,27 @@ with _options_ on the _expression_ taking priority over any option values of the
8383
> would be formatted with the resolved options
8484
> `{ minimumFractionDigits: '1', signDisplay: 'always' }`.
8585
86-
#### Resolved Value
86+
##### Resolved Value
8787
8888
The _resolved value_ of an _expression_ with a `:number` _function_
8989
contains an implementation-defined numerical value
9090
of the _operand_ of the annotated _expression_,
9191
together with the resolved options' values.
9292
93-
#### Selection
93+
##### Selection
9494
9595
The _function_ `:number` performs selection as described in [Number Selection](#number-selection) below.
9696
97-
### The `:integer` function
97+
#### The `:integer` function
9898
9999
The function `:integer` is a selector and formatter for matching or formatting numeric
100100
values as integers.
101101
102-
#### Operands
102+
##### Operands
103103
104104
The function `:integer` requires a [Number Operand](#number-operands) as its _operand_.
105105
106-
#### Options
106+
##### Options
107107
108108
Some options do not have default values defined in this specification.
109109
The defaults for these options are implementation-dependent.
@@ -148,18 +148,18 @@ Option values with the following names are however discarded if included in the
148148
- `maximumFractionDigits`
149149
- `minimumSignificantDigits`
150150
151-
#### Resolved Value
151+
##### Resolved Value
152152
153153
The _resolved value_ of an _expression_ with an `:integer` _function_
154154
contains the implementation-defined integer value
155155
of the _operand_ of the annotated _expression_,
156156
together with the resolved options' values.
157157
158-
#### Selection
158+
##### Selection
159159
160160
The _function_ `:integer` performs selection as described in [Number Selection](#number-selection) below.
161161
162-
### The `:math` function
162+
#### The `:math` function
163163
164164
> [!IMPORTANT]
165165
> The _function_ `:math` has a status of **Draft**.
@@ -182,11 +182,11 @@ numeric values to which a mathematical operation has been applied.
182182
> * * {{{$name} and {$others_count} other users liked your post.}}
183183
> ```
184184
185-
#### Operands
185+
##### Operands
186186
187187
The function `:math` requires a [Number Operand](#number-operands) as its _operand_.
188188
189-
#### Options
189+
##### Options
190190
191191
The options on `:math` are exclusive with each other,
192192
and exactly one option is always required.
@@ -204,7 +204,7 @@ or if an _option_ value is not a [digit size option](#digit-size-options),
204204
a _Bad Option_ error is emitted
205205
and a _fallback value_ used as the _resolved value_ of the _expression_.
206206
207-
#### Resolved Value
207+
##### Resolved Value
208208
209209
The _resolved value_ of an _expression_ with a `:math` _function_
210210
contains the implementation-defined numeric value
@@ -231,11 +231,11 @@ The `:math` _options_ are not included in the resolved option values.
231231
> In such cases, implementations can emit an _Unsupported Operation_ error
232232
> or they might just silently overflow the underlying data value.
233233
234-
#### Selection
234+
##### Selection
235235
236236
The _function_ `:math` performs selection as described in [Number Selection](#number-selection) below.
237237
238-
### The `:currency` function
238+
#### The `:currency` function
239239
240240
> [!IMPORTANT]
241241
> The _function_ `:currency` has a status of **Draft**.
@@ -244,7 +244,7 @@ The _function_ `:math` performs selection as described in [Number Selection](#nu
244244
The _function_ `:currency` is a _formatter_ for currency values,
245245
which are a specialized form of numeric formatting.
246246
247-
#### Operands
247+
##### Operands
248248
249249
The _operand_ of the `:currency` function can be one of any number of
250250
implementation-defined types,
@@ -294,7 +294,7 @@ A [Number Operand](#number-operands) without a `currency` _option_ results in a
294294
> }
295295
> ```
296296
297-
#### Options
297+
##### Options
298298
299299
Some options do not have default values defined in this specification.
300300
The defaults for these options are implementation-dependent.
@@ -406,14 +406,14 @@ with _options_ on the _expression_ taking priority over any option values of the
406406
> would be formatted with the resolved options
407407
> `{ currencySign: 'accounting', trailingZeroDisplay: 'stripIfInteger', currency: 'USD' }`.
408408
409-
#### Resolved Value
409+
##### Resolved Value
410410
411411
The _resolved value_ of an _expression_ with a `:currency` _function_
412412
contains an implementation-defined currency value
413413
of the _operand_ of the annotated _expression_,
414414
together with the resolved options' values.
415415
416-
### The `:unit` function
416+
#### The `:unit` function
417417
418418
> [!IMPORTANT]
419419
> The _function_ `:unit` has a status of **Draft**.
@@ -423,7 +423,7 @@ The _function_ `:unit` is proposed to be a RECOMMENDED formatter for unitized va
423423
that is, for numeric values associated with a unit of measurement.
424424
This is a specialized form of numeric formatting.
425425
426-
#### Operands
426+
##### Operands
427427
428428
The _operand_ of the `:unit` function can be one of any number of
429429
implementation-defined types,
@@ -457,7 +457,7 @@ A [Number Operand](#number-operands) without a `unit` _option_ results in a _Bad
457457
> }
458458
> ```
459459
460-
#### Options
460+
##### Options
461461
462462
Some _options_ do not have default values defined in this specification.
463463
The defaults for these _options_ are implementation-dependent.
@@ -532,14 +532,14 @@ with _options_ on the _expression_ taking priority over any _option_ values of t
532532
> would have the resolved options:
533533
> `{ unit: 'furlong', minimumFractionDigits: '2', minimumIntegerDigits: '1' }`.
534534
535-
#### Resolved Value
535+
##### Resolved Value
536536
537537
The _resolved value_ of an _expression_ with a `:unit` _function_
538538
consist of an implementation-defined unit value
539539
of the _operand_ of the annotated _expression_,
540540
together with the resolved _options_ and their resolved values.
541541
542-
#### Unit Conversion
542+
##### Unit Conversion
543543
544544
Implementations MAY support conversion to the locale's preferred units via the `usage` _option_.
545545
Implementing this _option_ is optional.
@@ -570,7 +570,7 @@ Implementations MUST NOT substitute the unit without performing the associated c
570570
>
571571
> This can produce "You have 405 feet to go."
572572
573-
### Number Operands
573+
#### Number Operands
574574
575575
The _operand_ of a number function is either an implementation-defined type or
576576
a literal whose contents match the following `number-literal` production.
@@ -608,7 +608,7 @@ number-literal = ["-"] (%x30 / (%x31-39 *DIGIT)) ["." 1*DIGIT] [%i"e" ["-" / "+"
608608
> or the type `com.ibm.icu.util.CurrencyAmount` can be used to set the currency and related
609609
> options (such as the number of fraction digits).
610610
611-
### Digit Size Options
611+
#### Digit Size Options
612612
613613
Some _options_ of number _functions_ are defined to take a "digit size option".
614614
The _function handlers_ for number _functions_ use these _options_ to control aspects of numeric display
@@ -632,7 +632,7 @@ If the value of a digit size option does not evaluate as a non-negative integer,
632632
or if the value exceeds any implementation-defined upper limit
633633
or any option-specific lower limit, a _Bad Option Error_ is emitted.
634634

635-
### Number Selection
635+
#### Number Selection
636636

637637
The value of the `select` _option_ MUST be set by a _literal_,
638638
as otherwise the _message_ might not be translatable.
@@ -674,7 +674,7 @@ numeric selectors perform as described below.
674674
> Implementations are not required to implement this exactly as written.
675675
> However, the observed behavior must be consistent with what is described here.
676676
677-
#### Default Value of `select` Option
677+
##### Default Value of `select` Option
678678

679679
The value `plural` is the default for the option `select`
680680
because it is the most common use case for numeric selection.
@@ -697,7 +697,7 @@ but can cause problems in target locales that the original developer is not cons
697697
> The `one` variant is needed by languages such as Polish or Russian.
698698
> Such locales typically also require other keywords such as `two`, `few`, and `many`.
699699
700-
#### Rule Selection
700+
##### Rule Selection
701701
702702
Rule selection is intended to support the grammatical matching needs of different
703703
languages/locales in order to support plural or ordinal numeric values.
@@ -757,7 +757,7 @@ for examples.
757757
> | 27 | `other` | 27 dní |
758758
> | 2.4 | `many` | 2,4 dne |
759759
760-
#### Exact Literal Match Serialization
760+
##### Exact Literal Match Serialization
761761
762762
If the numeric value of `resolvedSelector` is an integer
763763
and none of the following options are set for `resolvedSelector`,

0 commit comments

Comments
 (0)