Skip to content

Commit 80be226

Browse files
authoredDec 13, 2023
feat: support shikiji highlighter and twoslash integration (#1218)
1 parent 92d488e commit 80be226

34 files changed

+1390
-1600
lines changed
 

‎.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// Auto fix
1818
"editor.codeActionsOnSave": {
1919
"source.fixAll.eslint": "explicit",
20-
"source.organizeImports": false
20+
"source.organizeImports": "never"
2121
},
2222

2323
// Silent the stylistic rules in you IDE, but still auto fix them

‎CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Excited to hear that you are interested in contributing to this project! Thanks!
44

5-
## Documentations
5+
## Documentations
66

77
Documentations are now moved to [`slidevjs/docs`](https://github.com/slidevjs/docs) repo.
88

@@ -20,13 +20,13 @@ This project uses [`pnpm`](https://pnpm.io/) to manage the dependencies, install
2020
npm i -g pnpm
2121
```
2222

23-
Clone this repo to your local machine and install the dependencies.
23+
Clone this repo to your local machine and install the dependencies.
2424

2525
```bash
2626
pnpm install
2727
```
2828

29-
## Development
29+
## Development
3030

3131
To build all the packages at once, run the following command on the project root
3232

‎cypress/fixtures/basic/slides.md

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ Current Page: {{$slidev.nav.currentPage}}
5555

5656
</v-clicks>
5757

58-
5958
<v-clicks>
6059

6160
1. C

‎demo/composable-vue/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"export:clicks": "slidev export --with-clicks"
88
},
99
"devDependencies": {
10-
"@iconify-json/mdi": "^1.1.58",
11-
"@iconify-json/ri": "^1.1.15",
10+
"@iconify-json/mdi": "^1.1.62",
11+
"@iconify-json/ri": "^1.1.17",
1212
"@slidev/cli": "workspace:*",
1313
"@slidev/theme-default": "^0.21.2",
1414
"@slidev/theme-seriph": "^0.21.3",

‎demo/composable-vue/slides.md

-43
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Anthony Fu
3131
</div>
3232
</div>
3333

34-
3534
---
3635
layout: 'intro'
3736
---
@@ -55,7 +54,6 @@ A fanatical full-time open sourceror.<br>
5554

5655
<img src="https://antfu.me/avatar.png" class="rounded-full w-40 abs-tr mt-16 mr-12" alt="A comic art image of Anthony Fu"/>
5756

58-
5957
---
6058
name: Sponsors
6159
layout: center
@@ -74,7 +72,6 @@ layout: center
7472

7573
# Composable Vue
7674

77-
7875
---
7976
name: VueUse
8077
layout: center
@@ -106,7 +103,6 @@ layout: center
106103
</div>
107104
</div>
108105

109-
110106
---
111107
layout: center
112108
class: text-center
@@ -116,7 +112,6 @@ class: text-center
116112

117113
a brief go-through
118114

119-
120115
---
121116

122117
<div class="grid grid-cols-2 gap-x-4"><div>
@@ -175,7 +170,6 @@ bar.prop = 1
175170
</div>
176171
</div></div>
177172

178-
179173
---
180174

181175
# Ref Auto Unwrapping <MarkerCore />
@@ -224,7 +218,6 @@ data.foo // 'bar'
224218

225219
</div>
226220

227-
228221
---
229222

230223
# `unref` - Opposite of Ref <MarkerCore />
@@ -260,7 +253,6 @@ unref(bar) // 'bar'
260253

261254
</div></div>
262255

263-
264256
---
265257
layout: center
266258
class: text-center
@@ -270,7 +262,6 @@ class: text-center
270262

271263
of writing composable functions
272264

273-
274265
---
275266

276267
# What's Composable Functions
@@ -309,7 +300,6 @@ export function useDark(options: UseDarkOptions = {}) {
309300
<VueUse name="useDark"/>
310301
</div>
311302

312-
313303
---
314304

315305
# Think as "Connections"
@@ -327,7 +317,6 @@ The `setup()` only runs **once** on component initialization, to construct the r
327317
</div>
328318
</div>
329319

330-
331320
---
332321

333322
# One Thing at a Time
@@ -340,7 +329,6 @@ Just the same as authoring JavaScript functions.
340329
- Keep function small and simple
341330
- "Do one thing, and do it well"
342331

343-
344332
---
345333

346334
# Passing Refs as Arguments <MarkerPattern />
@@ -359,7 +347,6 @@ Just the same as authoring JavaScript functions.
359347
Plain function
360348
</div>
361349

362-
363350
```ts
364351
function add(a: number, b: number) {
365352
return a + b
@@ -416,7 +403,6 @@ c.value // 6
416403

417404
</div>
418405

419-
420406
---
421407

422408
# MaybeRef <MarkerTips/>
@@ -431,7 +417,6 @@ type MaybeRef<T> = Ref<T> | T
431417
432418
In VueUse, we use this helper heavily to support optional reactive arguments
433419
434-
435420
```ts
436421
export function useTimeAgo(
437422
time: Date | number | string | Ref<Date | number | string>,
@@ -455,7 +440,6 @@ export function useTimeAgo(
455440

456441
</v-click>
457442

458-
459443
---
460444

461445
# Make it Flexible <MarkerPattern />
@@ -501,7 +485,6 @@ name.value = 'Hi' // Hi - World
501485
<VueUse name="useTitle"/>
502486
</div>
503487

504-
505488
---
506489

507490
# `useTitle` <Marker class="text-blue-400">Case</Marker>
@@ -531,11 +514,6 @@ export function useTitle(
531514

532515
```html
533516

534-
535-
536-
537-
538-
539517
<-- 1. use the user provided ref or create a new one
540518

541519
<-- 2. sync ref changes to the document title
@@ -545,7 +523,6 @@ export function useTitle(
545523
</v-clicks>
546524
</div>
547525

548-
549526
---
550527

551528
# "Reuse" Ref <MarkerCore />
@@ -561,7 +538,6 @@ const bar = ref(foo) // Ref<1>
561538
foo === bar // true
562539
```
563540

564-
565541
```ts
566542
function useFoo(foo: Ref<string> | string) {
567543
// no need!
@@ -578,7 +554,6 @@ Extremely useful in composable functions that take uncertain argument types.
578554

579555
</v-clicks>
580556

581-
582557
---
583558

584559
# `ref` / `unref` <MarkerTips />
@@ -602,7 +577,6 @@ function useBala<T>(arg: MaybeRef<T>) {
602577

603578
</div>
604579

605-
606580
---
607581

608582
# Object of Refs <MarkerPattern />
@@ -639,7 +613,6 @@ mouse.x === x.value // true
639613
</v-clicks>
640614
</div>
641615

642-
643616
---
644617

645618
# Async to "Sync" <MarkerTips />
@@ -674,7 +647,6 @@ Establish the "Connections" first, then wait for data to be filled up. The idea
674647

675648
</div>
676649

677-
678650
---
679651

680652
# `useFetch` <Marker class="text-blue-400">Case</Marker>
@@ -704,7 +676,6 @@ export function useFetch<R>(url: MaybeRef<string>) {
704676
<VueUse name="useFetch"/>
705677
</div>
706678

707-
708679
---
709680

710681
# Side-effects Self Cleanup <MarkerPattern />
@@ -758,7 +729,6 @@ const scope = effectScope(() => {
758729
stop(scope)
759730
```
760731

761-
762732
---
763733
disabled: true
764734
---
@@ -793,7 +763,6 @@ export default defineComponent({
793763

794764
</div>
795765

796-
797766
---
798767
disabled: true
799768
---
@@ -827,7 +796,6 @@ export default defineComponent({
827796
</v-click>
828797
</div>
829798

830-
831799
---
832800

833801
# Typed Provide / Inject <MarkerCore/>
@@ -850,7 +818,6 @@ export const injectKeyUser: InjectionKey<UserInfo> = Symbol('user')
850818

851819
</div>
852820

853-
854821
---
855822

856823
# Typed Provide / Inject <MarkerCore/>
@@ -894,7 +861,6 @@ export default {
894861
</v-clicks>
895862
</div>
896863

897-
898864
---
899865

900866
# Shared State <MarkerPattern />
@@ -940,7 +906,6 @@ console.log(state.foo) // 2
940906

941907
<h3 v-click class="opacity-100">⚠️ But it's not SSR compatible!</h3>
942908

943-
944909
---
945910

946911
# Shared State (SSR friendly) <MarkerPattern />
@@ -1001,7 +966,6 @@ const state = useMyState()
1001966

1002967
</div>
1003968

1004-
1005969
---
1006970

1007971
# useVModel <MarkerTips />
@@ -1061,7 +1025,6 @@ export default defineComponent({
10611025
<VueUse name="useVModel"/>
10621026
</div>
10631027

1064-
10651028
---
10661029
disabled: true
10671030
---
@@ -1093,14 +1056,12 @@ export function usePassiveVModel(props, name) {
10931056

10941057
</v-click>
10951058

1096-
10971059
---
10981060
layout: center
10991061
---
11001062

11011063
# All of them work for both Vue 2 and 3
11021064

1103-
11041065
---
11051066

11061067
# `@vue/composition-api` <Marker class="text-teal-400">Lib</Marker>
@@ -1118,7 +1079,6 @@ Vue.use(VueCompositionAPI)
11181079
import { reactive, ref } from '@vue/composition-api'
11191080
```
11201081

1121-
11221082
---
11231083

11241084
# Vue 2.7 <Marker class="text-purple-400">Upcoming</Marker>
@@ -1131,7 +1091,6 @@ import { reactive, ref } from '@vue/composition-api'
11311091
- IE11 support.
11321092
- LTS.
11331093

1134-
11351094
---
11361095

11371096
# Vue Demi <Marker class="text-teal-400">Lib</Marker>
@@ -1145,7 +1104,6 @@ import { defineComponent, reactive, ref } from 'vue-demi'
11451104

11461105
<img class="h-50 mx-auto" src="https://cdn.jsdelivr.net/gh/vueuse/vue-demi/assets/banner.png" alt="" />
11471106

1148-
11491107
---
11501108

11511109
# Recap
@@ -1159,7 +1117,6 @@ import { defineComponent, reactive, ref } from 'vue-demi'
11591117
- Side-effect self clean up
11601118
- Shared state
11611119

1162-
11631120
---
11641121
layout: center
11651122
class: 'text-center pb-5 :'

0 commit comments

Comments
 (0)
Please sign in to comment.