Skip to content

Commit b019700

Browse files
committed
docs(en): merging all conflicts
2 parents 7feeaa2 + eca0155 commit b019700

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1914
-770
lines changed

Diff for: .vitepress/config.js

+36
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,14 @@ const Guide = [
4646
link: '/guide/presenter-mode',
4747
},
4848
{
49+
<<<<<<< HEAD
4950
<<<<<<< HEAD
5051
text: 'Tích hợp trình soạn thảo',
5152
=======
5253
text: 'Drawing & Annonations',
54+
=======
55+
text: 'Drawing & Annotations',
56+
>>>>>>> eca0155fb4af5e8138c24bec4161ae66d22663fe
5357
link: '/guide/drawing',
5458
},
5559
{
@@ -78,6 +82,17 @@ const Theme = [
7882
},
7983
]
8084

85+
const Addon = [
86+
{
87+
text: 'Use Addon',
88+
link: '/addons/use',
89+
},
90+
{
91+
text: 'Write an Addon',
92+
link: '/addons/write-an-addon',
93+
},
94+
]
95+
8196
const Translations = [
8297
{
8398
text: 'Việt Nam'
@@ -118,6 +133,10 @@ const Translations = [
118133
text: 'Ελληνικά',
119134
link: 'https://el.sli.dev{{pathname}}',
120135
},
136+
{
137+
text: '日本語',
138+
link: 'https://ja.sli.dev{{pathname}}',
139+
},
121140
]
122141

123142
const Customizations = [
@@ -204,7 +223,15 @@ const slidebars = [
204223
children: Theme,
205224
},
206225
{
226+
<<<<<<< HEAD
207227
text: 'Các tùy chỉnh',
228+
=======
229+
text: 'Addons',
230+
children: Addon,
231+
},
232+
{
233+
text: 'Customizations',
234+
>>>>>>> eca0155fb4af5e8138c24bec4161ae66d22663fe
208235
children: Customizations,
209236
},
210237
{
@@ -267,7 +294,15 @@ module.exports = {
267294
items: Theme,
268295
},
269296
{
297+
<<<<<<< HEAD
270298
text: 'Tùy chỉnh',
299+
=======
300+
text: 'Addon',
301+
items: Addon,
302+
},
303+
{
304+
text: 'Customize',
305+
>>>>>>> eca0155fb4af5e8138c24bec4161ae66d22663fe
271306
items: Customizations,
272307
},
273308
{
@@ -283,6 +318,7 @@ module.exports = {
283318
sidebar: {
284319
'/guide/': slidebars,
285320
'/themes/': slidebars,
321+
'/addons/': slidebars,
286322
'/custom/': slidebars,
287323
'/builtin/': slidebars,
288324
'/resources/': slidebars,

Diff for: .vitepress/showcases.ts

+24
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,30 @@ export const showcases: ShowCaseInfo[] = [
108108
at: 'Thoughtworks Internal Lunch & Learn',
109109
datetime: '2021-11-12',
110110
},
111+
{
112+
title: 'Git\'s Most Wanted',
113+
cover: 'https://cdn.jsdelivr.net/gh/alexanderdavide/git-most-wanted@assets/slides-export/01.png',
114+
author: {
115+
name: 'Alexander Eble',
116+
link: 'https://github.com/alexanderdavide',
117+
},
118+
slidesLink: 'https://git-most-wanted.alex-eble.de',
119+
sourceLink: 'https://github.com/alexanderdavide/git-most-wanted',
120+
at: 'Internal Tech Talk',
121+
datetime: '2022-03-11',
122+
},
123+
{
124+
title: 'OpenFunction 202',
125+
cover: 'https://s2.loli.net/2022/05/22/4zsCnkQRFoAU1E5.png',
126+
author: {
127+
name: 'Haili Zhang',
128+
link: 'https://github.com/webup',
129+
},
130+
slidesLink: 'https://openfunction-talks.netlify.app/2022/202-node-async/',
131+
sourceLink: 'https://github.com/webup/openfunction-talks/tree/main/202-node-async',
132+
at: 'OpenFunction Tutorial Sharing',
133+
datetime: '2022-05-08',
134+
},
111135
// Add yours here!
112136
{
113137
title: 'Yours?',

Diff for: .vitepress/theme/Layout.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050

5151
<!-- <Debug /> -->
5252

53-
<ClientOnly>
53+
<!-- <ClientOnly>
5454
<WorkingInProgress />
55-
</ClientOnly>
55+
</ClientOnly> -->
5656
</template>
5757

5858
<script setup lang="ts">

Diff for: .vitepress/theme/components/AlgoliaSearchBox.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<script setup lang="ts">
66
import '@docsearch/css'
77
import { useRoute, useRouter } from 'vitepress'
8-
import { defineProps, getCurrentInstance, onMounted, watch } from 'vue'
8+
import { getCurrentInstance, onMounted, watch } from 'vue'
99
import docsearch from '@docsearch/js'
1010
import type { DocSearchHit } from '@docsearch/react/dist/esm/types'
1111
import type { DefaultTheme } from '../config'

Diff for: .vitepress/theme/components/BooleanDisplay.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { ref, defineProps } from 'vue'
2+
import { ref } from 'vue'
33
44
const props = defineProps({
55
value: {

Diff for: .vitepress/theme/components/Environment.vue

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<script setup lang="ts">
2-
import { defineProps } from 'vue'
3-
42
defineProps<{ type: 'node' | 'client' }>()
53
</script>
64

Diff for: .vitepress/theme/components/NavBar.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
</template>
4040

4141
<script setup lang="ts">
42-
import { defineEmit, defineProps } from 'vue'
4342
import { useRepo } from '../composables/repo'
4443
import NavBarTitle from './NavBarTitle.vue'
4544
import NavLinks from './NavLinks.vue'
@@ -48,7 +47,7 @@ import DarkModeSwitch from './DarkModeSwitch.vue'
4847
4948
const repo = useRepo()
5049
51-
defineEmit(['toggle'])
50+
defineEmits(['toggle'])
5251
5352
defineProps({
5453
showSidebar: { type: Boolean, required: true },

Diff for: .vitepress/theme/components/NavDropdownLink.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</template>
1515

1616
<script setup lang="ts">
17-
import { defineProps, ref, watch } from 'vue'
17+
import { ref, watch } from 'vue'
1818
import { useRoute } from 'vitepress'
1919
import type { DefaultTheme } from '../config'
2020
import NavDropdownLinkItem from './NavDropdownLinkItem.vue'

Diff for: .vitepress/theme/components/NavDropdownLinkItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</template>
1010

1111
<script setup lang="ts">
12-
import { defineProps, toRefs } from 'vue'
12+
import { toRefs } from 'vue'
1313
import type { DefaultTheme } from '../config'
1414
import { useNavLink } from '../composables/navLink'
1515
import OutboundLink from './icons/OutboundLink.vue'

Diff for: .vitepress/theme/components/NavLink.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</template>
88

99
<script setup lang="ts">
10-
import { defineProps, toRefs } from 'vue'
10+
import { toRefs } from 'vue'
1111
import type { DefaultTheme } from '../config'
1212
import { useNavLink } from '../composables/navLink'
1313
import OutboundLink from './icons/OutboundLink.vue'

Diff for: .vitepress/theme/components/ShowCaseInfo.vue

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { defineProps } from 'vue'
32
import type { ShowCaseInfo } from '../../showcases'
43
54
defineProps<{

Diff for: .vitepress/theme/components/SideBar.vue

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</template>
1212

1313
<script setup lang="ts">
14-
import { defineProps } from 'vue'
1514
import NavLinks from './NavLinks.vue'
1615
import SideBarLinks from './SideBarLinks.vue'
1716

Diff for: .vitepress/theme/components/ThemeGallery.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { defineProps, computed } from 'vue'
2+
import { computed } from 'vue'
33
import { official, community } from '../../themes'
44
55
const props = defineProps({

Diff for: .vitepress/theme/components/ThemeInfo.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { defineProps, ref } from 'vue'
2+
import { ref } from 'vue'
33
import { isClient, useIntervalFn } from '@vueuse/core'
44
import type { ThemeInfo } from '../../themes'
55

Diff for: .vitepress/theme/components/Tweet.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Usage:
88

99
<script setup lang="ts">
1010
import { useScriptTag, isClient } from '@vueuse/core'
11-
import { defineProps, getCurrentInstance, onMounted, ref } from 'vue'
11+
import { getCurrentInstance, onMounted, ref } from 'vue'
1212
import { isDark } from '../composables/dark'
1313

1414
const props = defineProps<{

Diff for: .vitepress/themes.ts

+23
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,29 @@ export const community: ThemeInfo[] = [
315315
'light',
316316
],
317317
},
318+
{
319+
id: 'slidev-theme-academic',
320+
name: 'Academic',
321+
description: 'Academic presentations with Slidev made simple',
322+
author: {
323+
name: 'Alexander Eble',
324+
link: 'https://github.com/alexanderdavide',
325+
},
326+
repo: 'https://github.com/alexanderdavide/slidev-theme-academic',
327+
previews: [
328+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/01.png',
329+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/02.png',
330+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/08.png',
331+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/04.png',
332+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/05.png',
333+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/06.png',
334+
'https://cdn.jsdelivr.net/gh/alexanderdavide/slidev-theme-academic@assets/example-export/07.png',
335+
],
336+
tags: [
337+
'dark',
338+
'light',
339+
],
340+
},
318341
// Add yours here!
319342
{
320343
id: '',

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Tài liệu cho [Slidev](https://github.com/slidevjs/slidev)
1515
| Deutsch | [docs-de](https://github.com/slidevjs/docs-de) | [de.sli.dev](https://de.sli.dev) | [@fabiankachlock](https://github.com/fabiankachlock) |
1616
| Português (BR) | [docs-br](https://github.com/slidevjs/docs-br) | [br.sli.dev](https://br.sli.dev) | [@luisfelipesdn12](https://github.com/luisfelipesdn12) |
1717
| Ελληνικά | [docs-el](https://github.com/slidevjs/docs-el) | [el.sli.dev](https://el.sli.dev) | [@GeopJr](https://github.com/GeopJr) |
18+
| 日本語 | [docs-ja](https://github.com/slidevjs/docs-el) | [ja.sli.dev](https://ja.sli.dev) | [@IkumaTadokoro](https://github.com/IkumaTadokoro) |
1819

1920
## Start Server Locally
2021

Diff for: TRANSLATIONS.md

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ In case it's already been translated but you're wondering how to maintain it, sk
7777
- [ ] `use.md` - How to use Slidev themes
7878
- [ ] `write-a-theme.md` - Write your own theme
7979

80+
### addons/
81+
82+
- [ ] `use.md` - How to use Slidev addons
83+
- [ ] `write-an-addon.md` - Write your own addon
84+
8085
## Publishing your translations
8186

8287
- [ ] When you finish the translation (at least 90%), `@antfu` in the Discord and we will invite you to the org and make the translation official.

Diff for: addons/use.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Use Addon
2+
3+
Addons are sets of additional components, layouts, styles, configuration...etc. that you can use in your presentation.
4+
5+
They are quite similar to [themes](/themes/use), but in general:
6+
7+
* they don't affect the global styles of your slides
8+
* you can use multiple addons in one presentation
9+
10+
To use addons, you have to install them manually via:
11+
12+
```bash
13+
$ npm install [slidev-addon-package1] [slidev-addon-package2]
14+
```
15+
16+
And then declare the addons either in your frontmatter:
17+
18+
```yaml
19+
---
20+
addons:
21+
- slidev-addon-package1
22+
- slidev-addon-package2
23+
---
24+
```
25+
26+
Or in your `package.json` file:
27+
28+
```json
29+
// package.json
30+
{
31+
"slidev": {
32+
"addons": [
33+
"slidev-addon-package1",
34+
"slidev-addon-package2",
35+
]
36+
}
37+
}
38+
```

Diff for: addons/write-an-addon.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Write an Addon
2+
3+
> Available since v0.32.1
4+
5+
## Capability
6+
7+
An addon can contribute to the following points:
8+
9+
- Global styles (use with caution has it is more the role of [themes](/themes/use))
10+
- Provide custom layouts or override the existing one
11+
- Provide custom components or override the existing one
12+
- Extend Windi CSS configurations
13+
- Configure tools like Monaco and Prism
14+
15+
## Conventions
16+
17+
Addons are published to npm registry, and they should follow the conventions below:
18+
19+
- Package name should start with `slidev-addon-`, for example: `slidev-addon-awesome`
20+
- Add `slidev-addon` and `slidev` in the `keywords` field of your `package.json`
21+
22+
## Setup
23+
24+
### Initialization
25+
26+
To create your addon, start by creating a directory with create a `package.json` file (you can use `npm init`).
27+
28+
Then, install slidev dependencies:
29+
30+
```bash
31+
$ npm install -D @slidev/cli
32+
```
33+
34+
### Testing
35+
36+
To set up the testing playground for your addon, you can create an `example.md` file with some content.
37+
38+
And optionally, you can also add some scripts to your `packages.json`
39+
40+
```json
41+
// package.json
42+
{
43+
"scripts": {
44+
"dev": "slidev example.md",
45+
"build": "slidev build example.md",
46+
"export": "slidev export example.md",
47+
"screenshot": "slidev export example.md --format png"
48+
}
49+
}
50+
```
51+
52+
To publish your addon, simply run `npm publish` and you are good to go. There is no build process required (which means you can directly publish `.vue` and `.ts` files, Slidev is smart enough to understand them).
53+
54+
Addon contribution points follow the same conventions as local customization, please refer to [the docs for the naming conventions](/custom/).
55+
56+
## Addon metadata
57+
58+
### Slidev Version
59+
60+
If the addon is relying on a specific feature of Slidev that are newly introduced, you can set the minimal Slidev version required to have your addon working properly:
61+
62+
```json
63+
// package.json
64+
{
65+
"engines": {
66+
"slidev": ">=0.32.1"
67+
}
68+
}
69+
```
70+
71+
If users are using older versions of Slidev, an error will be thrown.

0 commit comments

Comments
 (0)