@@ -11,17 +11,15 @@ use crate::engine::Engine;
1111use crate :: foundations:: { cast, func, Context , Func , Str , Value } ;
1212use crate :: text:: Case ;
1313
14- /// Applies a numbering to a sequence of numbers.
14+ /// 順序に応じた番号付け。
1515///
16- /// A numbering defines how a sequence of numbers should be displayed as
17- /// content. It is defined either through a pattern string or an arbitrary
18- /// function.
16+ /// 番号付けは、一連の数値をコンテンツとしてどのように表示するかを定義します。
17+ /// これはパターン文字列または任意の関数によって指定されます。
1918///
20- /// A numbering pattern consists of counting symbols, for which the actual
21- /// number is substituted, their prefixes, and one suffix. The prefixes and the
22- /// suffix are repeated as-is.
19+ /// 番号付けパターンは、数値を置き換えるためのカウント記号、それらに付けるプレフィックス、そして1つのサフィックスから構成されます。
20+ /// プレフィックスとサフィックスは、そのままの形で繰り返し使用されます。
2321///
24- /// # Example
22+ /// # 例
2523/// ```example
2624/// #numbering("1.1)", 1, 2, 3) \
2725/// #numbering("1.a.i", 1, 2) \
@@ -35,15 +33,12 @@ use crate::text::Case;
3533/// )
3634/// ```
3735///
38- /// # Numbering patterns and numbering functions
39- /// There are multiple instances where you can provide a numbering pattern or
40- /// function in Typst. For example, when defining how to number
41- /// [headings]($heading) or [figures]($figure). Every time, the expected format
42- /// is the same as the one described below for the
43- /// [`numbering`]($numbering.numbering) parameter.
36+ /// # 番号付けのパターン指定と関数指定
37+ /// Typstではパターン指定または関数指定で番号付けを定義できる場面がいくつかあります。
38+ /// たとえば、[見出し]($heading)や[図表]($figure)などに番号を付ける際に使用します。
39+ /// いずれの場合も、指定の形式は後述する[`numbering`]($numbering.numbering)パラメーターと同じです。
4440///
45- /// The following example illustrates that a numbering function is just a
46- /// regular [function] that accepts numbers and returns [`content`].
41+ /// 次の例は、番号付け用の関数が、単に数値を受け取って[`content`]を返す通常の[function]であることを示しています。
4742/// ```example
4843/// #let unary(.., last) = "|" * last
4944/// #set heading(numbering: unary)
@@ -55,35 +50,27 @@ use crate::text::Case;
5550pub fn numbering (
5651 engine : & mut Engine ,
5752 context : Tracked < Context > ,
58- /// Defines how the numbering works.
53+ /// 番号付けの表示形式を定義します。
5954 ///
60- /// **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `α`, `Α`, `一`, `壹`,
61- /// `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `١`, `۱`, `१`, `১`, `ক`,
62- /// `①`, and `⓵`. They are replaced by the number in the sequence,
63- /// preserving the original case.
55+ /// **カウント記号** として使用できるパターン文字は `1`, `a`, `A`, `i`, `I`, `α`, `Α`, `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `١`, `۱`, `१`, `১`, `ক`, `①`, `⓵`があります。
56+ /// これらの文字は、大文字・小文字を維持したまま、対応する順序の番号文字に置き換えられます。
6457 ///
65- /// The `*` character means that symbols should be used to count, in the
66- /// order of `*`, `†`, `‡`, `§`, `¶`, `‖`. If there are more than six
67- /// items, the number is represented using repeated symbols.
58+ /// 記号`*`は `*`, `†`, `‡`, `§`, `¶`, `‖`の順序で番号付けすることを意味します。
59+ /// 項目が6つ以上ある場合は、記号を繰り返し使用して番号を表現します。
6860 ///
69- /// **Suffixes ** are all characters after the last counting symbol. They are
70- /// repeated as-is at the end of any rendered number.
61+ /// **サフィックス ** とは、最後のカウント記号の後ろに置く文字列です。
62+ /// これらは、生成された番号文字の末尾に、そのままの形で繰り返し表示されます。
7163 ///
72- /// **Prefixes** are all characters that are neither counting symbols nor
73- /// suffixes. They are repeated as-is at in front of their rendered
74- /// equivalent of their counting symbol.
64+ /// **プレフィックス** は、カウント記号でもサフィックスでもない文字列です。
65+ /// それぞれのカウント記号の前に、そのままの形で繰り返し表示されます。
7566 ///
76- /// This parameter can also be an arbitrary function that gets each number
77- /// as an individual argument. When given a function, the `numbering`
78- /// function just forwards the arguments to that function. While this is not
79- /// particularly useful in itself, it means that you can just give arbitrary
80- /// numberings to the `numbering` function without caring whether they are
81- /// defined as a pattern or function.
67+ /// このパラメータには、数値を個別の引数として受け取る任意の関数も指定できます。
68+ /// 関数が与えられた場合、`numbering`関数はその引数をそのまま関数に渡します。
69+ /// これ自体は特に便利というわけではありませんが、番号付けがパターン指定であっても関数指定であっても、番号付けの定義を`numbering`関数に適用できるという意味を持ちます。
8270 numbering : Numbering ,
83- /// The numbers to apply the numbering to. Must be positive.
84- ///
85- /// If `numbering` is a pattern and more numbers than counting symbols are
86- /// given, the last counting symbol with its prefix is repeated.
71+ /// 番号付けを適用する対象の数値。正の数で与えてください。
72+ ///
73+ /// 番号付けがパターン指定であり、カウント記号よりも多くの数値が指定された場合、最後のカウント記号とそのプレフィックスが繰り返されます。
8774 #[ variadic]
8875 numbers : Vec < usize > ,
8976) -> SourceResult < Value > {
0 commit comments