Skip to content

Commit 66e0f38

Browse files
authored
🖊️ type code block syntax highlighting
1 parent 23c6f52 commit 66e0f38

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,21 @@ That's it. When you navigate to the slide, a VS Code instance starts automatical
5050

5151
## 📂 Open a specific workspace
5252

53-
```vue
53+
```js
5454
<Editor session="demo" defaultFolder="/path/to/your/project" />
5555
```
5656

5757
Both absolute and relative paths are supported. Relative paths are resolved from the Slidev project root:
5858

59-
```vue
59+
```jsx
6060
<Editor session="demo" defaultFolder=".." />
6161
```
6262

6363
## 🌗 Color scheme
6464

6565
Force VS Code to use a specific color theme:
6666

67-
```vue
67+
```js
6868
<Editor session="demo" colorScheme="dark" />
6969
<Editor session="demo" colorScheme="light" />
7070
```
@@ -75,7 +75,7 @@ If omitted, the color scheme automatically follows your Slidev presentation's `c
7575

7676
VS Code can appear too large inside a slide. Use the `zoom` prop to scale it down:
7777

78-
```vue
78+
```js
7979
<Editor session="demo" :zoom="0.8" />
8080
```
8181

@@ -90,21 +90,21 @@ livecode:
9090
9191
The editor container is a plain `div` — pass any `class` or `style` to control its appearance:
9292

93-
```vue
93+
```js
9494
<Editor session="demo" class="rounded-2xl border border-gray-200 shadow-xl" style="height: 480px" />
9595
```
9696

9797
Works with Tailwind utilities too:
9898

99-
```vue
99+
```js
100100
<Editor session="demo" class="h-[480px] w-full rounded-2xl border border-gray-200 shadow-lg" />
101101
```
102102

103103
## 🎯 Keyboard navigation guard
104104

105105
Use `disableInitialFocus` to prevent VS Code from stealing keyboard focus when you navigate to a slide — arrow keys keep working for Slidev navigation:
106106

107-
```vue
107+
```js
108108
<Editor session="demo" disableInitialFocus />
109109
```
110110

@@ -114,7 +114,7 @@ Focus is held on the slide, after an interaction, the user can interact with VS
114114

115115
Use `preload` to warm up the VS Code session before the user reaches the slide. Slidev mounts adjacent slides in the background, so the session can start while the user is still on the previous slide:
116116

117-
```vue
117+
```js
118118
<Editor session="demo" preload />
119119
```
120120

@@ -124,7 +124,7 @@ Combine with `disableInitialFocus` for a seamless experience — the IDE is read
124124

125125
By default, navigating away from a slide stops the session. Use `persist` to keep it running:
126126

127-
```vue
127+
```js
128128
<Editor session="demo" persist />
129129
```
130130

@@ -189,7 +189,7 @@ Pair `<Editor />` with other addons for a fully self-contained demo environment
189189
- **[slidev-addon-liveshell](https://npmx.dev/package/slidev-addon-liveshell)** — embed a live terminal directly in your slide alongside the editor.
190190
- **An `<iframe>` pointing to your dev server** — embed your running app next to the editor. Edit code in VS Code, and the hot reload updates the iframe in real time, all without leaving the presentation.
191191

192-
```vue
192+
```js
193193
<div class="flex gap-2 flex-1">
194194
<Editor session="demo" class="w-1/2" />
195195
<iframe src="http://localhost:5173" class="w-1/2" />

0 commit comments

Comments
 (0)