Skip to content

Commit 95c7e65

Browse files
authored
Merge branch 'main' into add-new-files-in-paths
2 parents 69f7cd3 + e1e9160 commit 95c7e65

File tree

4 files changed

+40
-4
lines changed

4 files changed

+40
-4
lines changed

docs/tutorialkit.dev/src/content/docs/guides/creating-content.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,39 @@ const removed = 'This line was removed';
192192
const highlighted = 'This line is highlighted';
193193
```
194194

195+
#### Useful Expressive Code Attributes
196+
197+
- **`title`** - Sets the title of the code block.
198+
- **`frame`** - Defines the frame of the code block. Options: `"code"`, `"terminal"`, `"none"`, `"auto"`.
199+
- **`showLineNumbers`** - Displays line numbers. You can combine this with `startLineNumber=#` to begin numbering from a specific line.
200+
- **`wrap`** - Controls word wrapping. Use `preserveIndent` and `preserveIndent=false` to adjust indentation handling.
201+
202+
##### Marking Lines
203+
204+
- **`{x}`** - Marks specific lines. For example, `{6,10-18}` will mark lines 6 and 10 through 18.
205+
- **`ins`** - Marks inserted lines. Example: `ins={6,10-18}`.
206+
- **`del`** - Marks deleted lines. Example: `del={6,10-18}`.
207+
- **`{"Label":x}`** - Assigns a label to a line or range of lines. Works with `mark`, `ins`, and `del`. Example: `{"Label1":5} del={"Label2":7-8} ins={"Label3":10-12}`. If the label is long, consider placing an empty line in the code for better readability.
208+
- **`collapse={X-Y}`** - Collapses the specified lines. Example: `collapse={1-5,12-14}`.
209+
210+
##### Marking Text
211+
212+
You can highlight text using strings or regular expressions. For example:
213+
214+
````md
215+
```jsx "hello" /ye[sp]/ add=/add[12]/ del=/remove[12]/
216+
console.log(
217+
'Hello, the words yes and yep will be marked. Also add1, add2, remove1, remove2',
218+
)
219+
```
220+
````
221+
222+
```jsx "hello" /ye[sp]/ add=/add[12]/ del=/remove[12]/
223+
console.log(
224+
'Hello, the words yes and yep will be marked. Also add1, add2, remove1, remove2',
225+
)
226+
```
227+
195228
#### Importing files
196229

197230
In addition to Expressive Code features, you can import files from your code template `_files` and `_solution` folders using the file or solution shortcodes. These shortcodes insert the content of the specified file directly into your lesson content.

docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ editor: # Editor is visible
221221
222222
##### `previews`
223223
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.
224-
225-
<PropertyTable inherited type={'Preview[]'} />
224+
Optionally you can hide the preview by providing `previews: false`.
225+
<PropertyTable inherited type={'Preview[] | false'} />
226226

227227
The `Preview` type has the following shape:
228228

@@ -246,6 +246,9 @@ previews:
246246
- [3003, "Dev Server", "/docs"] # Preview is on :3003/docs/. Displayed title is "Dev Server".
247247
- { port: 3004, title: "Dev Server" } # Preview is on :3004/. Displayed title is "Dev Server".
248248
- { port: 3005, title: "Dev Server", pathname: "/docs" } # Preview is on :3005/docs/. Displayed title is "Dev Server".
249+
250+
previews: false # Do not show preview panel
251+
249252
```
250253

251254
##### `mainCommand`

packages/react/src/Panels/EditorPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function EditorPanel({
7979
</div>
8080
</div>
8181
<FileTree
82-
className="flex-grow py-2 border-r border-tk-elements-app-borderColor text-sm"
82+
className="flex flex-col flex-grow py-2 border-r border-tk-elements-app-borderColor text-sm overflow-y-auto overflow-x-hidden"
8383
i18n={i18n}
8484
selectedFile={selectedFile}
8585
hideRoot={hideRoot ?? true}

packages/react/src/core/FileTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function FileTree({
125125
directory=""
126126
onFileChange={onFileChange}
127127
allowEditPatterns={allowEditPatterns}
128-
triggerProps={{ className: 'h-full', 'data-testid': 'file-tree-root-context-menu' }}
128+
triggerProps={{ className: 'h-full min-h-4', 'data-testid': 'file-tree-root-context-menu' }}
129129
/>
130130
</div>
131131
);

0 commit comments

Comments
 (0)