diff options
| author | Martin Haug <mhaug@live.de> | 2022-12-20 18:31:47 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-12-20 18:31:47 +0100 |
| commit | 5e19991b6c97bd1d6313262ba7ef590d97b72496 (patch) | |
| tree | f76c0f9d3d45f96a9188ba82e7598cf269a5878f /library/src/layout/align.rs | |
| parent | 38a0404050b1f6725db1bfd357a41539ef4d9973 (diff) | |
Document Utility funcs, some layout funcs
Diffstat (limited to 'library/src/layout/align.rs')
| -rw-r--r-- | library/src/layout/align.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/library/src/layout/align.rs b/library/src/layout/align.rs index 9fcb216f..7e2693aa 100644 --- a/library/src/layout/align.rs +++ b/library/src/layout/align.rs @@ -3,6 +3,16 @@ use crate::prelude::*; /// # Align /// Align content horizontally and vertically. /// +/// ## Example +/// ``` +/// #set align(center) +/// +/// Centered text, a sight to see \ +/// In perfect balance, visually \ +/// Not left nor right, it stands alone \ +/// A work of art, a visual throne +/// ``` +/// /// ## Parameters /// - body: Content (positional, required) /// The content to align. @@ -10,6 +20,27 @@ use crate::prelude::*; /// - alignment: Axes<Option<GenAlign>> (positional, settable) /// The alignment along both axes. /// +/// Horizontal alignments can be `left`, `center`, `right`, `start`, or `end`. +/// The `start` and `end` alignments are relative to the current +/// [text direction](@text). +/// +/// Vertical alignments can be `top`, `horizon`, or `bottom`. +/// +/// To align along both axes at the same time, add the two alignments using +/// the `+` operator to get a 2d alignment. For example, `top + right` aligns +/// the content to the top right corner. +/// +/// ### Example +/// ``` +/// #set text(lang: "ar") +/// +/// مثال +/// #align( +/// end + horizon, +/// rect(inset: 12pt)[ركن] +/// ) +/// ``` +/// /// ## Category /// layout #[func] |
