diff --git a/crates/typst-library/src/model/list.rs b/crates/typst-library/src/model/list.rs index d93ec9172..8bb4413a1 100644 --- a/crates/typst-library/src/model/list.rs +++ b/crates/typst-library/src/model/list.rs @@ -11,10 +11,10 @@ use crate::layout::{BlockElem, Em, Length, VElem}; use crate::model::{ParElem, ParbreakElem}; use crate::text::TextElem; -/// A bullet list. +/// 箇条書きリスト。 /// -/// Displays a sequence of items vertically, with each item introduced by a -/// marker. +/// 各項目の先頭にマーカーを付け、 +/// 一連の項目を縦に並べて表示します。 /// /// # Example /// ```example @@ -37,24 +37,24 @@ use crate::text::TextElem; /// ) /// ``` /// -/// # Syntax -/// This functions also has dedicated syntax: Start a line with a hyphen, -/// followed by a space to create a list item. A list item can contain multiple -/// paragraphs and other block-level content. All content that is indented -/// more than an item's marker becomes part of that item. +/// # 構文 +/// この関数には専用の構文もあります。 +/// 行頭にハイフンとスペースを置くことでリスト項目を作成します。 +/// リスト項目には複数の段落や、他のブロックレベルコンテンツを含めることができます。 +/// リスト項目の記号よりも深く字下げされた全てのコンテンツは、そのリスト項目の一部になります。 #[elem(scope, title = "Bullet List", Show)] pub struct ListElem { - /// Defines the default [spacing]($list.spacing) of the list. If it is - /// `{false}`, the items are spaced apart with - /// [paragraph spacing]($par.spacing). If it is `{true}`, they use - /// [paragraph leading]($par.leading) instead. This makes the list more - /// compact, which can look better if the items are short. + /// リストのデフォルトの[spacing]($list.spacing)を定義します。 + /// これが`{false}`の場合、 項目の間隔は[paragraph spacing]($par.spacing)によって決まります。 + /// `{true}`の場合、代わりに[paragraph leading]($par.leading)が使用されます。 + /// これによりリストがよりコンパクトになり、 + /// 各項目が短い場合に見栄えが良くなります。 /// - /// In markup mode, the value of this parameter is determined based on - /// whether items are separated with a blank line. If items directly follow - /// each other, this is set to `{true}`; if items are separated by a blank - /// line, this is set to `{false}`. The markup-defined tightness cannot be - /// overridden with set rules. + /// マークアップモードでは、 + /// この引数の値は項目が空行で区切られているかどうかに基づいて決定されます。 + /// 項目間に空行がなく連続している場合、この値は`{true}`に設定されますが、 + /// 項目間が空行で区切られている場合は`{false}`に設定されます。 + /// マークアップで定義された間隔はsetルールで上書きすることはできません。 /// /// ```example /// - If a list has a lot of text, and @@ -67,13 +67,13 @@ pub struct ListElem { #[default(true)] pub tight: bool, - /// The marker which introduces each item. + /// 各項目の先頭に付けるマーカー。 /// - /// Instead of plain content, you can also pass an array with multiple - /// markers that should be used for nested lists. If the list nesting depth - /// exceeds the number of markers, the markers are cycled. For total - /// control, you may pass a function that maps the list's nesting depth - /// (starting from `{0}`) to a desired marker. + /// 単純なコンテンツの代わりに、ネストされたリストに使用する、 + /// 複数のマーカーを持つ配列を渡すこともできます。 + /// リストのネストの深さがマーカーの数を超えた場合、使用されるマーカーは循環します。 + /// 完全に制御したい場合は、 + /// リストのネストの深さ(`{0}`から開始する)に応じて、使用するマーカーを決める関数を渡すこともできます。 /// /// ```example /// #set list(marker: [--]) @@ -97,26 +97,26 @@ pub struct ListElem { ]))] pub marker: ListMarker, - /// The indent of each item. + /// 各項目のインデント。 #[resolve] pub indent: Length, - /// The spacing between the marker and the body of each item. + /// 各項目のマーカーと本文の間隔を指定します。 #[resolve] #[default(Em::new(0.5).into())] pub body_indent: Length, - /// The spacing between the items of the list. + /// リストの項目同士の間隔を指定します。 /// - /// If set to `{auto}`, uses paragraph [`leading`]($par.leading) for tight - /// lists and paragraph [`spacing`]($par.spacing) for wide (non-tight) - /// lists. + /// `{auto}`に設定すると、 + /// コンパクトなリストの場合は[`leading`]($par.leading)を、 + /// 幅のある(コンパクトでない)リストの場合は段落の[`spacing`]($par.spacing)を使用します。 pub spacing: Smart, - /// The bullet list's children. + /// 箇条書きリストの項目。 /// - /// When using the list syntax, adjacent items are automatically collected - /// into lists, even through constructs like for loops. + /// list構文を使用する場合、forループのような構造を挟んでも、 + /// 隣接する項目は自動的にリストとしてまとめられます。 /// /// ```example /// #for letter in "ABC" [ @@ -176,10 +176,10 @@ impl Show for Packed { } } -/// A bullet list item. +/// 箇条書きリストの項目。 #[elem(name = "item", title = "Bullet List Item")] pub struct ListItem { - /// The item's body. + /// 項目の本文。 #[required] pub body: Content, }