You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/cdmrc.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ There are only a few key-value pairs you can specify in this file. They are docu
7
7
## Creating Terminals
8
8
9
9
```yaml
10
-
terminals: ["echo one", "echo two", "echo three"]
10
+
terminals: ['echo one', 'echo two', 'echo three']
11
11
```
12
12
13
13
The `terminals` key can be use to execute commands in the terminal instances. You can boot up to **6** terminals instances. The `terminals` array in the `.cdmrc` can only contain 6 elements in them.
@@ -19,7 +19,7 @@ Note that the terminals will not execute in the same order as given in the array
The `tabs` field in the `.cdmrc` is an array of strings. Once specified, whenever your playground boots for the first time - it would open the mentioned files by default in the Monaco editor.
@@ -44,6 +44,18 @@ Therefore, you can disable platform-level live reloading using the syntax shown
44
44
45
45
The TL;DR of this block is - if you feel the embedded webview on your playground is refreshing on every change, you can disable it setting `live-reload-browser` as `false`
46
46
47
+
## Playground view
48
+
49
+
```yaml
50
+
playground-view: terminal-editor-browser
51
+
```
52
+
53
+
There are three possible views for playground you can specify in this configuration:
54
+
55
+
- `terminal-editor-browser`: This view includes terminal, editor and browser preview. It is the best and recommended view if you intend to use a frontend webserver to display output.
56
+
- `terminal-editor`: This view includes a terminal and an editor only. It is good for programming where no web server is involved. For example, writing a sorting algorithm in C++ may not need a web server output.
57
+
- `terminal-browser`: This view includes only the terminal and browser. You can combine it with `browser-link` too.
58
+
47
59
## Run button
48
60
49
61
```yaml
@@ -52,8 +64,8 @@ run-button: node $$file
52
64
53
65
The `run-button` command in a playground does two things:
54
66
55
-
- It makes a new button saying "Run Code" visible on your playground.
56
-
- When you click on that "Run Code" button - it executes that command in the first terminal. However, we **automatically** run a **CTRL + C** sequence as well to terminate any previously running program. Therefore, anything running in the foreground on your first terminal would get terminated.
67
+
- It makes a new button saying "Run Code" visible on your playground.
68
+
- When you click on that "Run Code" button - it executes that command in the first terminal. However, we **automatically** run a **CTRL + C** sequence as well to terminate any previously running program. Therefore, anything running in the foreground on your first terminal would get terminated.
57
69
58
70
This is especially useful when you're working with, say, a program that requires you to run the same command over and over again. You can open a C++ playground on codedamn and configure the command as `gcc script.c -o script && ./script` and every time you click on `Run Code` button, it'll execute this script.
0 commit comments