create-slidev 0.48.0-beta.21 → 0.48.0-beta.23

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.21",
4
+ "version": "0.48.0-beta.23",
5
5
  "description": "Create starter template for Slidev",
6
6
  "author": "antfu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -8,7 +8,7 @@
8
8
  "export": "slidev export"
9
9
  },
10
10
  "dependencies": {
11
- "@slidev/cli": "^0.48.0-beta.21",
11
+ "@slidev/cli": "^0.48.0-beta.23",
12
12
  "@slidev/theme-default": "latest",
13
13
  "@slidev/theme-seriph": "latest",
14
14
  "vue": "^3.4.21"
@@ -1,23 +1,27 @@
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
- monaco: true
20
- monacoTypesSource: local # or cdn or none
21
25
  ---
22
26
 
23
27
  # Welcome to Slidev
@@ -127,7 +131,7 @@ Hover on the bottom-left corner to see the navigation's controls panel, [learn m
127
131
 
128
132
  ---
129
133
  layout: image-right
130
- image: https://source.unsplash.com/collection/94734566/1920x1080
134
+ image: https://cover.sli.dev
131
135
  ---
132
136
 
133
137
  # Code
@@ -191,7 +195,8 @@ Powered by [shiki-magic-move](https://shiki-magic-move.netlify.app/), Slidev sup
191
195
  Add multiple code blocks and wrap them with <code>````md magic-move</code> (four backticks) to enable the magic move. For example:
192
196
 
193
197
  ````md magic-move
194
- ```ts
198
+ ```ts {*|2|*}
199
+ // step 1
195
200
  const author = reactive({
196
201
  name: 'John Doe',
197
202
  books: [
@@ -202,7 +207,8 @@ const author = reactive({
202
207
  })
203
208
  ```
204
209
 
205
- ```ts
210
+ ```ts {*|1-2|3-4|3-4,8}
211
+ // step 2
206
212
  export default {
207
213
  data() {
208
214
  return {
@@ -220,6 +226,7 @@ export default {
220
226
  ```
221
227
 
222
228
  ```ts
229
+ // step 3
223
230
  export default {
224
231
  data: () => ({
225
232
  author: {
@@ -233,6 +240,22 @@ export default {
233
240
  })
234
241
  }
235
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
+ ```
236
259
  ````
237
260
 
238
261
  ---
@@ -539,6 +562,10 @@ hide: false
539
562
 
540
563
  # Monaco Editor
541
564
 
565
+ Slidev provides built-in Moanco Editor support.
566
+
567
+ Add `{monaco}` to the code block to turn it into an editor:
568
+
542
569
  ```ts {monaco}
543
570
  import { ref } from 'vue'
544
571
  import hello from './external'
@@ -547,6 +574,18 @@ const code = ref('const a = 1')
547
574
  hello()
548
575
  ```
549
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
+
550
589
  ---
551
590
  layout: center
552
591
  class: text-center