create-slidev 0.48.0-beta.8 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-slidev",
3
3
  "type": "module",
4
- "version": "0.48.0-beta.8",
4
+ "version": "0.48.0",
5
5
  "description": "Create starter template for Slidev",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -8,9 +8,9 @@
8
8
  "export": "slidev export"
9
9
  },
10
10
  "dependencies": {
11
- "@slidev/cli": "^0.48.0-beta.8",
11
+ "@slidev/cli": "^0.48.0",
12
12
  "@slidev/theme-default": "latest",
13
13
  "@slidev/theme-seriph": "latest",
14
- "vue": "^3.4.19"
14
+ "vue": "^3.4.21"
15
15
  }
16
16
  }
@@ -1,20 +1,26 @@
1
1
  ---
2
+ # try also 'default' to start simple
2
3
  theme: seriph
3
- background: https://source.unsplash.com/collection/94734566/1920x1080
4
- class: text-center
5
- highlighter: shiki
6
- lineNumbers: false
4
+ # random image from a curated Unsplash collection by Anthony
5
+ # like them? see https://unsplash.com/collections/94734566/slidev
6
+ background: https://cover.sli.dev
7
+ # some information about your slides, markdown enabled
8
+ title: Welcome to Slidev
7
9
  info: |
8
10
  ## Slidev Starter Template
9
11
  Presentation slides for developers.
10
12
 
11
13
  Learn more at [Sli.dev](https://sli.dev)
14
+ # apply any unocss classes to the current slide
15
+ class: text-center
16
+ # https://sli.dev/custom/highlighters.html
17
+ highlighter: shiki
18
+ # https://sli.dev/guide/drawing
12
19
  drawings:
13
20
  persist: false
14
- defaults:
15
- foo: true
21
+ # slide transition: https://sli.dev/guide/animations#slide-transitions
16
22
  transition: slide-left
17
- title: Welcome to Slidev
23
+ # enable MDC Syntax: https://sli.dev/guide/syntax#mdc-syntax
18
24
  mdc: true
19
25
  ---
20
26
 
@@ -125,7 +131,7 @@ Hover on the bottom-left corner to see the navigation's controls panel, [learn m
125
131
 
126
132
  ---
127
133
  layout: image-right
128
- image: https://source.unsplash.com/collection/94734566/1920x1080
134
+ image: https://cover.sli.dev
129
135
  ---
130
136
 
131
137
  # Code
@@ -166,6 +172,92 @@ doubled.value = 2
166
172
  }
167
173
  </style>
168
174
 
175
+ <!--
176
+ Notes can also sync with clicks
177
+
178
+ [click] This will be highlighted after the first click
179
+
180
+ [click] Highlighted with `count = ref(0)`
181
+
182
+ [click:3] Last click (skip two clicks)
183
+ -->
184
+
185
+ ---
186
+ level: 2
187
+ ---
188
+
189
+ # Shiki Magic Move
190
+
191
+ (this feature is still experimental)
192
+
193
+ Powered by [shiki-magic-move](https://shiki-magic-move.netlify.app/), Slidev supports animations across multiple code snippets.
194
+
195
+ Add multiple code blocks and wrap them with <code>````md magic-move</code> (four backticks) to enable the magic move. For example:
196
+
197
+ ````md magic-move
198
+ ```ts {*|2|*}
199
+ // step 1
200
+ const author = reactive({
201
+ name: 'John Doe',
202
+ books: [
203
+ 'Vue 2 - Advanced Guide',
204
+ 'Vue 3 - Basic Guide',
205
+ 'Vue 4 - The Mystery'
206
+ ]
207
+ })
208
+ ```
209
+
210
+ ```ts {*|1-2|3-4|3-4,8}
211
+ // step 2
212
+ export default {
213
+ data() {
214
+ return {
215
+ author: {
216
+ name: 'John Doe',
217
+ books: [
218
+ 'Vue 2 - Advanced Guide',
219
+ 'Vue 3 - Basic Guide',
220
+ 'Vue 4 - The Mystery'
221
+ ]
222
+ }
223
+ }
224
+ }
225
+ }
226
+ ```
227
+
228
+ ```ts
229
+ // step 3
230
+ export default {
231
+ data: () => ({
232
+ author: {
233
+ name: 'John Doe',
234
+ books: [
235
+ 'Vue 2 - Advanced Guide',
236
+ 'Vue 3 - Basic Guide',
237
+ 'Vue 4 - The Mystery'
238
+ ]
239
+ }
240
+ })
241
+ }
242
+ ```
243
+
244
+ Non-code blocks are ignored.
245
+
246
+ ```vue
247
+ <!-- step 4 -->
248
+ <script setup>
249
+ const author = {
250
+ name: 'John Doe',
251
+ books: [
252
+ 'Vue 2 - Advanced Guide',
253
+ 'Vue 3 - Basic Guide',
254
+ 'Vue 4 - The Mystery'
255
+ ]
256
+ }
257
+ </script>
258
+ ```
259
+ ````
260
+
169
261
  ---
170
262
 
171
263
  # Components
@@ -248,6 +340,7 @@ You can add `v-click` to elements to add a click animation.
248
340
  <div v-click>
249
341
 
250
342
  This shows up when you click the slide:
343
+
251
344
  ```html
252
345
  <div v-click>This shows up when you click the slide.</div>
253
346
  ```
@@ -465,6 +558,34 @@ src: ./pages/multiple-entries.md
465
558
  hide: false
466
559
  ---
467
560
 
561
+ ---
562
+
563
+ # Monaco Editor
564
+
565
+ Slidev provides built-in Moanco Editor support.
566
+
567
+ Add `{monaco}` to the code block to turn it into an editor:
568
+
569
+ ```ts {monaco}
570
+ import { ref } from 'vue'
571
+ import hello from './external'
572
+
573
+ const code = ref('const a = 1')
574
+ hello()
575
+ ```
576
+
577
+ Use `{monaco-run}` to create an editor that can execute the code directly in the slide:
578
+
579
+ ```ts {monaco-run}
580
+ function fibonacci(n: number): number {
581
+ return n <= 1
582
+ ? n
583
+ : fibonacci(n - 1) + fibonacci(n - 2) // you know, this is NOT the best way to do it :P
584
+ }
585
+
586
+ console.log(Array.from({ length: 10 }, (_, i) => fibonacci(i + 1)))
587
+ ```
588
+
468
589
  ---
469
590
  layout: center
470
591
  class: text-center