summaryrefslogtreecommitdiff
path: root/tests/suite/layout/hide.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2024-04-13 10:39:45 +0200
committerGitHub <noreply@github.com>2024-04-13 08:39:45 +0000
commit020294fca9a7065d4b9cf4e677f606ebaaa29b00 (patch)
treec0027ad22046e2726c22298461327823d6b88d53 /tests/suite/layout/hide.typ
parent72dd79210602ecc799726fc096b078afbb47f299 (diff)
Better test runner (#3922)
Diffstat (limited to 'tests/suite/layout/hide.typ')
-rw-r--r--tests/suite/layout/hide.typ104
1 files changed, 104 insertions, 0 deletions
diff --git a/tests/suite/layout/hide.typ b/tests/suite/layout/hide.typ
new file mode 100644
index 00000000..a10090d7
--- /dev/null
+++ b/tests/suite/layout/hide.typ
@@ -0,0 +1,104 @@
+// Test the `hide` function.
+
+--- hide-text ---
+AB #h(1fr) CD \
+#hide[A]B #h(1fr) C#hide[D]
+
+--- hide-line ---
+Hidden:
+#hide[#line(length: 100%)]
+#line(length: 100%)
+
+--- hide-table ---
+Hidden:
+#hide(table(rows: 2, columns: 2)[a][b][c][d])
+#table(rows: 2, columns: 2)[a][b][c][d]
+
+--- hide-polygon ---
+Hidden:
+#hide[
+ #polygon((20%, 0pt),
+ (60%, 0pt),
+ (80%, 2cm),
+ (0%, 2cm),)
+]
+#polygon((20%, 0pt),
+ (60%, 0pt),
+ (80%, 2cm),
+ (0%, 2cm),)
+
+--- hide-rect ---
+#set rect(
+ inset: 8pt,
+ fill: rgb("e4e5ea"),
+ width: 100%,
+)
+
+Hidden:
+#hide[
+#grid(
+ columns: (1fr, 1fr, 2fr),
+ rows: (auto, 40pt),
+ gutter: 3pt,
+ rect[A],
+ rect[B],
+ rect[C],
+ rect(height: 100%)[D],
+)
+]
+#grid(
+ columns: (1fr, 1fr, 2fr),
+ rows: (auto, 40pt),
+ gutter: 3pt,
+ rect[A],
+ rect[B],
+ rect[C],
+ rect(height: 100%)[D],
+)
+
+--- hide-list ---
+Hidden:
+#hide[
+- 1
+- 2
+ 1. A
+ 2. B
+- 3
+]
+
+
+- 1
+- 2
+ 1. A
+ 2. B
+- 3
+
+--- hide-image ---
+Hidden:
+#hide(image("/assets/images/tiger.jpg", width: 5cm, height: 1cm,))
+
+#image("/assets/images/tiger.jpg", width: 5cm, height: 1cm,)
+
+--- issue-622-hide-meta-cite ---
+// Test that metadata of hidden stuff stays available.
+#set cite(style: "chicago-notes")
+
+A pirate. @arrgh \
+#set text(2pt)
+#hide[
+ A @arrgh pirate.
+ #bibliography("/assets/bib/works.bib")
+]
+
+--- issue-622-hide-meta-outline ---
+#set text(8pt)
+#outline()
+#set text(2pt)
+#hide(block(grid(
+ [= A],
+ [= B],
+ block(grid(
+ [= C],
+ [= D],
+ ))
+)))