summaryrefslogtreecommitdiff
path: root/crates/typst-library
diff options
context:
space:
mode:
authorAndrew Voynov <37143421+Andrew15-5@users.noreply.github.com>2025-06-24 12:56:58 +0300
committerGitHub <noreply@github.com>2025-06-24 09:56:58 +0000
commit24293a6c121a4b4e02c32901fec44e0093aa5d8c (patch)
tree6db7b9288bb1997a01a487a957cc61f5478544b7 /crates/typst-library
parent87cb8f5094b9ea45893344143ca069a521f9ba47 (diff)
Rewrite `outline.indent` example (#6383)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates/typst-library')
-rw-r--r--crates/typst-library/src/model/outline.rs35
1 files changed, 16 insertions, 19 deletions
diff --git a/crates/typst-library/src/model/outline.rs b/crates/typst-library/src/model/outline.rs
index 489c375e..16a11614 100644
--- a/crates/typst-library/src/model/outline.rs
+++ b/crates/typst-library/src/model/outline.rs
@@ -225,25 +225,21 @@ pub struct OutlineElem {
/// to just specifying `{2em}`.
///
/// ```example
- /// #set heading(numbering: "1.a.")
+ /// >>> #show heading: none
+ /// #set heading(numbering: "I-I.")
+ /// #set outline(title: none)
///
- /// #outline(
- /// title: [Contents (Automatic)],
- /// indent: auto,
- /// )
- ///
- /// #outline(
- /// title: [Contents (Length)],
- /// indent: 2em,
- /// )
- ///
- /// = About ACME Corp.
- /// == History
- /// === Origins
- /// #lorem(10)
+ /// #outline()
+ /// #line(length: 100%)
+ /// #outline(indent: 3em)
///
- /// == Products
- /// #lorem(10)
+ /// = Software engineering technologies
+ /// == Requirements
+ /// == Tools and technologies
+ /// === Code editors
+ /// == Analyzing alternatives
+ /// = Designing software components
+ /// = Testing and integration
/// ```
pub indent: Smart<OutlineIndent>,
}
@@ -450,8 +446,9 @@ impl OutlineEntry {
/// at the same level are aligned.
///
/// If the outline's indent is a fixed value or a function, the prefixes are
- /// indented, but the inner contents are simply inset from the prefix by the
- /// specified `gap`, rather than aligning outline-wide.
+ /// indented, but the inner contents are simply offset from the prefix by
+ /// the specified `gap`, rather than aligning outline-wide. For a visual
+ /// explanation, see [`outline.indent`]($outline.indent).
#[func(contextual)]
pub fn indented(
&self,