@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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-PRESENT Anthony Fu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# [sli.dev](https://sli.dev)
|
|
2
|
+
|
|
3
|
+
Documentation for [Slidev](https://github.com/slidevjs/slidev)
|
|
4
|
+
|
|
5
|
+
## Translations
|
|
6
|
+
|
|
7
|
+
> [!WARNING]
|
|
8
|
+
>
|
|
9
|
+
> Translations with strikethroughs are no longer maintained. The content is outdated and not encouraged to refer.
|
|
10
|
+
|
|
11
|
+
| | Repo | Site | Maintainers |
|
|
12
|
+
| ------------------------- | ---------------------------------------------- | -------------------------------: | --------------------------------------------------------------------- |
|
|
13
|
+
| English | [docs](https://github.com/slidevjs/docs) | [sli.dev](https://sli.dev) | [@antfu](https://github.com/antfu) |
|
|
14
|
+
| 简体中文 | [docs-cn](https://github.com/slidevjs/docs-cn) | [cn.sli.dev](https://cn.sli.dev) | [@QC-L](https://github.com/QC-L) [@Ivocin](https://github.com/Ivocin) |
|
|
15
|
+
| <del>Français</del> | [docs-fr](https://github.com/slidevjs/docs-fr) | [fr.sli.dev](https://fr.sli.dev) | [@ArthurDanjou](https://github.com/ArthurDanjou) |
|
|
16
|
+
| <del>Español</del> | [docs-es](https://github.com/slidevjs/docs-es) | [es.sli.dev](https://es.sli.dev) | [@owlnai](https://github.com/owlnai) |
|
|
17
|
+
| <del>Русский</del> | [docs-ru](https://github.com/slidevjs/docs-ru) | [ru.sli.dev](https://ru.sli.dev) | [@xesjkeee](https://github.com/xesjkeee) |
|
|
18
|
+
| <del>Việt Nam</del> | [docs-vn](https://github.com/slidevjs/docs-vn) | [vn.sli.dev](https://vn.sli.dev) | [@bongudth](https://github.com/bongudth) |
|
|
19
|
+
| <del>Deutsch</del> | [docs-de](https://github.com/slidevjs/docs-de) | [de.sli.dev](https://de.sli.dev) | [@fabiankachlock](https://github.com/fabiankachlock) |
|
|
20
|
+
| <del>Português (BR)</del> | [docs-br](https://github.com/slidevjs/docs-br) | [br.sli.dev](https://br.sli.dev) | [@luisfelipesdn12](https://github.com/luisfelipesdn12) |
|
|
21
|
+
| <del>Ελληνικά</del> | [docs-el](https://github.com/slidevjs/docs-el) | [el.sli.dev](https://el.sli.dev) | [@GeopJr](https://github.com/GeopJr) |
|
|
22
|
+
| <del>日本語</del> | [docs-ja](https://github.com/slidevjs/docs-el) | [ja.sli.dev](https://ja.sli.dev) | [@IkumaTadokoro](https://github.com/IkumaTadokoro) |
|
|
23
|
+
|
|
24
|
+
## Start Server Locally
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
npm i -g pnpm
|
|
28
|
+
|
|
29
|
+
pnpm i
|
|
30
|
+
pnpm run dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
And then visit `http://localhost:3000`
|
|
34
|
+
|
|
35
|
+
Or install the [Vite extension for VS Code](https://marketplace.visualstudio.com/items?itemName=antfu.vite) to edit side-by-side.
|
|
36
|
+
|
|
37
|
+
## Help on Translating
|
|
38
|
+
|
|
39
|
+
Please join our [Discord Server](https://chat.sli.dev) and contact the maintainers.
|
package/builtin/cli.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Slidev CLI
|
|
2
|
+
|
|
3
|
+
`@slidev/cli` exposes a binary called `slidev` that you can use to develop, build, and export your slides.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
To use the CLI, you can either install `@slidev/cli` globally or install it locally in your Node.js project. If you created your project with `npm init slidev`, the CLI is already installed locally.
|
|
8
|
+
|
|
9
|
+
::: warning
|
|
10
|
+
Usually `npx slidev` is not supported because the package name is actually `@slidev/cli`.
|
|
11
|
+
:::
|
|
12
|
+
|
|
13
|
+
The CLI options of the commands obey the following conventions:
|
|
14
|
+
|
|
15
|
+
- the value of the option can be passed after a space or a `=` character:
|
|
16
|
+
|
|
17
|
+
Example: `slidev --port 8080` is equivalent to `slidev --port=8080`
|
|
18
|
+
|
|
19
|
+
- `true` can be omitted for boolean options:
|
|
20
|
+
|
|
21
|
+
Example: `slidev --open` is equivalent to `slidev --open true`
|
|
22
|
+
|
|
23
|
+
::: info
|
|
24
|
+
|
|
25
|
+
If you use npm, please don't forget to add `--` before the options to pass them to Slidev:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run slidev -- --remote --port 8080 --open
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
:::
|
|
32
|
+
|
|
33
|
+
## `slidev [entry]` {#dev}
|
|
34
|
+
|
|
35
|
+
Start a local server for Slidev.
|
|
36
|
+
|
|
37
|
+
- `[entry]` (`string`, default: `slides.md`): path to the markdown file containing your slides.
|
|
38
|
+
|
|
39
|
+
Options:
|
|
40
|
+
|
|
41
|
+
- `--port`, `-p` (`number`, default: `3030`): port number.
|
|
42
|
+
- `--base` (`string`, default: `/`): base URL (see https://vitejs.dev/config/shared-options.html#base).
|
|
43
|
+
- `--open`, `-o` (`boolean`, default: `false`): open in the browser.
|
|
44
|
+
- `--remote [password]` (`string`): listen to the public host and enable remote control, if a value is passed then the presenter mode is private and only accessible by passing the given password in the URL query `password` parameter.
|
|
45
|
+
- `--bind` (`string`, default: `0.0.0.0`): specify which IP addresses the server should listen on in the remote mode.
|
|
46
|
+
- `--log` (`'error', 'warn', 'info', 'silent'`, default: `'warn'`): Log level.
|
|
47
|
+
- `--force`, `-f` (`boolean`, default: `false`): force the optimizer to ignore the cache and re-bundle.
|
|
48
|
+
- `--theme`, `-t` (`string`): override theme.
|
|
49
|
+
|
|
50
|
+
## `slidev build [entry]` {#build}
|
|
51
|
+
|
|
52
|
+
Build a hostable SPA. See <LinkInline link="guide/hosting" /> for more details.
|
|
53
|
+
|
|
54
|
+
- `[entry]` (`string`, default: `slides.md`): path to the slides markdown file.
|
|
55
|
+
|
|
56
|
+
Options:
|
|
57
|
+
|
|
58
|
+
- `--out`, `-o` (`string`, default: `dist`): output directory
|
|
59
|
+
- `--base` (`string`, default: `/`): base URL (see https://vitejs.dev/config/shared-options.html#base)
|
|
60
|
+
- `--download` (`boolean`, default: `false`): allow the download of the slides as a PDF inside the SPA
|
|
61
|
+
- `--theme`, `-t` (`string`): override theme
|
|
62
|
+
|
|
63
|
+
## `slidev export [...entry]` {#export}
|
|
64
|
+
|
|
65
|
+
Export slides to PDF (or other format). See <LinkInline link="guide/exporting" /> for more details.
|
|
66
|
+
|
|
67
|
+
- `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
|
|
68
|
+
|
|
69
|
+
Options:
|
|
70
|
+
|
|
71
|
+
- `--output` (`string`, default: use `exportFilename` (see https://sli.dev/custom/#frontmatter-configures) or use `[entry]-export`): path to the output.
|
|
72
|
+
- `--format` (`'pdf', 'png', 'pptx', 'md'`, default: `'pdf'`): output format.
|
|
73
|
+
- `--timeout` (`number`, default: `30000`): timeout for rendering the print page (see https://playwright.dev/docs/api/class-page#page-goto).
|
|
74
|
+
- `--range` (`string`): page ranges to export (example: `'1,4-5,6'`).
|
|
75
|
+
- `--dark` (`boolean`, default: `false`): export as dark theme.
|
|
76
|
+
- `--with-clicks`, `-c` (`boolean`, default: `false`): export pages for every click animation (see https://sli.dev/guide/animations.html#click-animation).
|
|
77
|
+
- `--theme`, `-t` (`string`): override theme.
|
|
78
|
+
- `--omit-background` (`boolean`, default: `false`): remove the default browser background
|
|
79
|
+
|
|
80
|
+
## `slidev format [entry]` {#format}
|
|
81
|
+
|
|
82
|
+
Format the markdown file. Note that this won't format the content of the slides, only the organization of the markdown file.
|
|
83
|
+
|
|
84
|
+
- `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
|
|
85
|
+
|
|
86
|
+
## `slidev theme [subcommand]` {#theme}
|
|
87
|
+
|
|
88
|
+
Theme-related operations.
|
|
89
|
+
|
|
90
|
+
Subcommands:
|
|
91
|
+
|
|
92
|
+
- `eject [entry]`: Eject the current theme into the local file system. See <LinkInline link="features/eject-theme" />.
|
|
93
|
+
- `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
|
|
94
|
+
- Options:
|
|
95
|
+
- `--dir` (`string`, default: `theme`): the output dir.
|
|
96
|
+
- `--theme`, `-t` (`string`): override theme.
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
# Components
|
|
2
|
+
|
|
3
|
+
This page lists all the built-in components provided by Slidev. These components can be **directly** used in your slides.
|
|
4
|
+
|
|
5
|
+
Note that <LinkInline link="guide/theme-addon" /> can provide additional components. To add your own components, see <LinkInline link="guide/component#write" />.
|
|
6
|
+
|
|
7
|
+
## `Arrow`
|
|
8
|
+
|
|
9
|
+
Draw an arrow.
|
|
10
|
+
|
|
11
|
+
### Usage
|
|
12
|
+
|
|
13
|
+
```md
|
|
14
|
+
<Arrow x1="10" y1="20" x2="100" y2="200" />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Or:
|
|
18
|
+
|
|
19
|
+
```md
|
|
20
|
+
<Arrow v-bind="{ x1:10, y1:10, x2:200, y2:200 }" />
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Props:
|
|
24
|
+
|
|
25
|
+
- `x1` (`string | number`, required): start point x position
|
|
26
|
+
- `y1` (`string | number`, required): start point y position
|
|
27
|
+
- `x2` (`string | number`, required): end point x position
|
|
28
|
+
- `y2` (`string | number`, required): end point y position
|
|
29
|
+
- `width` (`string | number`, default: `2`): line width
|
|
30
|
+
- `color` (`string`, default: `'currentColor'`): line color
|
|
31
|
+
- `two-way` (`boolean`, default: `false`): draw a two-way arrow
|
|
32
|
+
|
|
33
|
+
## `VDragArrow`
|
|
34
|
+
|
|
35
|
+
An `Arrow` component that can be dragged.
|
|
36
|
+
|
|
37
|
+
### Usage
|
|
38
|
+
|
|
39
|
+
<LinkCard link="features/draggable#draggable-arrow" />
|
|
40
|
+
|
|
41
|
+
Props not related to position are the same as [the `Arrow` component](#arrow).
|
|
42
|
+
|
|
43
|
+
## `AutoFitText`
|
|
44
|
+
|
|
45
|
+
> Experimental
|
|
46
|
+
|
|
47
|
+
Box inside which the font size will automatically adapt to fit the content. Similar to PowerPoint or Keynote TextBox.
|
|
48
|
+
|
|
49
|
+
### Usage
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
<AutoFitText :max="200" :min="100" modelValue="Some text"/>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Props:
|
|
56
|
+
|
|
57
|
+
- `max` (`string | number`, default `100`): Maximum font size
|
|
58
|
+
- `min` (`string | number`, default `30`): Minimum font size
|
|
59
|
+
- `modelValue` (`string`, default `''`): text content
|
|
60
|
+
|
|
61
|
+
## `LightOrDark`
|
|
62
|
+
|
|
63
|
+
Use it to display one thing or another depending on the active light or dark theme.
|
|
64
|
+
|
|
65
|
+
### Usage
|
|
66
|
+
|
|
67
|
+
Use it with the two named Slots `#dark` and `#light`:
|
|
68
|
+
|
|
69
|
+
```md
|
|
70
|
+
<LightOrDark>
|
|
71
|
+
<template #dark>Dark mode is on</template>
|
|
72
|
+
<template #light>Light mode is on</template>
|
|
73
|
+
</LightOrDark>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Provided props on `LightOrDark` component will be available using scoped slot props:
|
|
77
|
+
|
|
78
|
+
```md
|
|
79
|
+
<LightOrDark width="100" alt="some image">
|
|
80
|
+
<template #dark="props">
|
|
81
|
+
<img src="/dark.png" v-bind="props"/>
|
|
82
|
+
</template>
|
|
83
|
+
<template #light="props">
|
|
84
|
+
<img src="/light.png" v-bind="props"/>
|
|
85
|
+
</template>
|
|
86
|
+
</LightOrDark>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
You can provide markdown in the slots, but you will need to surround the content with blank lines:
|
|
90
|
+
|
|
91
|
+
```md
|
|
92
|
+
<LightOrDark>
|
|
93
|
+
<template #dark>
|
|
94
|
+
|
|
95
|
+

|
|
96
|
+
|
|
97
|
+
</template>
|
|
98
|
+
<template #light>
|
|
99
|
+
|
|
100
|
+

|
|
101
|
+
|
|
102
|
+
</template>
|
|
103
|
+
</LightOrDark>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## `Link`
|
|
107
|
+
|
|
108
|
+
Insert a link you can use to navigate to a given slide.
|
|
109
|
+
|
|
110
|
+
### Usage
|
|
111
|
+
|
|
112
|
+
```md
|
|
113
|
+
<Link to="42">Go to slide 42</Link>
|
|
114
|
+
<Link to="42" title="Go to slide 42"/>
|
|
115
|
+
<Link to="solutions" title="Go to solutions"/>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Props:
|
|
119
|
+
|
|
120
|
+
- `to` (`string | number`): The path of the slide to navigate to (slides path starts from `1`)
|
|
121
|
+
- `title` (`string`): The title to display
|
|
122
|
+
|
|
123
|
+
One can use a string as `to`, provided the corresponding route exists, e.g.
|
|
124
|
+
|
|
125
|
+
```md
|
|
126
|
+
---
|
|
127
|
+
routeAlias: solutions
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
# Now some solutions!
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## `PoweredBySlidev`
|
|
134
|
+
|
|
135
|
+
Renders "Powered by Slidev" with a link to the Slidev website.
|
|
136
|
+
|
|
137
|
+
## `RenderWhen`
|
|
138
|
+
|
|
139
|
+
Render slots depend on whether the context matches (for example whether we are in presenter view).
|
|
140
|
+
|
|
141
|
+
### Usage
|
|
142
|
+
|
|
143
|
+
```md
|
|
144
|
+
<RenderWhen context="presenter">This will only be rendered in presenter view.</RenderWhen>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Context type: `'main' | 'visible' | 'print' | 'slide' | 'overview' | 'presenter' | 'previewNext'`
|
|
148
|
+
|
|
149
|
+
Props:
|
|
150
|
+
|
|
151
|
+
- `context` (`Context | Context[]`): a context or array of contexts you want to check for
|
|
152
|
+
- `'main'`: Render in slides and presenter view (equivalent to ['slide', 'presenter']),
|
|
153
|
+
- `'visible'`: Render the content if it is visible
|
|
154
|
+
- `'print'`: Render in print mode
|
|
155
|
+
- `'slide'`: Render in slides
|
|
156
|
+
- `'overview'`: Render in overview
|
|
157
|
+
- `'presenter'`: Render in presenter view
|
|
158
|
+
- `'previewNext'`: Render in presenter's next slide view
|
|
159
|
+
|
|
160
|
+
Slots:
|
|
161
|
+
|
|
162
|
+
- `#default`: Rendered when the context matches
|
|
163
|
+
- `#fallback`: Rendered when the context does not match
|
|
164
|
+
|
|
165
|
+
## `SlideCurrentNo`
|
|
166
|
+
|
|
167
|
+
Current slide number.
|
|
168
|
+
|
|
169
|
+
### Usage
|
|
170
|
+
|
|
171
|
+
```md
|
|
172
|
+
<SlideCurrentNo />
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## `SlidesTotal`
|
|
176
|
+
|
|
177
|
+
Total number of slides.
|
|
178
|
+
|
|
179
|
+
### Usage
|
|
180
|
+
|
|
181
|
+
```md
|
|
182
|
+
<SlidesTotal />
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## `TitleRenderer`
|
|
186
|
+
|
|
187
|
+
Insert the main title from a slide parsed as HTML.
|
|
188
|
+
|
|
189
|
+
Titles and title levels get automatically retrieved from the first title element of each slide.
|
|
190
|
+
|
|
191
|
+
You can override this automatic behavior for a slide by using the front matter syntax:
|
|
192
|
+
|
|
193
|
+
```yml
|
|
194
|
+
---
|
|
195
|
+
title: Amazing slide title
|
|
196
|
+
level: 2
|
|
197
|
+
---
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Usage
|
|
201
|
+
|
|
202
|
+
The `<TitleRenderer>` component is a virtual component you can import with:
|
|
203
|
+
|
|
204
|
+
```js
|
|
205
|
+
import TitleRenderer from '#slidev/title-renderer'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Then you can use it with:
|
|
209
|
+
|
|
210
|
+
```md
|
|
211
|
+
<TitleRenderer no="42" />
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Props:
|
|
215
|
+
|
|
216
|
+
- `no` (`string | number`): The number of the slide to display the title from (slides starts from `1`)
|
|
217
|
+
|
|
218
|
+
## `Toc`
|
|
219
|
+
|
|
220
|
+
Insert a Table Of Content.
|
|
221
|
+
|
|
222
|
+
If you want a slide to not appear in the `<Toc>` component, you can use the `hideInToc` option in the frontmatter of the slide:
|
|
223
|
+
|
|
224
|
+
```yml
|
|
225
|
+
---
|
|
226
|
+
hideInToc: true
|
|
227
|
+
---
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Titles are displayed using the [`<Titles>` component](#titles)
|
|
231
|
+
|
|
232
|
+
### Usage
|
|
233
|
+
|
|
234
|
+
```md
|
|
235
|
+
<Toc />
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Props:
|
|
239
|
+
|
|
240
|
+
- `columns` (`string | number`, default: `1`): The number of columns of the display
|
|
241
|
+
- `listClass` (`string | string[]`, default: `''`): Classes to apply to the table of contents list
|
|
242
|
+
- `maxDepth` (`string | number`, default: `Infinity`): The maximum depth level of title to display
|
|
243
|
+
- `minDepth` (`string | number`, default: `1`): The minimum depth level of title to display
|
|
244
|
+
- `mode` (`'all' | 'onlyCurrentTree'| 'onlySiblings'`, default: `'all'`):
|
|
245
|
+
- `'all'`: Display all items
|
|
246
|
+
- `'onlyCurrentTree'`: Display only items that are in current tree (active item, parents and children of active item)
|
|
247
|
+
- `'onlySiblings'`: Display only items that are in current tree and their direct siblings
|
|
248
|
+
|
|
249
|
+
## `Transform`
|
|
250
|
+
|
|
251
|
+
Apply scaling or transforming to elements.
|
|
252
|
+
|
|
253
|
+
### Usage
|
|
254
|
+
|
|
255
|
+
```md
|
|
256
|
+
<Transform :scale="0.5">
|
|
257
|
+
<YourElements />
|
|
258
|
+
</Transform>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Props:
|
|
262
|
+
|
|
263
|
+
- `scale` (`number | string`, default `1`): transform scale value
|
|
264
|
+
- `origin` (`string`, default `'top left'`): transform origin value
|
|
265
|
+
|
|
266
|
+
## `Tweet`
|
|
267
|
+
|
|
268
|
+
Embed a tweet.
|
|
269
|
+
|
|
270
|
+
### Usage
|
|
271
|
+
|
|
272
|
+
```md
|
|
273
|
+
<Tweet id="20" />
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Props:
|
|
277
|
+
|
|
278
|
+
- `id` (`number | string`, required): id of the tweet
|
|
279
|
+
- `scale` (`number | string`, default `1`): transform scale value
|
|
280
|
+
- `conversation` (`string`, default `'none'`): [tweet embed parameter](https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference)
|
|
281
|
+
- `cards` (`'hidden' | 'visible'`, default `'visible'`): [tweet embed parameter](https://developer.twitter.com/en/docs/twitter-for-websites/embedded-tweets/guides/embedded-tweet-parameter-reference)
|
|
282
|
+
|
|
283
|
+
## `VAfter`, `VClick` and `VClicks`
|
|
284
|
+
|
|
285
|
+
<LinkCard link="guide/animations#click-animation" />
|
|
286
|
+
|
|
287
|
+
## `VSwitch`
|
|
288
|
+
|
|
289
|
+
Switch between multiple slots based on clicks.
|
|
290
|
+
|
|
291
|
+
<LinkCard link="guide/animations#enter-leave" />
|
|
292
|
+
|
|
293
|
+
- If the `unmount` prop is set to `true`, the previous slot will be unmounted when switching to the next slot. Default is `false`.
|
|
294
|
+
- Use the `tag` and `childTag` props to change the default tag of the component and its children. Default is `div`.
|
|
295
|
+
- Use the `transition` prop to change the transition effect. Default is `false` (disabled).
|
|
296
|
+
|
|
297
|
+
## `VDrag`
|
|
298
|
+
|
|
299
|
+
<LinkCard link="features/draggable" />
|
|
300
|
+
|
|
301
|
+
## `SlidevVideo`
|
|
302
|
+
|
|
303
|
+
Embed a video.
|
|
304
|
+
|
|
305
|
+
### Usage
|
|
306
|
+
|
|
307
|
+
```md
|
|
308
|
+
<SlidevVideo v-click autoplay controls>
|
|
309
|
+
<!-- Anything that can go in an HTML video element. -->
|
|
310
|
+
<source src="/myMovie.mp4" type="video/mp4" />
|
|
311
|
+
<source src="/myMovie.webm" type="video/webm" />
|
|
312
|
+
<p>
|
|
313
|
+
Your browser does not support videos. You may download it
|
|
314
|
+
<a href="/myMovie.mp4">here</a>.
|
|
315
|
+
</p>
|
|
316
|
+
</SlidevVideo>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Check [HTML video element's doc](https://developer.mozilla.org/docs/Web/HTML/Element/Video) to see what can be included in this component's slot.
|
|
320
|
+
|
|
321
|
+
Props:
|
|
322
|
+
|
|
323
|
+
- `controls` (`boolean`, default: `false`): show the video controls
|
|
324
|
+
- `autoplay` (`boolean | 'once'`, default: `false`):
|
|
325
|
+
- `true` or `'once'`: start the video only once and does not restart it once ended or paused
|
|
326
|
+
- `false`: never automatically start the video (rely on `controls` instead)
|
|
327
|
+
- `autoreset` (`'slide' | 'click'`, default: `undefined`):
|
|
328
|
+
- `'slide'`: go back to the start of the video when going back to the slide
|
|
329
|
+
- `'click'`: go back to the start of the video when going back to the component's click turn
|
|
330
|
+
- `poster` (`string | undefined`, default: `undefined`):
|
|
331
|
+
- The source of the image to print when the video is not playing.
|
|
332
|
+
- `printPoster` (`string | undefined`, default: `undefined`):
|
|
333
|
+
- The override for `poster` when printing.
|
|
334
|
+
- `timestamp` (`string | number`, default: `0`):
|
|
335
|
+
- The starting time of the video in seconds.
|
|
336
|
+
- `printTimestamp` (`string | number | 'last' | undefined`, default: `undefined`):
|
|
337
|
+
- The override for `timestamp` when printing.
|
|
338
|
+
|
|
339
|
+
::: warning
|
|
340
|
+
When exporting, the video may fail to load because Chromium does not support some video formats. In this case, you can specify the executable path of the browser. See [Chromium executable path](/guide/exporting.html#executable-path) for more information.
|
|
341
|
+
:::
|
|
342
|
+
|
|
343
|
+
## `Youtube`
|
|
344
|
+
|
|
345
|
+
Embed a YouTube video.
|
|
346
|
+
|
|
347
|
+
### Usage
|
|
348
|
+
|
|
349
|
+
```md
|
|
350
|
+
<Youtube id="luoMHjh-XcQ" />
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
Props:
|
|
354
|
+
|
|
355
|
+
- `id` (`string`, required): id of the YouTube video
|
|
356
|
+
- `width` (`number`): width of the video
|
|
357
|
+
- `height` (`number`): height of the video
|
|
358
|
+
|
|
359
|
+
You can also make the video start at a specific time if you add `?start=1234` to the id value (where `1234` is seconds),
|