@slidev/docs 51.6.2
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/LICENSE +21 -0
- package/README.md +39 -0
- package/builtin/cli.md +96 -0
- package/builtin/components.md +359 -0
- package/builtin/layouts.md +217 -0
- package/custom/config-code-runners.md +78 -0
- package/custom/config-context-menu.md +40 -0
- package/custom/config-fonts.md +105 -0
- package/custom/config-highlighter.md +74 -0
- package/custom/config-katex.md +18 -0
- package/custom/config-mermaid.md +47 -0
- package/custom/config-monaco.md +99 -0
- package/custom/config-parser.md +232 -0
- package/custom/config-routes.md +28 -0
- package/custom/config-shortcuts.md +36 -0
- package/custom/config-transformers.md +43 -0
- package/custom/config-unocss.md +46 -0
- package/custom/config-vite.md +83 -0
- package/custom/config-vue.md +25 -0
- package/custom/directory-structure.md +134 -0
- package/custom/index.md +192 -0
- package/features/block-frontmatter.md +39 -0
- package/features/build-with-pdf.md +42 -0
- package/features/bundle-remote-assets.md +29 -0
- package/features/canvas-size.md +32 -0
- package/features/click-marker.md +31 -0
- package/features/code-block-line-numbers.md +32 -0
- package/features/code-block-max-height.md +32 -0
- package/features/direction-variant.md +31 -0
- package/features/draggable.md +82 -0
- package/features/drawing.md +74 -0
- package/features/eject-theme.md +27 -0
- package/features/frontmatter-merging.md +49 -0
- package/features/global-layers.md +99 -0
- package/features/icons.md +58 -0
- package/features/import-snippet.md +48 -0
- package/features/importing-slides.md +69 -0
- package/features/index.md +93 -0
- package/features/latex.md +80 -0
- package/features/line-highlighting.md +57 -0
- package/features/mdc.md +31 -0
- package/features/mermaid.md +37 -0
- package/features/monaco-editor.md +36 -0
- package/features/monaco-run.md +44 -0
- package/features/monaco-write.md +22 -0
- package/features/plantuml.md +26 -0
- package/features/prettier-plugin.md +55 -0
- package/features/recording.md +28 -0
- package/features/remote-access.md +69 -0
- package/features/rough-marker.md +46 -0
- package/features/shiki-magic-move.md +53 -0
- package/features/side-editor.md +17 -0
- package/features/slide-hook.md +33 -0
- package/features/slide-scope-style.md +44 -0
- package/features/slot-sugar.md +83 -0
- package/features/transform-component.md +29 -0
- package/features/twoslash.md +37 -0
- package/features/vscode-extension.md +80 -0
- package/features/zoom-slide.md +33 -0
- package/guide/animations.md +456 -0
- package/guide/component.md +36 -0
- package/guide/exporting.md +240 -0
- package/guide/faq.md +134 -0
- package/guide/global-context.md +169 -0
- package/guide/hosting.md +220 -0
- package/guide/index.md +161 -0
- package/guide/layout.md +32 -0
- package/guide/syntax.md +179 -0
- package/guide/theme-addon.md +62 -0
- package/guide/ui.md +86 -0
- package/guide/why.md +112 -0
- package/guide/write-addon.md +48 -0
- package/guide/write-layout.md +45 -0
- package/guide/write-theme.md +109 -0
- package/index.md +6 -0
- package/package.json +47 -0
- package/resources/addon-gallery.md +32 -0
- package/resources/covers.md +16 -0
- package/resources/learning.md +22 -0
- package/resources/showcases.md +10 -0
- package/resources/theme-gallery.md +32 -0
package/guide/ui.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# User Interface
|
|
6
|
+
|
|
7
|
+
## Navigation Bar {#navigation-bar}
|
|
8
|
+
|
|
9
|
+
In Play mode, move your mouse to the bottom left corner of the page, you can see the navigation bar.
|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
> You can extend the navigation bar via <LinkInline link="features/global-layers" />.
|
|
13
|
+
|
|
14
|
+
## Navigation Actions {#navigation-actions}
|
|
15
|
+
|
|
16
|
+
| Keyboard Shortcut | Button in Navigation Bar | Description |
|
|
17
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
|
|
18
|
+
| <kbd>f</kbd> | <carbon-maximize class="inline-icon-btn"/> <carbon-minimize class="inline-icon-btn"/> | Toggle fullscreen |
|
|
19
|
+
| <kbd>right</kbd> / <kbd>space</kbd> | <carbon-arrow-right class="inline-icon-btn"/> | Next animation or slide |
|
|
20
|
+
| <kbd>left</kbd> | <carbon-arrow-left class="inline-icon-btn"/> | Previous animation or slide |
|
|
21
|
+
| <kbd>up</kbd> | - | Previous slide |
|
|
22
|
+
| <kbd>down</kbd> | - | Next slide |
|
|
23
|
+
| <kbd>o</kbd> | <carbon-apps class="inline-icon-btn"/> | Toggle [Quick Overview](#quick-overview) |
|
|
24
|
+
| <kbd>d</kbd> | <carbon-sun class="inline-icon-btn"/> <carbon-moon class="inline-icon-btn"/> | Toggle dark mode |
|
|
25
|
+
| - | <carbon-user-avatar class="inline-icon-btn"/> | Toggle [Camera View](../features/recording#camera-view) |
|
|
26
|
+
| - | <carbon-video class="inline-icon-btn"/> | Start <LinkInline link="features/recording" /> |
|
|
27
|
+
| - | <carbon-user-speaker class="inline-icon-btn"/> | Enter [Presenter Mode](#presenter-mode) |
|
|
28
|
+
| - | <carbon-text-annotation-toggle class="inline-icon-btn"/> | Toggle <LinkInline link="features/side-editor" /> |
|
|
29
|
+
| - | <carbon-document-pdf class="inline-icon-btn"/> | Enter [Browser Exporter](#exporter) |
|
|
30
|
+
| - | <carbon-download class="inline-icon-btn"/> | Download PDF. See <LinkInline link="features/build-with-pdf" /> |
|
|
31
|
+
| - | <carbon-information class="inline-icon-btn"/> | Show information about the slides |
|
|
32
|
+
| - | <carbon-settings-adjust class="inline-icon-btn"/> | More options |
|
|
33
|
+
| <kbd>g</kbd> | - | Show goto... |
|
|
34
|
+
|
|
35
|
+
> You can [configure the shortcuts](../custom/config-shortcuts).
|
|
36
|
+
|
|
37
|
+
## Quick Overview {#quick-overview}
|
|
38
|
+
|
|
39
|
+
By pressing <kbd>o</kbd> or clicking the <carbon-apps class="inline-icon-btn"/> button in the navigation bar, you can have an overview of your slides so you can jump between them easily.
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
## Presenter Mode {#presenter-mode}
|
|
44
|
+
|
|
45
|
+
To enter the presenter mode, you can click the <carbon-user-speaker class="inline-icon-btn"/> button in the navigation panel, or visit `http://localhost:<port>/presenter`.
|
|
46
|
+
|
|
47
|
+
When giving a presentation, it's recommended to open two browser windows - one in the play mode for the audience, and another one in the presenter mode for you. Then you can share the first screen to the audience and keep the second screen for yourself.
|
|
48
|
+
|
|
49
|
+
Whenever you navigate through the slides in the presenter mode, all other opened pages will automatically follow this navigation to stay in sync with the presenter.
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
## Slide Overview {#slides-overview}
|
|
54
|
+
|
|
55
|
+
> Available since v0.48.0
|
|
56
|
+
|
|
57
|
+
<video src="https://github.com/slidevjs/slidev/assets/11247099/01bbf5b3-f916-4646-9ea4-cf269c0567cb"
|
|
58
|
+
controls rounded shadow></video>
|
|
59
|
+
|
|
60
|
+
You can visit an overview of all of your slides by first opening the [Quick Overview panel](#quick-overview) and then clicking the <carbon-list-boxes class="inline-icon-btn"/> on the top right, or by visiting `http://localhost:<port>/overview` directly.
|
|
61
|
+
|
|
62
|
+
The overview page gives you a linear list of all your slides, with all of your notes on the side. You can double-click on the notes to edit the notes directly, and drag the clicks sliders to preview the steps in your slides.
|
|
63
|
+
|
|
64
|
+
## Drawing UI {#drawing}
|
|
65
|
+
|
|
66
|
+
See:
|
|
67
|
+
|
|
68
|
+
<LinkCard link="features/drawing" />
|
|
69
|
+
|
|
70
|
+
## Recording UI {#recording}
|
|
71
|
+
|
|
72
|
+
See:
|
|
73
|
+
|
|
74
|
+
<LinkCard link="features/recording"/>
|
|
75
|
+
|
|
76
|
+
## Browser Exporter {#exporter}
|
|
77
|
+
|
|
78
|
+
See:
|
|
79
|
+
|
|
80
|
+
<LinkCard link="guide/exporting#browser"/>
|
|
81
|
+
|
|
82
|
+
## Global Layers {#global-layers}
|
|
83
|
+
|
|
84
|
+
You can add any custom UI below or above your slides for the whole presentation or per-slide:
|
|
85
|
+
|
|
86
|
+
<LinkCard link="features/global-layers" />
|
package/guide/why.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
outline: deep
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Why Slidev
|
|
6
|
+
|
|
7
|
+
There have been lots of feature-rich WYSIWYG slides makers like [Microsoft PowerPoint](https://www.microsoft.com/en-us/microsoft-365/powerpoint) and [Apple Keynote](https://www.apple.com/keynote/) _(see [Comparisons](#comparisons))_. They are intuitive and easy to learn. So why bother making Slidev?
|
|
8
|
+
|
|
9
|
+
Slidev aims to provide flexibility and interactivity for **developers** to make their presentations much more interesting, expressive, and attractive by using technologies they are familiar with. Slidev is also open source with a strong community.
|
|
10
|
+
|
|
11
|
+
Slidev is Markdown-based, which helps you **focus on the content**. Slidev is also Web-based, which means **nothing is impossible** - everything you can do in a web app can apply to your slides.
|
|
12
|
+
|
|
13
|
+
Slidev is also **progressive**. You can start with a super simple Markdown file, and then use the [built-in features](../features/) when you need them without any configuration. There are also [themes and addons](./theme-addon) you can optionally install to enhance your slides.
|
|
14
|
+
|
|
15
|
+
 {#welcome}
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
### 📝 Markdown-based
|
|
20
|
+
|
|
21
|
+
Slidev uses an extended Markdown format to organize your slides in a single plain text file. This helps you focus on the content while allowing you to use Git and any editor you like.
|
|
22
|
+
|
|
23
|
+
> Learn more: <LinkInline link="guide/syntax"/>.
|
|
24
|
+
|
|
25
|
+
### 🧑💻 Developer Friendly
|
|
26
|
+
|
|
27
|
+
Slidev provides first-class support for code snippets for developers. It uses [Shiki](https://github.com/shikijs/shiki) to get the most accurate syntax highlighting. Slidev also supports <LinkInline link="features/shiki-magic-move"/> and <LinkInline link="features/twoslash"/>. These make Slidev the best choice for tech talks.
|
|
28
|
+
|
|
29
|
+
### 🎨 Themable
|
|
30
|
+
|
|
31
|
+
Themes for Slidev can be shared via npm packages. You apply a theme within one line of code.
|
|
32
|
+
|
|
33
|
+
Check out the [Theme Gallery](../resources/theme-gallery) for the beautiful themes made by the official team and the community.
|
|
34
|
+
|
|
35
|
+
### ⚡ Fast
|
|
36
|
+
|
|
37
|
+
Every change you make in the editor will be updated to your slides in the browser **instantly** without reloading, thanks to [Vite's HMR feature](https://vitejs.dev/guide/features.html#hot-module-replacement).
|
|
38
|
+
|
|
39
|
+
### 🤹 Interactive & Expressive
|
|
40
|
+
|
|
41
|
+
You can write Vue components and use them in your slides, which you can then interact with during the presentation to express your idea in a more interesting and intuitive way.
|
|
42
|
+
|
|
43
|
+
Slidev also has built-in support of <LinkInline link="features/monaco-editor"/>, which empowers you to do live coding in your presentation with auto-completion and hover messages.
|
|
44
|
+
|
|
45
|
+
### 🎥 Recording Support
|
|
46
|
+
|
|
47
|
+
Slidev provides built-in recording and camera view. You can share your presentation with your camera view inside, or record and save your screen and camera separately.
|
|
48
|
+
|
|
49
|
+
> Learn more: <LinkInline link="features/recording"/>.
|
|
50
|
+
|
|
51
|
+
### 📤 Portable
|
|
52
|
+
|
|
53
|
+
You can export your slides into PDF, PPTX, PNGs, or even a single-page application (SPA) via a single command. Then you can share or host it anywhere you like.
|
|
54
|
+
|
|
55
|
+
> Learn more: <LinkInline link="guide/exporting"/> and <LinkInline link="guide/hosting"/>.
|
|
56
|
+
|
|
57
|
+
### 🛠 Hackable
|
|
58
|
+
|
|
59
|
+
Because Slidev is web-based, everything that can be done in a normal web app can be applied to your slides. For example, WebGL, API requests, iframes, or even live sharing. It's up to your imagination!
|
|
60
|
+
|
|
61
|
+
> Learn more: [Customization](../custom/).
|
|
62
|
+
|
|
63
|
+
## Comparisons
|
|
64
|
+
|
|
65
|
+
::: details Slidev vs. Microsoft PowerPoint / Apple Keynote
|
|
66
|
+
|
|
67
|
+
[Microsoft PowerPoint](https://www.microsoft.com/en-us/microsoft-365/powerpoint) and [Apple Keynote](https://www.apple.com/keynote/) are feature-rich WYSIWYG slides makers. They are intuitive and easy to learn, which makes them one of the best choices for non-developers.
|
|
68
|
+
|
|
69
|
+
Compared to them, Slidev has the following advantages:
|
|
70
|
+
|
|
71
|
+
- Developer-friendly: Code snippets are first-class citizens in Slidev.
|
|
72
|
+
- Markdown-based: Focus on the content, and version control your slides with Git.
|
|
73
|
+
- Web-based: Everything you can do in a web app can apply to your slides.
|
|
74
|
+
- Hackable: Customize anything you like with web technologies.
|
|
75
|
+
- Open source: Slidev is completely open source, and has a strong community.
|
|
76
|
+
|
|
77
|
+
:::
|
|
78
|
+
|
|
79
|
+
::: details Slidev vs. Reveal.js
|
|
80
|
+
|
|
81
|
+
[Reveal.js](https://revealjs.com/) is a popular HTML presentation framework. It is also open source and supports Markdown.
|
|
82
|
+
|
|
83
|
+
Compared to Reveal.js, Slidev has the following advantages:
|
|
84
|
+
|
|
85
|
+
- More concise: Slidev uses an extended Markdown format, while Reveal.js encourages you to write HTML to organize your slides.
|
|
86
|
+
- Vue support: You can use Vue components in Slidev to make your slides interactive.
|
|
87
|
+
- Vite-based: Slidev is built on top of Vite, which provides instant HMR and flexible plugin API.
|
|
88
|
+
- Atomatic CSS: You can [UnoCSS](https://unocss.dev/) out of the box to style your slides.
|
|
89
|
+
|
|
90
|
+
:::
|
|
91
|
+
|
|
92
|
+
::: details Slidev vs. Marp
|
|
93
|
+
|
|
94
|
+
[Marp](https://marp.app/) is a Markdown presentation tool that focuses on simplicity and portability. It is also open source and supports Markdown.
|
|
95
|
+
|
|
96
|
+
Compared to Marp, Slidev has the following advantages:
|
|
97
|
+
|
|
98
|
+
- The same simplicity: Slidev's slides can start as simple as Marp's.
|
|
99
|
+
- More features: Slidev supports many features that Marp doesn't.
|
|
100
|
+
- Vue support: You can use Vue components in Slidev to make your slides interactive.
|
|
101
|
+
- Vite-based: Slidev is built on top of Vite, which provides instant HMR and flexible plugin API.
|
|
102
|
+
- Atomatic CSS: You can [UnoCSS](https://unocss.dev/) out of the box to style your slides.
|
|
103
|
+
|
|
104
|
+
:::
|
|
105
|
+
|
|
106
|
+
## Give it a Try
|
|
107
|
+
|
|
108
|
+
Playing around with Slidev will tell you more than thousands of words. Check the <LinkInline link="guide/"/> guide to create your first Slidev project in one click or one command.
|
|
109
|
+
|
|
110
|
+
Or you can have a quick preview of it:
|
|
111
|
+
|
|
112
|
+
<iframe class="aspect-16/9 rounded-xl w-full shadow-md border-none" src="https://www.youtube.com/embed/eW7v-2ZKZOU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Writing Addons
|
|
2
|
+
|
|
3
|
+
> Please read <LinkInline link="guide/theme-addon" /> and <LinkInline link="guide/write-theme" /> first.
|
|
4
|
+
|
|
5
|
+
Each slides project can only have one theme, but can have multiple addons.
|
|
6
|
+
|
|
7
|
+
## Capability
|
|
8
|
+
|
|
9
|
+
Theoretically, all the capabilities of a theme can be done in an addon. However, an addon is more like a plugin that extends the functionalities of Slidev.
|
|
10
|
+
|
|
11
|
+
It's recommended to implement one or more of the following points in an addon:
|
|
12
|
+
|
|
13
|
+
- Provide custom components
|
|
14
|
+
- Provide _new_ layouts
|
|
15
|
+
- Provide new code snippets
|
|
16
|
+
- Provide new code runners
|
|
17
|
+
- Configure tools like UnoCSS, Vite, etc.
|
|
18
|
+
|
|
19
|
+
However, the following points are **not** recommended to be done in an addon, and may be better [implemented as a theme](./write-theme):
|
|
20
|
+
|
|
21
|
+
- Wildcard global styles
|
|
22
|
+
- Overriding existing layouts
|
|
23
|
+
- Overriding configurations
|
|
24
|
+
- Other things that may be incompatible with the theme and other addons
|
|
25
|
+
|
|
26
|
+
An addon can also specify its required Slidev version in the same way as themes.
|
|
27
|
+
|
|
28
|
+
## Previewing
|
|
29
|
+
|
|
30
|
+
The same as themes, you can preview your addon via a `./slides.md` like this:
|
|
31
|
+
|
|
32
|
+
```md
|
|
33
|
+
---
|
|
34
|
+
addons:
|
|
35
|
+
- ./
|
|
36
|
+
---
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Publishing
|
|
40
|
+
|
|
41
|
+
When publishing the addon, non-JS files like `.vue` and `.ts` files can be published directly without compiling. Slidev will automatically compile them when using the addon.
|
|
42
|
+
|
|
43
|
+
Addons should follow the following conventions:
|
|
44
|
+
|
|
45
|
+
- Package name should start with `slidev-addon-`. For example, `slidev-addon-name` or `@scope/slidev-addon-name`
|
|
46
|
+
- Add `"slidev-addon"` and `"slidev"` in the `keywords` field of your `package.json`
|
|
47
|
+
|
|
48
|
+
Theme can be used locally without publishing to NPM. If your addon is only for personal use, you can simply use it as a local addon, or publish it as a private scoped package. However, it is recommended to publish it to the NPM registry if you want to share it with others.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Writing Layouts
|
|
2
|
+
|
|
3
|
+
> Please read <LinkInline link="guide/layout" /> first.
|
|
4
|
+
|
|
5
|
+
To create a custom layout, simply create a new Vue file in the `layouts` directory:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
your-slidev/
|
|
9
|
+
├── ...
|
|
10
|
+
├── slides.md
|
|
11
|
+
└── layouts/
|
|
12
|
+
├── ...
|
|
13
|
+
└── MyLayout.vue
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Layouts are Vue components, so you can use all the features of Vue in them.
|
|
17
|
+
|
|
18
|
+
In the layout component, use `<slot/>` (the default slot) for the slide content:
|
|
19
|
+
|
|
20
|
+
```vue
|
|
21
|
+
<!-- default.vue -->
|
|
22
|
+
<template>
|
|
23
|
+
<div class="slidev-layout default">
|
|
24
|
+
<slot />
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You can also have [named slots](https://vuejs.org/guide/components/slots.html) for more complex layouts:
|
|
30
|
+
|
|
31
|
+
```vue
|
|
32
|
+
<!-- split.vue -->
|
|
33
|
+
<template>
|
|
34
|
+
<div class="slidev-layout split">
|
|
35
|
+
<div class="left">
|
|
36
|
+
<slot name="left" />
|
|
37
|
+
</div>
|
|
38
|
+
<div class="right">
|
|
39
|
+
<slot name="right" />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
And then use it with <LinkInline link="features/slot-sugar" />.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Writing Themes
|
|
2
|
+
|
|
3
|
+
> Please read <LinkInline link="guide/theme-addon" /> first.
|
|
4
|
+
|
|
5
|
+
Each slides project can only have one theme. Themes should focus on providing the appearance of slides. If the feature isn't related to the appearance and can be used separately, it should be implemented as an [addon](./write-addon).
|
|
6
|
+
|
|
7
|
+
To get started, we recommend you use our generator for scaffolding your first theme
|
|
8
|
+
|
|
9
|
+
::: code-group
|
|
10
|
+
|
|
11
|
+
```bash [pnpm]
|
|
12
|
+
$ pnpm create slidev-theme
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash [npm]
|
|
16
|
+
$ npm init slidev-theme@latest
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```bash [yarn]
|
|
20
|
+
$ yarn create slidev-theme
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```bash [bun]
|
|
24
|
+
$ bun create slidev-theme
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
Then you can modify and play with it. You can also refer to the [official themes](../resources/theme-gallery#official-themes) as examples.
|
|
30
|
+
|
|
31
|
+
## Capability
|
|
32
|
+
|
|
33
|
+
A theme can contribute to the following points:
|
|
34
|
+
|
|
35
|
+
- Global styles
|
|
36
|
+
- Provide default configurations
|
|
37
|
+
- Provide custom layouts or override the existing ones
|
|
38
|
+
- Provide custom components
|
|
39
|
+
- Configure tools like UnoCSS, Shiki, etc.
|
|
40
|
+
|
|
41
|
+
However, the following points are **not** recommended to be done in a theme, and may be better implemented as an [addon](./write-addon):
|
|
42
|
+
|
|
43
|
+
- New code snippets
|
|
44
|
+
- New code runners
|
|
45
|
+
- Other things that can be used separately
|
|
46
|
+
|
|
47
|
+
Basically, the way to provide global styles, layouts, components and configure tools is the same as doing these in a slides project. For example, to configure Shiki, you can create a `./setup/shiki.ts` as described in [Configure Highlighter](../custom/config-highlighter). You can refer to the [customization guide](/custom/) for more information.
|
|
48
|
+
|
|
49
|
+
To provide default Slidev configurations, you can add a `slidev.defaults` field in the `package.json` file, which will be merged with the user's configurations:
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"slidev": {
|
|
54
|
+
"defaults": {
|
|
55
|
+
"transition": "slide-left",
|
|
56
|
+
"aspectRatio": "4/3"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Require Slidev Version
|
|
63
|
+
|
|
64
|
+
If the theme is relying on a specific feature of Slidev that is newly introduced, you can set the minimal Slidev version required to have your theme working properly:
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"engines": {
|
|
69
|
+
"slidev": ">=0.48.0"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
An error message will be shown when the an incompatible version is used.
|
|
75
|
+
|
|
76
|
+
### Theme Metadata
|
|
77
|
+
|
|
78
|
+
By default, Slidev assumes themes support both light mode and dark mode. If you only want your theme to be presented in a specific color schema, you need to specify it explicitly in the `package.json`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"slidev": {
|
|
83
|
+
"colorSchema": "light" // or "dark" or "both"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Previewing
|
|
89
|
+
|
|
90
|
+
You can preview your theme when developing by using a demo slide deck. To do so, create a `./slides.md` file with the following headmatter:
|
|
91
|
+
|
|
92
|
+
```md
|
|
93
|
+
---
|
|
94
|
+
theme: ./ # Use the theme in the current directory
|
|
95
|
+
---
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Then you can start the demo slides as usual.
|
|
99
|
+
|
|
100
|
+
## Publishing
|
|
101
|
+
|
|
102
|
+
When publishing the theme, non-JS files like `.vue` and `.ts` files can be published directly without compiling. Slidev will automatically compile them when using the theme.
|
|
103
|
+
|
|
104
|
+
Themes should follow the following conventions:
|
|
105
|
+
|
|
106
|
+
- Package name should start with `slidev-theme-`. For example, `slidev-theme-name` or `@scope/slidev-theme-name`
|
|
107
|
+
- Add `"slidev-theme"` and `"slidev"` in the `keywords` field of your `package.json`
|
|
108
|
+
|
|
109
|
+
Theme can be used locally without publishing to NPM. If your theme is only for personal use, you can simply use it as a local theme, or publish it as a private scoped package. However, it is recommended to publish it to the NPM registry if you want to share it with others.
|
package/index.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@slidev/docs",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "51.6.2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"funding": "https://github.com/sponsors/antfu",
|
|
7
|
+
"homepage": "https://sli.dev",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/slidevjs/slidev",
|
|
11
|
+
"directory": "docs"
|
|
12
|
+
},
|
|
13
|
+
"bugs": "https://github.com/slidevjs/slidev/issues",
|
|
14
|
+
"files": [
|
|
15
|
+
"**/*.md",
|
|
16
|
+
"!.vitepress/**"
|
|
17
|
+
],
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@antfu/utils": "^9.2.0",
|
|
20
|
+
"@iconify/json": "^2.2.338",
|
|
21
|
+
"@shikijs/vitepress-twoslash": "^3.4.2",
|
|
22
|
+
"@types/node": "^22.15.18",
|
|
23
|
+
"@unocss/reset": "^66.1.2",
|
|
24
|
+
"@vueuse/core": "^13.2.0",
|
|
25
|
+
"fast-glob": "^3.3.3",
|
|
26
|
+
"gray-matter": "^4.0.3",
|
|
27
|
+
"markdown-it": "^14.1.0",
|
|
28
|
+
"shiki": "^3.4.2",
|
|
29
|
+
"typeit": "8.1.0",
|
|
30
|
+
"typescript": "^5.8.3",
|
|
31
|
+
"unocss": "^66.1.2",
|
|
32
|
+
"unplugin-icons": "^22.1.0",
|
|
33
|
+
"unplugin-vue-components": "^28.5.0",
|
|
34
|
+
"vite-plugin-inspect": "^11.0.1",
|
|
35
|
+
"vitepress": "^2.0.0-alpha.5",
|
|
36
|
+
"vitepress-plugin-llms": "^1.1.4",
|
|
37
|
+
"vue": "^3.5.14",
|
|
38
|
+
"@slidev/parser": "51.6.2",
|
|
39
|
+
"@slidev/client": "51.6.2",
|
|
40
|
+
"@slidev/types": "51.6.2"
|
|
41
|
+
},
|
|
42
|
+
"scripts": {
|
|
43
|
+
"dev": "vitepress",
|
|
44
|
+
"build": "vitepress build",
|
|
45
|
+
"preview": "vitepress preview"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
aside: false
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import AddonGallery from '../.vitepress/theme/components/AddonGallery.vue'
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
# Addon Gallery
|
|
10
|
+
|
|
11
|
+
Browse awesome addons available for Slidev here.
|
|
12
|
+
|
|
13
|
+
Read more about <LinkInline link="guide/theme-addon#use-addon" /> to use them, and <LinkInline link="guide/write-addon" /> to create your own addon.
|
|
14
|
+
|
|
15
|
+
## Official Addons
|
|
16
|
+
|
|
17
|
+
<ClientOnly>
|
|
18
|
+
<AddonGallery collection="official"/>
|
|
19
|
+
</ClientOnly>
|
|
20
|
+
|
|
21
|
+
## Community Addons
|
|
22
|
+
|
|
23
|
+
Here are the curated addons made by the community.
|
|
24
|
+
|
|
25
|
+
<!-- Edit in ./docs/.vitepress/addons.ts -->
|
|
26
|
+
<ClientOnly>
|
|
27
|
+
<AddonGallery collection="community"/>
|
|
28
|
+
</ClientOnly>
|
|
29
|
+
|
|
30
|
+
## More Addons
|
|
31
|
+
|
|
32
|
+
Find all the [addons available on NPM](https://www.npmjs.com/search?q=keywords%3Aslidev-addon).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Curated Covers
|
|
2
|
+
|
|
3
|
+
We curated a few cover images to demonstrate our starter template.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
---
|
|
9
|
+
# random image from the curated collection
|
|
10
|
+
background: https://cover.sli.dev
|
|
11
|
+
---
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
If you enjoy any of them, check out our [Unsplash collection](https://unsplash.com/collections/94734566/slidev) and find out their authors.
|
|
15
|
+
|
|
16
|
+
[cover.sli.dev](https://cover.sli.dev) is hosted from [`slidevjs/slidev-covers`](https://github.com/slidevjs/slidev-covers).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Learning Resources
|
|
2
|
+
|
|
3
|
+
## English
|
|
4
|
+
|
|
5
|
+
### Videos
|
|
6
|
+
|
|
7
|
+
- [Slidev - one of the best presentation software and it is free!](https://www.youtube.com/watch?v=oSgM6GoSwyY) - by [Federico Tartarini](https://www.youtube.com/@FedericoTartarini)
|
|
8
|
+
|
|
9
|
+
### Articles
|
|
10
|
+
|
|
11
|
+
- [Tips To Turn R Markdown Into Slidev Presentation](https://yutani.rbind.io/post/2021-06-05-tips-to-turn-r-markdown-into-slidev-presentation/) by Hiroaki Yutani
|
|
12
|
+
|
|
13
|
+
## 中文
|
|
14
|
+
|
|
15
|
+
- [Slidev:一个用Markdown写slides的神器](https://zhuanlan.zhihu.com/p/372729473) by [梦里风林](https://www.zhihu.com/people/meng-li-feng-lin)
|
|
16
|
+
- [神器!这款开源项目可以让你使用 Markdown 来做 PPT!](https://zhuanlan.zhihu.com/p/377567327) by [Github掘金计划](https://www.zhihu.com/people/github-stars)
|
|
17
|
+
|
|
18
|
+
## 日本語
|
|
19
|
+
|
|
20
|
+
- [開発者のためのスライド作成ツール Slidev がすごい](https://zenn.dev/ryo_kawamata/articles/introduce-slidev) by [ryo_kawamata](https://zenn.dev/ryo_kawamata)
|
|
21
|
+
- [Markdownでオシャレなスライドを作るSli.dev](https://qiita.com/e99h2121/items/a115f8865a0dc21bb462) by [Nobuko YAMADA](https://qiita.com/e99h2121)
|
|
22
|
+
- [【Slidev 超入門】エンジニアだからこそ作れるつよつよスライドの作り方!](https://zenn.dev/takumaru/articles/3faa75c2f09493) by [takuma-ru](https://zenn.dev/takumaru)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
aside: false
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import ThemeGallery from '../.vitepress/theme/components/ThemeGallery.vue'
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
# Theme Gallery
|
|
10
|
+
|
|
11
|
+
Browse awesome themes available for Slidev here.
|
|
12
|
+
|
|
13
|
+
Read more about <LinkInline link="guide/theme-addon#use-theme" /> to use them, and <LinkInline link="guide/write-theme" /> to create your own theme.
|
|
14
|
+
|
|
15
|
+
## Official Themes {#official-themes}
|
|
16
|
+
|
|
17
|
+
<ClientOnly>
|
|
18
|
+
<ThemeGallery collection="official"/>
|
|
19
|
+
</ClientOnly>
|
|
20
|
+
|
|
21
|
+
## Community Themes {#community-themes}
|
|
22
|
+
|
|
23
|
+
Here are the curated themes made by the community.
|
|
24
|
+
|
|
25
|
+
<!-- Edit in ./docs/.vitepress/themes.ts -->
|
|
26
|
+
<ClientOnly>
|
|
27
|
+
<ThemeGallery collection="community"/>
|
|
28
|
+
</ClientOnly>
|
|
29
|
+
|
|
30
|
+
## More Themes {#more-themes}
|
|
31
|
+
|
|
32
|
+
Find all the [themes available on NPM](https://www.npmjs.com/search?q=keywords%3Aslidev-theme).
|