@@ -3,6 +3,12 @@ extends ../layout
3
3
block header
4
4
include ../headers/generic
5
5
6
+ mixin playground(content )
7
+ pre: code.rainbowjs ( data-language ="arkscript" )
8
+ | !{content}
9
+ - var b64 = btoa (content)
10
+ iframe.playground ( scrolling ="no" , src ="https://playground.arkscript-lang.dev/#/?termRight&code=" + b64)
11
+
6
12
block content
7
13
div.off-canvas
8
14
//- off-screen toggle button
@@ -59,14 +65,14 @@ block content
59
65
br
60
66
br
61
67
| Example:
62
- pre: code .rainbowjs ( data-language = "arkscript" )
63
- | (let a 12 ) # immutable variable
64
- | (let a "hello ") # cannot redefine constant
65
- | (set a "world") # cannot modify constant, will throw an error
66
- |
67
- | (mut b [ 12 42 64 ] ) # mutable variable
68
- | (mut b "hello ") # no problem, the operation is allowed
69
- | (set b "ArkScript is cool!") # no problem, operation is allowed on mutables
68
+ - var example = " (let a 12) # immutable variable \n "
69
+ - example += " (let a \" hello \" ) # cannot redefine constant \n "
70
+ - example += " (set a \" world \ " ) # cannot modify constant, will throw an error \n "
71
+ - example += " \n "
72
+ - example += " (mut b [12 42 64]) # mutable variable \n "
73
+ - example += " (mut b \" hello \" ) # no problem, the operation is allowed \n "
74
+ - example += " (set b \" ArkScript is cool! \ " ) # no problem, operation is allowed on mutables "
75
+ + playground(example)
70
76
71
77
section#comments
72
78
h2 Comments
0 commit comments