diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-12-21 12:50:33 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-12-21 12:50:33 +0100 |
| commit | ba294e2670814243122c9e4f560e0f21a4bec13d (patch) | |
| tree | 36bdf987dc53729bb4a176713b40e2ca7c08a874 /library/src/text | |
| parent | 959df6da3b6e3c5876e9d5627cb2970e32a0a37f (diff) | |
Split up list type into three separate types and document them
Diffstat (limited to 'library/src/text')
| -rw-r--r-- | library/src/text/deco.rs | 3 | ||||
| -rw-r--r-- | library/src/text/mod.rs | 20 | ||||
| -rw-r--r-- | library/src/text/raw.rs | 4 |
3 files changed, 17 insertions, 10 deletions
diff --git a/library/src/text/deco.rs b/library/src/text/deco.rs index f74a45a2..6f454573 100644 --- a/library/src/text/deco.rs +++ b/library/src/text/deco.rs @@ -224,6 +224,9 @@ impl StrikeNode { /// How to stroke the line. The text color and thickness are read from the /// font tables if `{auto}`. /// + /// _Note:_ Please don't use this for real redaction as you can still + /// copy paste the text. + /// /// # Example /// ``` /// This is #strike(stroke: 1.5pt + red)[very stricken through]. \ diff --git a/library/src/text/mod.rs b/library/src/text/mod.rs index 191b1fb8..4a25197d 100644 --- a/library/src/text/mod.rs +++ b/library/src/text/mod.rs @@ -43,8 +43,8 @@ use crate::prelude::*; /// ``` /// /// ## Parameters -/// - family: EcoString (positional, variadic, settable) A prioritized sequence -/// of font families. +/// - family: EcoString (positional, variadic, settable) +/// A prioritized sequence of font families. /// /// When processing text, Typst tries all specified font families in order /// until it finds a font that has the necessary glyphs. In the example below, @@ -63,8 +63,8 @@ use crate::prelude::*; /// /// ``` /// -/// - body: Content (positional, required) Content in which all text is styled -/// according to the other arguments. +/// - body: Content (positional, required) +/// Content in which all text is styled according to the other arguments. /// /// ## Category /// text @@ -141,6 +141,7 @@ impl TextNode { /// #text(weight: "light")[Light] \ /// #text(weight: "regular")[Regular] \ /// #text(weight: "medium")[Medium] \ + /// #text(weight: 500)[Medium] \ /// #text(weight: "bold")[Bold] /// ``` pub const WEIGHT: FontWeight = FontWeight::REGULAR; @@ -296,10 +297,10 @@ impl TextNode { /// - `{rtl}`: Layout text from right to left. /// /// When writing in right-to-left scripts like Arabic or Hebrew, you should - /// set the language or direction. While individual runs of text are - /// automatically layouted in the correct direction, setting the dominant - /// direction gives the bidirectional reordering algorithm the necessary - /// information to correctly place punctuation and inline objects. + /// set the [text language](@text/lang) or direction. While individual runs + /// of text are automatically layouted in the correct direction, setting the + /// dominant direction gives the bidirectional reordering algorithm the + /// necessary information to correctly place punctuation and inline objects. /// Furthermore, setting the direction affects the alignment values `start` /// and `end`, which are equivalent to `left` and `right` in `ltr` text and /// the other way around in `rtl` text. @@ -319,6 +320,9 @@ impl TextNode { /// Whether to hyphenate text to improve line breaking. When `{auto}`, text /// will be hyphenated if and only if justification is enabled. /// + /// Setting the [text language](@text/lang) ensures that the correct + /// hyphenation patterns are used. + /// /// # Example /// ``` /// #set par(justify: true) diff --git a/library/src/text/raw.rs b/library/src/text/raw.rs index 938224d0..3cf7e8e7 100644 --- a/library/src/text/raw.rs +++ b/library/src/text/raw.rs @@ -41,8 +41,8 @@ use crate::prelude::*; /// /// ### Example /// ```` -/// // Parse numbers in raw blocks with the `mydsl` tag and -/// // sum them up. +/// // Parse numbers in raw blocks with the +/// // `mydsl` tag and sum them up. /// #show raw.where(lang: "mydsl"): it => { /// let sum = 0 /// for part in it.text.split("+") { |
