Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 14 additions & 18 deletions crates/typst-library/src/layout/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ use crate::engine::Engine;
use crate::foundations::{cast, elem, Content, NativeElement, Packed, Show, StyleChain};
use crate::layout::{BlockElem, Dir, Spacing};

/// Arranges content and spacing horizontally or vertically.
/// コンテンツと間隔を垂直方向または水平方向に配置。
///
/// The stack places a list of items along an axis, with optional spacing
/// between each item.
/// スタックは、ある軸に沿ってアイテムのリストを配置し、各アイテム間に任意の間隔を設定します。
///
/// # Example
/// #
/// ```example
/// #stack(
/// dir: ttb,
Expand All @@ -21,28 +20,25 @@ use crate::layout::{BlockElem, Dir, Spacing};
/// ```
#[elem(Show)]
pub struct StackElem {
/// The direction along which the items are stacked. Possible values are:
/// アイテムを積み重ねる方向。可能な値は以下の通りです。
///
/// - `{ltr}`: Left to right.
/// - `{rtl}`: Right to left.
/// - `{ttb}`: Top to bottom.
/// - `{btt}`: Bottom to top.
/// - `{ltr}`: 左から右。
/// - `{rtl}`: 右から左。
/// - `{ttb}`: 上から下。
/// - `{btt}`: 下から上。
///
/// You can use the `start` and `end` methods to obtain the initial and
/// final points (respectively) of a direction, as `alignment`. You can also
/// use the `axis` method to determine whether a direction is
/// `{"horizontal"}` or `{"vertical"}`. The `inv` method returns a
/// direction's inverse direction.
/// `alignment`と同様に、向きの始点と終点を(それぞれ)取得するために、`start`と`end`メソッドを使用できます。
/// 方向が`{"horizontal"}` or `{"vertical"}`のどちらかを決定するために`axis`メソッドも使用できます。
/// `inv`メソッドは逆の向きを返します。
///
/// For example, `{ttb.start()}` is `top`, `{ttb.end()}` is `bottom`,
/// `{ttb.axis()}` is `{"vertical"}` and `{ttb.inv()}` is equal to `btt`.
/// 例えば、`{ttb.start()}`は`top`、`{ttb.end()}`は`bottom`、`{ttb.axis()}`は`{"vertical"}`となり、`{ttb.inv()}`は`btt`に等しくなります。
#[default(Dir::TTB)]
pub dir: Dir,

/// Spacing to insert between items where no explicit spacing was provided.
/// 明示的に間隔が与えられなかった場合にアイテム間に挿入される間隔。
pub spacing: Option<Spacing>,

/// The children to stack along the axis.
/// 軸に沿って積み重ねる子。
#[variadic]
pub children: Vec<StackChild>,
}
Expand Down
2 changes: 1 addition & 1 deletion website/translation-status.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"/docs/reference/layout/skew/": "untranslated",
"/docs/reference/layout/h/": "untranslated",
"/docs/reference/layout/v/": "untranslated",
"/docs/reference/layout/stack/": "untranslated",
"/docs/reference/layout/stack/": "translated",
"/docs/reference/visualize/": "untranslated",
"/docs/reference/visualize/circle/": "untranslated",
"/docs/reference/visualize/color/": "untranslated",
Expand Down
Loading