Skip to content

Commit 5762111

Browse files
committed
Add playground-view config to documentation
1 parent 94225d9 commit 5762111

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

docs/concepts/cdmrc.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ There are only a few key-value pairs you can specify in this file. They are docu
77
## Creating Terminals
88

99
```yaml
10-
terminals: ["echo one", "echo two", "echo three"]
10+
terminals: ['echo one', 'echo two', 'echo three']
1111
```
1212
1313
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
1919
## Default Files
2020

2121
```yaml
22-
tabs: ["src/index.html", "src/folder/script1.js", "README.md"]
22+
tabs: ['src/index.html', 'src/folder/script1.js', 'README.md']
2323
```
2424

2525
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
4444

4545
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`
4646

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+
4759
## Run button
4860

4961
```yaml
@@ -52,8 +64,8 @@ run-button: node $$file
5264

5365
The `run-button` command in a playground does two things:
5466

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.
5769

5870
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.
5971

@@ -84,5 +96,5 @@ terminal-three: echo "we're ready"
8496
browser-link: https://wikipedia.org
8597
run-button: clear && node $$file
8698
live-reload-browser: false
87-
tabs: ["README.md"]
99+
tabs: ['README.md']
88100
```

0 commit comments

Comments
 (0)