Fix numbering documentation (#5051)

This commit is contained in:
emilylime 2024-09-27 13:37:36 +03:00 committed by GitHub
parent ba95baa7e1
commit 2a1fbd4101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -58,13 +58,13 @@ pub fn numbering(
context: Tracked<Context>, context: Tracked<Context>,
/// Defines how the numbering works. /// Defines how the numbering works.
/// ///
/// **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, /// **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `一`, `壹`, `あ`, `い`,
/// `ㄱ`, and `*`. They are replaced by the number in the sequence, in the /// `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `①`, and `⓵`. They are replaced by the
/// given case. /// number in the sequence, preserving the original case.
/// ///
/// The `*` character means that symbols should be used to count, in the /// The `*` character means that symbols should be used to count, in the
/// order of `*`, `†`, `‡`, `§`, `¶`, and `‖`. If there are more than six /// order of `*`, `†`, `‡`, `§`, `¶`, `‖`. If there are more than six
/// items, the number is represented using multiple symbols. /// items, the number is represented using repeated symbols.
/// ///
/// **Suffixes** are all characters after the last counting symbol. They are /// **Suffixes** are all characters after the last counting symbol. They are
/// repeated as-is at the end of any rendered number. /// repeated as-is at the end of any rendered number.
@ -140,9 +140,9 @@ cast! {
/// How to turn a number into text. /// How to turn a number into text.
/// ///
/// A pattern consists of a prefix, followed by one of /// A pattern consists of a prefix, followed by one of `1`, `a`, `A`, `i`, `I`,
/// `1`, `a`, `A`, `i`, `I`, `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `①`, or `⓵`, /// `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `①`, or `⓵`, and then a
/// and then a suffix. /// suffix.
/// ///
/// Examples of valid patterns: /// Examples of valid patterns:
/// - `1)` /// - `1)`
@ -263,7 +263,8 @@ cast! {
pub enum NumberingKind { pub enum NumberingKind {
/// Arabic numerals (1, 2, 3, etc.). /// Arabic numerals (1, 2, 3, etc.).
Arabic, Arabic,
/// Latin letters (A, B, C, etc.). Items beyond Z use multiple symbols. Uses both cases. /// Latin letters (A, B, C, etc.). Items beyond Z use multiple symbols.
/// Uses both cases.
Letter, Letter,
/// Roman numerals (I, II, III, etc.). Uses both cases. /// Roman numerals (I, II, III, etc.). Uses both cases.
Roman, Roman,
@ -271,15 +272,16 @@ pub enum NumberingKind {
Symbol, Symbol,
/// Hebrew numerals. /// Hebrew numerals.
Hebrew, Hebrew,
/// Simplified Chinese numerals. Uses standard numerals for lowercase and “banknote” numerals for uppercase. /// Simplified Chinese numerals. Uses standard numerals for lowercase and
/// "banknote" numerals for uppercase.
SimplifiedChinese, SimplifiedChinese,
// TODO: Pick the numbering pattern based on languages choice. // TODO: Pick the numbering pattern based on languages choice.
// As the `1st` numbering character of Chinese (Simplified) and // As the first character of Simplified and Traditional Chinese numbering
// Chinese (Traditional) is same, we are unable to determine // are the same, we are unable to determine if the context requires
// if the context is Simplified or Traditional by only this // Simplified or Traditional by only looking at this character.
// character.
#[allow(unused)] #[allow(unused)]
/// Traditional Chinese numerals. Uses standard numerals for lowercase and “banknote” numerals for uppercase. /// Traditional Chinese numerals. Uses standard numerals for lowercase and
/// "banknote" numerals for uppercase.
TraditionalChinese, TraditionalChinese,
/// Hiragana in the gojūon order. Includes n but excludes wi and we. /// Hiragana in the gojūon order. Includes n but excludes wi and we.
HiraganaAiueo, HiraganaAiueo,
@ -603,7 +605,7 @@ impl NumberingKind {
/// Stringify a number using a base-N counting system with no zero digit. /// Stringify a number using a base-N counting system with no zero digit.
/// ///
/// This is best explained by example. Suppose our digits are 'A', 'B', and 'C'. /// This is best explained by example. Suppose our digits are 'A', 'B', and 'C'.
/// we would get the following: /// We would get the following:
/// ///
/// ```text /// ```text
/// 1 => "A" /// 1 => "A"