create-slidev 0.48.0-beta.9 → 0.48.1

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.9",
4
+ "version": "0.48.1",
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.9",
11
+ "@slidev/cli": "^0.48.1",
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
 
@@ -84,18 +90,6 @@ h1 {
84
90
  Here is another comment.
85
91
  -->
86
92
 
87
- ---
88
- layout: default
89
- ---
90
-
91
- # Table of contents
92
-
93
- ```html
94
- <Toc minDepth="1" maxDepth="1"></Toc>
95
- ```
96
-
97
- <Toc maxDepth="1"></Toc>
98
-
99
93
  ---
100
94
  transition: slide-up
101
95
  level: 2
@@ -123,9 +117,28 @@ Hover on the bottom-left corner to see the navigation's controls panel, [learn m
123
117
  />
124
118
  <p v-after class="absolute bottom-23 left-45 opacity-30 transform -rotate-10">Here!</p>
125
119
 
120
+ ---
121
+ layout: two-cols
122
+ layoutClass: gap-16
123
+ ---
124
+
125
+ # Table of contents
126
+
127
+ You can use the `Toc` component to generate a table of contents for your slides:
128
+
129
+ ```html
130
+ <Toc minDepth="1" maxDepth="1"></Toc>
131
+ ```
132
+
133
+ The title will be inferred from your slide content, or you can override it with `title` and `level` in your frontmatter.
134
+
135
+ ::right::
136
+
137
+ <Toc v-click minDepth="1" maxDepth="2"></Toc>
138
+
126
139
  ---
127
140
  layout: image-right
128
- image: https://source.unsplash.com/collection/94734566/1920x1080
141
+ image: https://cover.sli.dev
129
142
  ---
130
143
 
131
144
  # Code
@@ -166,6 +179,90 @@ doubled.value = 2
166
179
  }
167
180
  </style>
168
181
 
182
+ <!--
183
+ Notes can also sync with clicks
184
+
185
+ [click] This will be highlighted after the first click
186
+
187
+ [click] Highlighted with `count = ref(0)`
188
+
189
+ [click:3] Last click (skip two clicks)
190
+ -->
191
+
192
+ ---
193
+ level: 2
194
+ ---
195
+
196
+ # Shiki Magic Move
197
+
198
+ Powered by [shiki-magic-move](https://shiki-magic-move.netlify.app/), Slidev supports animations across multiple code snippets.
199
+
200
+ Add multiple code blocks and wrap them with <code>````md magic-move</code> (four backticks) to enable the magic move. For example:
201
+
202
+ ````md magic-move
203
+ ```ts {*|2|*}
204
+ // step 1
205
+ const author = reactive({
206
+ name: 'John Doe',
207
+ books: [
208
+ 'Vue 2 - Advanced Guide',
209
+ 'Vue 3 - Basic Guide',
210
+ 'Vue 4 - The Mystery'
211
+ ]
212
+ })
213
+ ```
214
+
215
+ ```ts {*|1-2|3-4|3-4,8}
216
+ // step 2
217
+ export default {
218
+ data() {
219
+ return {
220
+ author: {
221
+ name: 'John Doe',
222
+ books: [
223
+ 'Vue 2 - Advanced Guide',
224
+ 'Vue 3 - Basic Guide',
225
+ 'Vue 4 - The Mystery'
226
+ ]
227
+ }
228
+ }
229
+ }
230
+ }
231
+ ```
232
+
233
+ ```ts
234
+ // step 3
235
+ export default {
236
+ data: () => ({
237
+ author: {
238
+ name: 'John Doe',
239
+ books: [
240
+ 'Vue 2 - Advanced Guide',
241
+ 'Vue 3 - Basic Guide',
242
+ 'Vue 4 - The Mystery'
243
+ ]
244
+ }
245
+ })
246
+ }
247
+ ```
248
+
249
+ Non-code blocks are ignored.
250
+
251
+ ```vue
252
+ <!-- step 4 -->
253
+ <script setup>
254
+ const author = {
255
+ name: 'John Doe',
256
+ books: [
257
+ 'Vue 2 - Advanced Guide',
258
+ 'Vue 3 - Basic Guide',
259
+ 'Vue 4 - The Mystery'
260
+ ]
261
+ }
262
+ </script>
263
+ ```
264
+ ````
265
+
169
266
  ---
170
267
 
171
268
  # Components
@@ -248,6 +345,7 @@ You can add `v-click` to elements to add a click animation.
248
345
  <div v-click>
249
346
 
250
347
  This shows up when you click the slide:
348
+
251
349
  ```html
252
350
  <div v-click>This shows up when you click the slide.</div>
253
351
  ```
@@ -465,6 +563,34 @@ src: ./pages/multiple-entries.md
465
563
  hide: false
466
564
  ---
467
565
 
566
+ ---
567
+
568
+ # Monaco Editor
569
+
570
+ Slidev provides built-in Moanco Editor support.
571
+
572
+ Add `{monaco}` to the code block to turn it into an editor:
573
+
574
+ ```ts {monaco}
575
+ import { ref } from 'vue'
576
+ import hello from './external'
577
+
578
+ const code = ref('const a = 1')
579
+ hello()
580
+ ```
581
+
582
+ Use `{monaco-run}` to create an editor that can execute the code directly in the slide:
583
+
584
+ ```ts {monaco-run}
585
+ function fibonacci(n: number): number {
586
+ return n <= 1
587
+ ? n
588
+ : fibonacci(n - 1) + fibonacci(n - 2) // you know, this is NOT the best way to do it :P
589
+ }
590
+
591
+ console.log(Array.from({ length: 10 }, (_, i) => fibonacci(i + 1)))
592
+ ```
593
+
468
594
  ---
469
595
  layout: center
470
596
  class: text-center