summaryrefslogtreecommitdiff
path: root/tests/typ/layout/terms.typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-13 16:50:57 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-13 16:50:57 +0100
commit8f68bc7a8ea619af12d95bec7025bd9f3a86625f (patch)
tree7f9b454ed419b45d7787de4ace992b40078d4072 /tests/typ/layout/terms.typ
parentb1b4e52af9e2da8f8ae1fc17a81ed6cbcbb8f525 (diff)
Dissolve basics folder
Diffstat (limited to 'tests/typ/layout/terms.typ')
-rw-r--r--tests/typ/layout/terms.typ52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/typ/layout/terms.typ b/tests/typ/layout/terms.typ
new file mode 100644
index 00000000..57864423
--- /dev/null
+++ b/tests/typ/layout/terms.typ
@@ -0,0 +1,52 @@
+// Test term list.
+
+---
+// Test with constructor.
+#terms(
+ ([One], [First]),
+ ([Two], [Second]),
+)
+
+---
+// Test joining.
+#for word in lorem(4).split().map(s => s.trim(".")) [
+ / #word: Latin stuff.
+]
+
+---
+// Test multiline.
+#set text(8pt)
+
+/ Fruit: A tasty, edible thing.
+/ Veggie:
+ An important energy source
+ for vegetarians.
+
+---
+// Test style change.
+#set text(8pt)
+/ First list: #lorem(4)
+
+#set terms(hanging-indent: 30pt)
+/ Second list: #lorem(4)
+
+---
+// Test grid like show rule.
+#show terms: it => table(
+ columns: 2,
+ inset: 3pt,
+ ..it.items.map(item => (emph(item.at(0)), item.at(1))).flatten(),
+)
+
+/ A: One letter
+/ BB: Two letters
+/ CCC: Three letters
+
+---
+/ Term:
+Not in list
+/Nope
+
+---
+// Error: 8 expected colon
+/ Hello