summaryrefslogtreecommitdiff
path: root/tests/typ
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-04-23 21:55:58 +0200
committerLaurenz <laurmaedje@gmail.com>2022-04-23 21:55:58 +0200
commit04fb8b288aa7c80607da79db7d085a4820b95a9d (patch)
tree7ca96d09d511274ebac298c329d5eef53a290d9c /tests/typ
parent7a2cc3e7d29d16c5cf9b5a93a688e14da93c8662 (diff)
Show rules with type ascribed object
Diffstat (limited to 'tests/typ')
-rw-r--r--tests/typ/style/show.typ30
1 files changed, 12 insertions, 18 deletions
diff --git a/tests/typ/style/show.typ b/tests/typ/style/show.typ
index 7a5aba8f..9aabfb34 100644
--- a/tests/typ/style/show.typ
+++ b/tests/typ/style/show.typ
@@ -4,13 +4,13 @@
#let i = 1
#set heading(size: 1em)
-#show heading(level, body) as {
- if level == 1 {
+#show node: heading as {
+ if node.level == 1 {
v(10pt)
- underline(text(1.5em, blue)[{i}. #body])
+ underline(text(1.5em, blue)[{i}. {node.body}])
i += 1
} else {
- text(red, body)
+ text(red, node.body)
}
}
@@ -30,29 +30,23 @@ Another text.
---
#set heading(size: 1em, strong: false, block: false)
-#show heading(a, b) as [B]
+#show _: heading as [B]
A [= Heading] C
---
-// Error: 14-22 unexpected argument
-#show heading() as []
+// Error: 21-25 expected content, found string
+#show _: heading as "hi"
= Heading
---
-// Error: 14-28 expected content, found string
-#show heading(_, _) as "hi"
+// Error: 22-29 dictionary does not contain key: "page"
+#show it: heading as it.page
= Heading
---
-// Error: 7-12 this function cannot be customized with show
-#show upper() as {}
-
----
-// Ref: false
-// // Error: 1-29 show rule is recursive
-// #show strong(x) as strong(x)
-// *Hi*
+// Error: 10-15 this function cannot be customized with show
+#show _: upper as {}
---
// Error: 2-19 set, show and wrap are only allowed directly in markup
-{show list(a) as b}
+{show a: list as a}