Skip to content

Commit

Permalink
feat: first integration of the playground in the language tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed May 21, 2024
1 parent b7f19c5 commit 73ee3e1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
9 changes: 9 additions & 0 deletions assets/css/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions views/tutorials/language.pug
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ extends ../layout
block header
include ../headers/generic

mixin playground(content)
pre: code.rainbowjs(data-language="arkscript")
| !{content}
- var b64 = btoa(content)
iframe.playground(scrolling="no", src="https://playground.arkscript-lang.dev/#/?termRight&code=" + b64)

block content
div.off-canvas
//- off-screen toggle button
Expand Down Expand Up @@ -59,14 +65,14 @@ block content
br
br
| Example:
pre: code.rainbowjs(data-language="arkscript")
| (let a 12) # immutable variable
| (let a "hello") # cannot redefine constant
| (set a "world") # cannot modify constant, will throw an error
|
| (mut b [12 42 64]) # mutable variable
| (mut b "hello") # no problem, the operation is allowed
| (set b "ArkScript is cool!") # no problem, operation is allowed on mutables
- var example = "(let a 12) # immutable variable\n"
- example += "(let a \"hello\") # cannot redefine constant\n"
- example += "(set a \"world\") # cannot modify constant, will throw an error\n"
- example += "\n"
- example += "(mut b [12 42 64]) # mutable variable\n"
- example += "(mut b \"hello\") # no problem, the operation is allowed\n"
- example += "(set b \"ArkScript is cool!\") # no problem, operation is allowed on mutables"
+playground(example)

section#comments
h2 Comments
Expand Down

0 comments on commit 73ee3e1

Please sign in to comment.