summaryrefslogtreecommitdiff
path: root/tests/suite/model/outline.typ
diff options
context:
space:
mode:
Diffstat (limited to 'tests/suite/model/outline.typ')
-rw-r--r--tests/suite/model/outline.typ296
1 files changed, 206 insertions, 90 deletions
diff --git a/tests/suite/model/outline.typ b/tests/suite/model/outline.typ
index a8426d6c..a755151d 100644
--- a/tests/suite/model/outline.typ
+++ b/tests/suite/model/outline.typ
@@ -1,112 +1,135 @@
---- outline ---
-#set page(height: 200pt, margin: (bottom: 20pt), numbering: "1")
-#set heading(numbering: "(1/a)")
-#show heading.where(level: 1): set text(12pt)
-#show heading.where(level: 2): set text(10pt)
+--- outline-spacing ---
+#set heading(numbering: "1.a.")
+#set outline.entry(fill: none)
+#show outline.entry.where(level: 1): set block(above: 1.2em)
-#outline(fill: none)
+#outline()
+#show heading: none
= A
-= B
-#lines(3)
+== B
+== C
+= D
+== E
-// This heading is right at the start of the page, so that we can test
-// whether the tag migrates properly.
-#[
- #set heading(outlined: false)
- == C
-]
+--- outline-indent-auto ---
+#set heading(numbering: "I.i.")
+#set page(width: 150pt)
+#show heading: none
-A
+#context test(outline.indent, auto)
+#outline()
+= A
+== B
+== C
== D
+=== Title that breaks across lines
+= E
== F
-==== G
+=== Aligned
---- outline-styled-text ---
-#outline(title: none)
+--- outline-indent-auto-mixed-prefix ---
+#show heading: none
+#show outline.entry.where(level: 1): strong
-= #text(blue)[He]llo
+#outline()
---- outline-bookmark ---
-#outline(title: none, fill: none)
+#set heading(numbering: "I.i.")
+= A
+== B
+=== Title that breaks
+= C
+== D
+= E
+#[
+ #set heading(numbering: none)
+ = F
+ == Numberless title that breaks
+ === G
+]
+= H
+
+--- outline-indent-auto-mixed-prefix-short ---
+#show heading: none
+
+#outline()
+
+#set heading(numbering: "I.i.")
+= A
+#set heading(numbering: none)
+= B
+
+--- outline-indent-auto-no-prefix ---
+#show heading: none
+
+#outline()
-// Ensure 'bookmarked' option doesn't affect the outline
-#set heading(numbering: "(I)", bookmarked: false)
= A
+== B
+=== Title that breaks across lines
+= C
+== D
+=== E
---- outline-indent-numbering ---
-// With heading numbering
-#set page(width: 200pt)
+--- outline-indent-zero ---
#set heading(numbering: "1.a.")
#show heading: none
-#set outline(fill: none)
-#context test(outline.indent, none)
-#outline(indent: none)
-#outline(indent: auto)
-#outline(indent: 2em)
-#outline(indent: n => ([-], [], [==], [====]).at(n))
+#outline(indent: 0pt)
= A
== B
-== C
-=== D
-==== E
+=== C
+==== Title that breaks across lines
+#set heading(numbering: none)
+== E
+= F
---- outline-indent-no-numbering ---
-// Without heading numbering
-#set page(width: 200pt)
+--- outline-indent-fixed ---
+#set heading(numbering: "1.a.")
#show heading: none
-#set outline(fill: none)
-#outline(indent: none)
-#outline(indent: auto)
-#outline(indent: n => 2em * n)
+#outline(indent: 1em)
-= About
-== History
+= A
+== B
+=== C
+==== Title that breaks
+#set heading(numbering: none)
+== E
+= F
---- outline-indent-bad-type ---
-// Error: 2-35 expected relative length or content, found dictionary
-#outline(indent: n => (a: "dict"))
+--- outline-indent-func ---
+#set heading(numbering: "1.a.")
+#show heading: none
-= Heading
+#outline(indent: n => (0pt, 1em, 2.5em, 3em).at(n))
---- outline-first-line-indent ---
-#set par(first-line-indent: 1.5em)
-#set heading(numbering: "1.1.a.")
-#show outline.entry.where(level: 1): it => {
- v(0.5em, weak: true)
- strong(it)
-}
+= A
+== B
+=== C
+==== Title breaks
+#set heading(numbering: none)
+== E
+= F
-#outline()
+--- outline-indent-bad-type ---
+// Error: 2-35 expected relative length, found dictionary
+#outline(indent: n => (a: "dict"))
-= Introduction
-= Background
-== History
-== State of the Art
-= Analysis
-== Setup
+= Heading
--- outline-entry ---
#set page(width: 150pt)
#set heading(numbering: "1.")
-#show outline.entry.where(
- level: 1
-): it => {
- v(12pt, weak: true)
- strong(it)
-}
+#show outline.entry.where(level: 1): set block(above: 12pt)
+#show outline.entry.where(level: 1): strong
#outline(indent: auto)
-#v(1.2em, weak: true)
-
-#set text(8pt)
-#show heading: set block(spacing: 0.65em)
+#show heading: none
= Introduction
= Background
== History
@@ -117,20 +140,23 @@ A
--- outline-entry-complex ---
#set page(width: 150pt, numbering: "I", margin: (bottom: 20pt))
#set heading(numbering: "1.")
-#show outline.entry.where(level: 1): it => [
- #let loc = it.element.location()
- #let num = numbering(loc.page-numbering(), ..counter(page).at(loc))
- #emph(link(loc, it.body))
- #text(luma(100), box(width: 1fr, repeat[#it.fill.body;·]))
- #link(loc, num)
-]
+
+#set outline.entry(fill: repeat[--])
+#show outline.entry.where(level: 1): it => link(
+ it.element.location(),
+ it.indented(it.prefix(), {
+ emph(it.body())
+ [ ]
+ text(luma(100), box(width: 1fr, repeat[--·--]))
+ [ ]
+ it.page()
+ })
+)
#counter(page).update(3)
-#outline(indent: auto, fill: repeat[--])
-#v(1.2em, weak: true)
+#outline()
-#set text(8pt)
-#show heading: set block(spacing: 0.65em)
+#show heading: none
= Top heading
== Not top heading
@@ -145,30 +171,120 @@ A
== Middle heading
=== Lower heading
+--- outline-entry-inner ---
+#set heading(numbering: "1.")
+#show outline.entry: it => block(it.inner())
+#show heading: none
+
+#set outline.entry(fill: repeat[ -- ])
+#outline()
+
+= A
+= B
+
+--- outline-heading-start-of-page ---
+#set page(width: 140pt, height: 200pt, margin: (bottom: 20pt), numbering: "1")
+#set heading(numbering: "(1/a)")
+#show heading.where(level: 1): set text(12pt)
+#show heading.where(level: 2): set text(10pt)
+
+#set outline.entry(fill: none)
+#outline()
+
+= A
+= B
+#lines(3)
+
+// This heading is right at the start of the page, so that we can test
+// whether the tag migrates properly.
+#[
+ #set heading(outlined: false)
+ == C
+]
+
+A
+
+== D
+== F
+==== G
+
+--- outline-bookmark ---
+// Ensure that `bookmarked` option doesn't affect the outline
+#set heading(numbering: "(I)", bookmarked: false)
+#set outline.entry(fill: none)
+#show heading: none
+#outline()
+
+= A
+
+--- outline-styled-text ---
+#outline(title: none)
+
+= #text(blue)[He]llo
+
+--- outline-first-line-indent ---
+#set par(first-line-indent: 1.5em)
+#set heading(numbering: "1.1.a.")
+#show outline.entry.where(level: 1): strong
+
+#outline()
+
+#show heading: none
+= Introduction
+= Background
+== History
+== State of the Art
+= Analysis
+== Setup
+
--- outline-bad-element ---
// Error: 2-27 cannot outline metadata
#outline(target: metadata)
#metadata("hello")
+
+--- issue-2048-outline-multiline ---
+// Without the word joiner between the dots and the page number,
+// the page number would be alone in its line.
+#set page(width: 125pt)
+#set heading(numbering: "1.a.")
+#show heading: none
+
+#outline()
+
+= A
+== This just fits here
+
--- issue-2530-outline-entry-panic-text ---
// Outline entry (pre-emptive)
-// Error: 2-48 cannot outline text
-#outline.entry(1, [Hello], [World!], none, [1])
+// Error: 2-27 cannot outline text
+#outline.entry(1, [Hello])
--- issue-2530-outline-entry-panic-heading ---
// Outline entry (pre-emptive, improved error)
-// Error: 2-55 heading must have a location
-// Hint: 2-55 try using a query or a show rule to customize the outline.entry instead
-#outline.entry(1, heading[Hello], [World!], none, [1])
+// Error: 2-34 heading must have a location
+// Hint: 2-34 try using a show rule to customize the outline.entry instead
+#outline.entry(1, heading[Hello])
---- issue-4476-rtl-title-ending-in-ltr-text ---
+--- issue-4476-outline-rtl-title-ending-in-ltr-text ---
#set text(lang: "he")
#outline()
+#show heading: none
= הוקוס Pocus
= זוהי כותרת שתורגמה על ידי מחשב
---- issue-5176-cjk-title ---
+--- issue-4859-outline-entry-show-set ---
+#set heading(numbering: "1.a.")
+#show outline.entry.where(level: 1): set outline.entry(fill: none)
+#show heading: none
+
+#outline()
+
+= A
+== B
+
+--- issue-5176-outline-cjk-title ---
#set text(font: "Noto Serif CJK SC")
#show heading: none