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/tutorialkit.dev/src/content/docs/guides/configuration.mdx
+27-15Lines changed: 27 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ You can configure the appearance and behavior of a TutorialKit lesson by setting
8
8
9
9
## Note on inheritance
10
10
11
-
Some options, like "title," will naturally be unique for each lesson. For others, like "template," the value might be the same across multiple lessons, chapters, or even an entire tutorial. That's why we've made it possible to set some properties on a **chapter**, **part**, or **tutorial** level. We call these values _inherited_.
11
+
Some options, like "title," will naturally be unique for each lesson. For others, like "template," the value might be the same across multiple lessons, chapters, or even an entire tutorial. That's why we've made it possible to set some properties on a **chapter**, **part**, or **tutorial** level. We call these values _inherited_.
12
12
13
-
For instance, if you set `template: "simple"` for a given **part**, all chapters and lessons in this **part** will use the "simple" template.
13
+
For instance, if you set `template: "simple"` for a given **part**, all chapters and lessons in this **part** will use the "simple" template.
14
14
15
15
It's also possible to override inherited properties on a lower level. For example, if you set `template: "simple"` for a **part**, but `template: "advanced"` for a **lesson**, that specific lesson will use the "advanced" template.
16
16
@@ -38,16 +38,16 @@ Defines which file should be opened in the [code editor](/guides/ui/#code-editor
38
38
<PropertyTableinheritedtype="string" />
39
39
40
40
##### `previews`
41
-
Configure which ports should be used for the previews allowing you to align the behavior with your demo application's dev server setup. If not specified, the lowest port will be used.
41
+
Configure which ports should be used for the previews allowing you to align the behavior with your demo application's dev server setup. If not specified, the lowest port will be used.
42
42
43
-
You can optionally provide these as an array of tuples where the first element is the port number and the second is the name of the preview, or as an object.
43
+
You can optionally provide these as an array of tuples where the first element is the port number and the second is the title of the preview, or as an object.
44
44
<PropertyTableinheritedtype={'Preview[]'} />
45
45
46
46
The `Preview` type has the following shape:
47
47
48
48
```ts
49
-
typePreview=string
50
-
| [port: number, title: string]
49
+
typePreview=string
50
+
| [port: number, title: string]
51
51
| { port:number, title:string }
52
52
53
53
```
@@ -59,8 +59,8 @@ The main command to be executed. This command will run after the `prepareCommand
59
59
The `Command` type has the following shape:
60
60
61
61
```ts
62
-
typeCommand=string
63
-
| [command: string, title: string]
62
+
typeCommand=string
63
+
| [command: string, title: string]
64
64
| { command:string, title:string }
65
65
66
66
```
@@ -72,8 +72,8 @@ List of commands to execute sequentially. They are typically used to install dep
72
72
The `Command` type has the following shape:
73
73
74
74
```ts
75
-
typeCommand=string
76
-
| [command: string, title: string]
75
+
typeCommand=string
76
+
| [command: string, title: string]
77
77
| { command:string, title:string }
78
78
79
79
```
@@ -83,6 +83,10 @@ Configures one or more terminals. TutorialKit provides two types of terminals: r
83
83
84
84
You can define which terminal panel will be active by default by specifying the `activePanel` value. The value is the given terminal's position in the `panels` array. If you omit the `activePanel` property, the first panel will be the active one.
85
85
86
+
An interactive terminal will disable the output redirect syntax by default. For instance, you cannot create a file `world.txt` with the contents `hello` using the command `echo hello > world.txt`. The reason is that this could disrupt the lesson if a user overwrites certain files. To allow output redirection, you can change the behavior with the `allowRedirects` setting. You can define this setting either per panel or for all panels at once.
87
+
88
+
Additionally, you may not want users to run arbitrary commands. For example, if you are creating a lesson about `vitest`, you could specify that the only command the user can run is `vitest` by providing a list of `allowCommands`. Any other command executed by the user will be blocked. You can define the `allowCommands` setting either per panel or for all panels at once.
89
+
86
90
By default, in every new lesson terminals start a new session. If you want to keep the terminal session between lessons, you can specify the `id` property for a given terminal panel and keep the same `id` across lessons.
87
91
<PropertyTableinheritedtype="Terminal" />
88
92
@@ -91,12 +95,14 @@ The `Terminal` type has the following shape:
0 commit comments