Эта функция настройки будет работать только на стороне Node.js, вы также можете получить доступ к API Node.
+=======
+
+
+ Environment:
+ {{ type }}
+
+
+
+
+ This setup function will run on both Node.js and client side. Avoid using either Node's or DOM API to avoid runtime errors.
+
+
+ This setup function will only run on Node.js environment, you can have access to Node's API.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Эта функция настройки будет работать только на клиентской стороне. При импорте пакетов убедитесь в совместимости браузера.
diff --git a/.vitepress/theme/components/Home.vue b/.vitepress/theme/components/Home.vue
deleted file mode 100644
index 59b6eff..0000000
--- a/.vitepress/theme/components/Home.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
+
+```
+
+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.
+
+Parameters:
+
+- `controls` (`boolean`, default: `false`): show the video controls
+- `autoplay` (`boolean | 'once'`, default: `false`):
+ - `true` or `'once'`: start the video only once and does not restart it once ended or paused
+ - `false`: never automatically start the video (rely on `controls` instead)
+- `autoreset` (`'slide' | 'click'`, default: `undefined`):
+ - `'slide'`: go back to the start of the video when going back to the slide
+ - `'click'`: go back to the start of the video when going back to the component's click turn
+- `poster` (`string | undefined`, default: `undefined`):
+ - The source of the image to print when the video is not playing.
+- `printPoster` (`string | undefined`, default: `undefined`):
+ - The override for `poster` when printing.
+- `timestamp` (`string | number`, default: `0`):
+ - The starting time of the video in seconds.
+- `printTimestamp` (`string | number | 'last' | undefined`, default: `undefined`):
+ - The override for `timestamp` when printing.
+
+::: warning
+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.
+:::
+
+### `Youtube`
+
+Embed a youtube video.
+
+#### Usage
+
+```md
+
+```
+
+Parameters:
+
+- `id` (`string`, required): id of the youtube video
+- `width` (`number`): width of the video
+- `height` (`number`): height of the video
+
+You can also make the video start at specific time if you add `?start=1234` to the id value (where 1234 are seconds),
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Кастомные компоненты
diff --git a/builtin/layouts.md b/builtin/layouts.md
index 7cb00c0..1bdc805 100644
--- a/builtin/layouts.md
+++ b/builtin/layouts.md
@@ -4,10 +4,13 @@
> Поскольку темы могут переопределять поведение макетов, лучший способ узнать точное использование, параметры и примеры - обратиться к их документации.
-
### `center`
+<<<<<<< HEAD
Отображает содержимое в центре экрана.
+=======
+Displays the content in the middle of the screen.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
### `cover`
@@ -15,7 +18,11 @@
### `default`
+<<<<<<< HEAD
Самый простой макет для отображения любого вида контента.
+=======
+The most basic layout, to display any kind of content.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
### `end`
@@ -39,8 +46,13 @@
---
layout: image-left
+<<<<<<< HEAD
# источник изображения
image: ./path/to/the/image
+=======
+# the image source
+image: /path/to/the/image
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
# пользовательское имя класса для содержимого
class: my-cool-content-on-the-right
@@ -57,8 +69,13 @@ class: my-cool-content-on-the-right
---
layout: image-right
+<<<<<<< HEAD
# источник изображения
image: ./path/to/the/image
+=======
+# the image source
+image: /path/to/the/image
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
# пользовательское имя класса для содержимого
class: my-cool-content-on-the-left
@@ -75,11 +92,33 @@ class: my-cool-content-on-the-left
---
layout: image
+<<<<<<< HEAD
# источник изображения
image: ./path/to/the/image
+=======
+# the image source
+image: /path/to/the/image
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
+---
+```
+
+You can change the default background size (`cover`) by adding the `backgroundSize` attribute:
+
+```yaml
+---
+layout: image
+image: /path/to/the/image
+backgroundSize: contain
---
```
+```yaml
+---
+layout: image-left
+image: /path/to/the/image
+backgroundSize: 20em 70%
+---
+```
### `iframe-left`
@@ -132,7 +171,6 @@ url: https://github.com/slidevjs/slidev
---
```
-
### `intro`
Представление презентации, обычно с указанием названия презентации, краткого описания, автора и т.д.
@@ -159,7 +197,6 @@ url: https://github.com/slidevjs/slidev
#### Использование
-
```md
---
layout: two-cols
@@ -176,7 +213,37 @@ layout: two-cols
Это отобразится справа
```
+<<<<<<< HEAD
## Кастомные шаблоны
+=======
+### `two-cols-header`
+
+Separates the upper and lower lines of the page content, and the second line separates the left and right columns.
+
+#### Usage
+
+```md
+---
+layout: two-cols-header
+---
+
+This spans both
+
+::left::
+
+# Left
+
+This shows on the left
+
+::right::
+
+# Right
+
+This shows on the right
+```
+
+## Custom Layouts
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Создайте папку `layouts/` в корне вашего проекта, и просто вставьте в неё ваши кастомные Vue-компоненты.
diff --git a/components.d.ts b/components.d.ts
new file mode 100644
index 0000000..fc3f307
--- /dev/null
+++ b/components.d.ts
@@ -0,0 +1,73 @@
+/* eslint-disable */
+// @ts-nocheck
+// Generated by unplugin-vue-components
+// Read more: https://github.com/vuejs/core/pull/3399
+export {}
+
+/* prettier-ignore */
+declare module 'vue' {
+ export interface GlobalComponents {
+ Arrow: typeof import('./.vitepress/@slidev/client/builtin/Arrow.vue')['default']
+ AutoFitText: typeof import('./.vitepress/@slidev/client/builtin/AutoFitText.vue')['default']
+ 'Carbon:chevronLeft': typeof import('~icons/carbon/chevron-left')['default']
+ 'Carbon:chevronRight': typeof import('~icons/carbon/chevron-right')['default']
+ 'Carbon:logoGithub': typeof import('~icons/carbon/logo-github')['default']
+ 'Carbon:logoTwitter': typeof import('~icons/carbon/logo-twitter')['default']
+ 'Carbon:presentationFile': typeof import('~icons/carbon/presentation-file')['default']
+ 'Carbon:video': typeof import('~icons/carbon/video')['default']
+ CarbonApps: typeof import('~icons/carbon/apps')['default']
+ CarbonArrowLeft: typeof import('~icons/carbon/arrow-left')['default']
+ CarbonArrowRight: typeof import('~icons/carbon/arrow-right')['default']
+ CarbonBadge: typeof import('~icons/carbon/badge')['default']
+ CarbonDownload: typeof import('~icons/carbon/download')['default']
+ CarbonEdit: typeof import('~icons/carbon/edit')['default']
+ CarbonInformation: typeof import('~icons/carbon/information')['default']
+ CarbonMaximize: typeof import('~icons/carbon/maximize')['default']
+ CarbonMinimize: typeof import('~icons/carbon/minimize')['default']
+ CarbonMoon: typeof import('~icons/carbon/moon')['default']
+ CarbonPen: typeof import('~icons/carbon/pen')['default']
+ CarbonSettingsAdjust: typeof import('~icons/carbon/settings-adjust')['default']
+ CarbonSun: typeof import('~icons/carbon/sun')['default']
+ CarbonUserAvatar: typeof import('~icons/carbon/user-avatar')['default']
+ CarbonUserSpeaker: typeof import('~icons/carbon/user-speaker')['default']
+ CarbonVideo: typeof import('~icons/carbon/video')['default']
+ CodeBlockWrapper: typeof import('./.vitepress/@slidev/client/builtin/CodeBlockWrapper.vue')['default']
+ CodiconAdd: typeof import('~icons/codicon/add')['default']
+ CodiconEye: typeof import('~icons/codicon/eye')['default']
+ CodiconGlobe: typeof import('~icons/codicon/globe')['default']
+ CodiconLock: typeof import('~icons/codicon/lock')['default']
+ CodiconRunAll: typeof import('~icons/codicon/run-all')['default']
+ Demo: typeof import('./.vitepress/theme/components/Demo.vue')['default']
+ DemoEditor: typeof import('./.vitepress/theme/components/DemoEditor.vue')['default']
+ DemoSlide: typeof import('./.vitepress/theme/components/DemoSlide.vue')['default']
+ Environment: typeof import('./.vitepress/theme/components/Environment.vue')['default']
+ LandingPage: typeof import('./.vitepress/theme/components/LandingPage.vue')['default']
+ Link: typeof import('./.vitepress/@slidev/client/builtin/Link.vue')['default']
+ LogosVue: typeof import('~icons/logos/vue')['default']
+ MdiAccountCircle: typeof import('~icons/mdi/account-circle')['default']
+ Mermaid: typeof import('./.vitepress/@slidev/client/builtin/Mermaid.vue')['default']
+ Monaco: typeof import('./.vitepress/@slidev/client/builtin/Monaco.vue')['default']
+ PlantUml: typeof import('./.vitepress/@slidev/client/builtin/PlantUml.vue')['default']
+ RenderWhen: typeof import('./.vitepress/@slidev/client/builtin/RenderWhen.vue')['default']
+ RouterLink: typeof import('vue-router')['RouterLink']
+ RouterView: typeof import('vue-router')['RouterView']
+ ShowCaseInfo: typeof import('./.vitepress/theme/components/ShowCaseInfo.vue')['default']
+ ShowCases: typeof import('./.vitepress/theme/components/ShowCases.vue')['default']
+ SimpleIconsGithub: typeof import('~icons/simple-icons/github')['default']
+ SimpleIconsNpm: typeof import('~icons/simple-icons/npm')['default']
+ SlideCurrentNo: typeof import('./.vitepress/@slidev/client/builtin/SlideCurrentNo.vue')['default']
+ SlidesTotal: typeof import('./.vitepress/@slidev/client/builtin/SlidesTotal.vue')['default']
+ Starport: typeof import('vue-starport')['Starport']
+ StarportCarrier: typeof import('vue-starport')['StarportCarrier']
+ ThemeGallery: typeof import('./.vitepress/theme/components/ThemeGallery.vue')['default']
+ ThemeInfo: typeof import('./.vitepress/theme/components/ThemeInfo.vue')['default']
+ TheTweet: typeof import('./.vitepress/theme/components/TheTweet.vue')['default']
+ Toc: typeof import('./.vitepress/@slidev/client/builtin/Toc.vue')['default']
+ TocList: typeof import('./.vitepress/@slidev/client/builtin/TocList.vue')['default']
+ Transform: typeof import('./.vitepress/@slidev/client/builtin/Transform.vue')['default']
+ Tweet: typeof import('./.vitepress/@slidev/client/builtin/Tweet.vue')['default']
+ TwemojiCatWithTearsOfJoy: typeof import('~icons/twemoji/cat-with-tears-of-joy')['default']
+ UimRocket: typeof import('~icons/uim/rocket')['default']
+ Youtube: typeof import('./.vitepress/@slidev/client/builtin/Youtube.vue')['default']
+ }
+}
diff --git a/custom/config-mermaid.md b/custom/config-mermaid.md
index a925cfe..b7acccc 100644
--- a/custom/config-mermaid.md
+++ b/custom/config-mermaid.md
@@ -14,5 +14,39 @@ export default defineMermaidSetup(() => {
})
```
+<<<<<<< HEAD
С помощью этой записи вы можете указать дефолтные настройки для [Mermaid](https://mermaid-js.github.io/). Посмотрите определения типов и их документацию для получения более подробной информации.
+=======
+With the setup, you can provide a custom default setting for [Mermaid](https://mermaid-js.github.io/). Refer to the type definitions and its documentation for more details.
+
+## Custom theme/styles
+
+In case you want to create your custom Mermaid themes or styles, you can do this by defining `themeVariables` like in the following example:
+
+```ts
+import { defineMermaidSetup } from '@slidev/types'
+
+export default defineMermaidSetup(() => {
+ return {
+ theme: 'base',
+ themeVariables: {
+ // General theme variables
+ noteBkgColor: '#181d29',
+ noteTextColor: '#F3EFF5cc',
+ noteBorderColor: '#404551',
+
+ // Sequence diagram variables
+ actorBkg: '#0E131F',
+ actorBorder: '#44FFD2',
+ actorTextColor: '#F3EFF5',
+ actorLineColor: '#F3EFF5',
+ signalColor: '#F3EFF5',
+ signalTextColor: '#F3EFF5',
+ }
+ }
+})
+```
+
+You can find all theme variables on the [Mermaid Theme Configuration](https://mermaid.js.org/config/theming.html) page.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/custom/config-monaco.md b/custom/config-monaco.md
index 05ea0e7..9782a6d 100644
--- a/custom/config-monaco.md
+++ b/custom/config-monaco.md
@@ -18,14 +18,15 @@ export default defineMonacoSetup(async (monaco) => {
Чтобы использовать Monaco в своих слайдах, просто добавьте `{monaco}` в фрагменты кода:
-~~~js
-//```js
+````md
+```js {monaco} // [!code ++]
const count = ref(1)
const plusOne = computed(() => count.value + 1)
console.log(plusOne.value) // 2
plusOne.value++ // error
+<<<<<<< HEAD
//```
~~~
@@ -50,26 +51,79 @@ plusOne.value++ // error
---
monaco: true # по умолчанию "dev"
---
+=======
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```
+````
+<<<<<<< HEAD
## Автоматическая установка типов
+=======
+## TypeScript Types
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Когда вы используете TypeScript с Monaco, типы для зависимостей будут автоматически установлены на клиентской стороне.
-~~~ts
-//```ts {monaco}
+````md
+```ts {monaco}
import { ref } from 'vue'
import { useMouse } from '@vueuse/core'
const counter = ref(0)
-//```
-~~~
+```
+````
+<<<<<<< HEAD
В приведённом выше примере убедитесь, что `vue` и `@vueuse/core` установлены локально как dependencies / devDependencies, Slidev сделает все остальное, чтобы типы для редактора работали автоматически!
+=======
+In the example above, make sure `vue` and `@vueuse/core` are installed locally as dependencies / devDependencies, Slidev will handle the rest to get the types working for the editor automatically. When deploy as SPA, those types will also be bundled for static hosting.
+
+### Additional Types
+
+Slidev will scan all the monaco codeblocks in your slides and import the types for those used libraries for you. In case it missed some, you can explicitly specify extra packages to import the types for:
+
+```md
+---
+monacoTypesAdditionalPackages:
+ - lodash-es
+ - foo
+---
+```
+
+### Auto Type Acquisition
+
+You can optionally switch to load types from CDN by setting the following headmatter:
+
+```md
+---
+monacoTypesSource: ata
+---
+```
+
+This feature is powered by [`@typescript/ata`](https://github.com/microsoft/TypeScript-Website/tree/v2/packages/ata) and runs completely on the client-side.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Конфигурация тем
+<<<<<<< HEAD
Тема контролируется Slidev на основе светлой/темной темы. Если вы хотите настроить ее, вы можете передать идентификатор темы в функцию настройки:
+=======
+Since v0.48.0, Monaco will reuse the Shiki theme you configured in [Shiki's setup file](/custom/highlighters#configure-shiki), powered by [`@shikijs/monaco`](https://shiki.style/packages/monaco). You don't need to worry about it anymore and it will have a consistent style with the rest of your code blocks.
+
+## Configure the Editor
+
+> Available since v0.43.0
+
+If you would like to customize the Monaco editor you may pass an `editorOptions` object that matches the [Monaco IEditorOptions](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor.IEditorOptions.html) definition.
+
+````md
+```ts {monaco} { editorOptions: { wordWrap:'on'} }
+console.log('HelloWorld')
+```
+````
+
+Alternatively if you would like these options to be applied to every Monaco instance, you can return them in the `defineMonacoSetup` function
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```ts
// ./setup/monaco.ts
@@ -77,19 +131,22 @@ import { defineMonacoSetup } from '@slidev/types'
export default defineMonacoSetup(() => {
return {
- theme: {
- dark: 'vs-dark',
- light: 'vs',
- },
+ editorOptions: {
+ wordWrap: 'on'
+ }
}
})
```
+<<<<<<< HEAD
Если вы хотите загрузить собственные темы:
+=======
+## Disabling
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-```ts
-import { defineMonacoSetup } from '@slidev/types'
+Since v0.48.0, Monaco editor is enabled by default and only be bundled when you use it. If you want to disable it, you can set `monaco` to `false` in the frontmatter of your slide:
+<<<<<<< HEAD
// измените на свои темы
import dark from 'theme-vitesse/themes/vitesse-dark.json'
import light from 'theme-vitesse/themes/vitesse-light.json'
@@ -108,3 +165,10 @@ export default defineMonacoSetup((monaco) => {
```
> Если вы создаете тему для Slidev, используйте динамический `import()` внутри функции настройки, чтобы получить лучшие результаты при tree-shaking и code-splitting.
+=======
+```yaml
+---
+monaco: false # can also be `dev` or `build` tp conditionally enable it
+---
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/custom/config-parser.md b/custom/config-parser.md
new file mode 100644
index 0000000..bfcd98a
--- /dev/null
+++ b/custom/config-parser.md
@@ -0,0 +1,177 @@
+# Configure and Extend the Parser
+
+Slidev parses your presentation file (e.g. `slides.md`) in three steps:
+
+1. A "preparsing" step is carried out: the file is split into slides using the `---` separator, and considering the possible frontmatter blocks.
+2. Each slide is parsed with an external library.
+3. Slidev resolves the special frontmatter property `src: ....`, which allows to include other md files.
+
+## Markdown Parser
+
+Configuring the markdown parser used in step 2 can be done by [configuring Vite internal plugins](/custom/config-vite#configure-internal-plugins).
+
+## Preparser Extensions
+
+> Available since v0.37.0.
+
+:::warning
+Important: when modifying the preparser configuration, you need to stop and start slidev again (restart might not be sufficient).
+:::
+
+The preparser (step 1 above) is highly extensible and allows to implement custom syntaxes for your md files. Extending the preparser is considered **an advanced feature** and is susceptible to break [editor integrations](/guide/editors) due to implicit changes in the syntax.
+
+To customize it, create a `./setup/preparser.ts` file with the following content:
+
+```ts
+import { definePreparserSetup } from '@slidev/types'
+
+export default definePreparserSetup(({ filepath, headmatter, mode }) => {
+ return [
+ {
+ transformRawLines(lines) {
+ for (const i in lines) {
+ if (lines[i] === '@@@')
+ lines[i] = 'HELLO'
+ }
+ },
+ }
+ ]
+})
+```
+
+This example systematically replaces any `@@@` line by a line with `hello`. It illustrates the structure of a preparser configuration file and some of the main concepts the preparser involves:
+
+- `definePreparserSetup` must be called with a function as parameter.
+- The function receives the file path (of the root presentation file), the headmatter (from the md file) and, since v0.48.0, a mode (dev, build or export). It could use this information (e.g., enable extensions based on the presentation file or whether we are exporting a PDF).
+- The function must return a list of preparser extensions.
+- An extension can contain:
+ - a `transformRawLines(lines)` function that runs just after parsing the headmatter of the md file and receives a list of all lines (from the md file). The function can mutate the list arbitrarily.
+ - a `transformSlide(content, frontmatter)` function that is called for each slide, just after splitting the file, and receives the slide content as a string and the frontmatter of the slide as an object. The function can mutate the frontmatter and must return the content string (possibly modified, possibly `undefined` if no modifications have been done).
+ - a `name`
+
+## Example Preparser Extensions
+
+### Use case 1: compact syntax top-level presentation
+
+Imagine a situation where (part of) your presentation is mainly showing cover images and including other md files. You might want a compact notation where for instance (part of) `slides.md` is as follows:
+
+
+
+```md
+@cover: /nice.jpg
+# Welcome
+@src: page1.md
+@src: page2.md
+@cover: /break.jpg
+@src: pages3-4.md
+@cover: https://source.unsplash.com/collection/94734566/1920x1080
+# Questions?
+see you next time
+```
+
+To allow these `@src:` and `@cover:` syntaxes, create a `./setup/preparser.ts` file with the following content:
+
+```ts
+import { definePreparserSetup } from '@slidev/types'
+
+export default definePreparserSetup(() => {
+ return [
+ {
+ transformRawLines(lines) {
+ let i = 0
+ while (i < lines.length) {
+ const l = lines[i]
+ if (l.match(/^@cover:/i)) {
+ lines.splice(
+ i,
+ 1,
+ '---',
+ 'layout: cover',
+ `background: ${l.replace(/^@cover: */i, '')}`,
+ '---',
+ ''
+ )
+ continue
+ }
+ if (l.match(/^@src:/i)) {
+ lines.splice(
+ i,
+ 1,
+ '---',
+ `src: ${l.replace(/^@src: */i, '')}`,
+ '---',
+ ''
+ )
+ continue
+ }
+ i++
+ }
+ }
+ },
+ ]
+})
+```
+
+And that's it.
+
+### Use case 2: using custom frontmatter to wrap slides
+
+Imagine a case where you often want to scale some of your slides but still want to use a variety of existing layouts so create a new layout would not be suited.
+For instance, you might want to write your `slides.md` as follows:
+
+
+
+```md
+---
+layout: quote
+_scale: 0.75
+---
+
+# Welcome
+
+> great!
+
+---
+_scale: 4
+---
+# Break
+
+---
+
+# Ok
+
+---
+layout: center
+_scale: 2.5
+---
+# Questions?
+see you next time
+```
+
+Here we used an underscore in `_scale` to avoid possible conflicts with existing frontmatter properties (indeed, the case of `scale`, without underscore would cause potential problems).
+
+To handle this `_scale: ...` syntax in the frontmatter, create a `./setup/preparser.ts` file with the following content:
+
+```ts
+import { definePreparserSetup } from '@slidev/types'
+
+export default definePreparserSetup(() => {
+ return [
+ {
+ transformSlide(content, frontmatter) {
+ if ('_scale' in frontmatter) {
+ return [
+ ``,
+ '',
+ content,
+ '',
+ ''
+ ].join('\n')
+ }
+ },
+ },
+ ]
+})
+```
+
+And that's it.
diff --git a/custom/config-shortcuts.md b/custom/config-shortcuts.md
index feafe61..6472499 100644
--- a/custom/config-shortcuts.md
+++ b/custom/config-shortcuts.md
@@ -2,15 +2,25 @@
> Доступно с версии v0.20
+> Since v0.35.6 (excluded), you decide which base shortcuts to keep (see `...base,` below).
+
+<<<<<<< HEAD
Создайте `./setup/shortcuts.ts` со следующим содержанием:
+=======
+## Getting started
+
+Create `./setup/shortcuts.ts` with the following content:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```ts
-import { defineShortcutsSetup, NavOperations } from '@slidev/types'
+import type { NavOperations, ShortcutOptions } from '@slidev/types'
+import { defineShortcutsSetup } from '@slidev/types'
-export default defineShortcutsSetup((nav: NavOperations) => {
+export default defineShortcutsSetup((nav: NavOperations, base: ShortcutOptions[]) => {
return [
+ ...base, // keep the existing shortcuts
{
key: 'enter',
fn: () => nav.next(),
@@ -29,4 +39,50 @@ export default defineShortcutsSetup((nav: NavOperations) => {
Функция получает объект с некоторыми методами навигации и возвращает массив, содержащий некоторую конфигурацию горячих клавиш. Посмотрите определения типов для получения более подробной информации.
-Подробнее о событиях нажатия клавиш в [useMagicKeys | VueUse](https://vueuse.org/core/useMagicKeys/).
\ No newline at end of file
+<<<<<<< HEAD
+Подробнее о событиях нажатия клавиш в [useMagicKeys | VueUse](https://vueuse.org/core/useMagicKeys/).
+=======
+## Advanced key binding
+
+The `key` type only allows for strings, but you can still bind multiple keys by using following convention:
+
+```ts
+import type { NavOperations, ShortcutOptions } from '@slidev/types'
+import { defineShortcutsSetup } from '@slidev/types'
+
+export default defineShortcutsSetup((nav: NavOperations, base: ShortcutOptions[]) => {
+ return [
+ ...base,
+ {
+ key: 'ShiftLeft+ArrowRight',
+ fn: () => nav.next(),
+ autoRepeat: true,
+ }
+ ]
+})
+```
+
+## Advanced navigation features
+
+The `nav` navigation operations allows you to access some functionalities than basic _next slide_ or _previous slide_. See the following for use-cases:
+
+```ts
+import { NavOperations, defineShortcutsSetup } from '@slidev/types'
+
+export default defineShortcutsSetup((nav: NavOperations) => {
+ return [
+ {
+ key: 'e',
+
+ // Set the `e` keyboard shortcut to be used as a bookmark
+ // or quick-access of sorts, to navigate specifically to
+ // slide number 42
+ fn: () => nav.go(42),
+ autoRepeat: true,
+ }
+ ]
+})
+```
+
+Refer to [useMagicKeys | VueUse](https://vueuse.org/core/useMagicKeys/) for more details about key pressed event.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/custom/config-unocss.md b/custom/config-unocss.md
new file mode 100644
index 0000000..65ef03b
--- /dev/null
+++ b/custom/config-unocss.md
@@ -0,0 +1,46 @@
+# Configure UnoCSS
+
+
+
+[UnoCSS](https://unocss.dev) is now the default CSS framework for Slidev since v0.42.0. UnoCSS is an fast atomic CSS engine that has full flexibility and extensibility.
+
+By default, Slidev enables the following presets out-of-box:
+
+- [@unocss/preset-uno](https://unocss.dev/presets/uno) - Tailwind / Windi CSS compatible utilities
+- [@unocss/preset-attributify](https://unocss.dev/presets/attributify) - Attributify mode
+- [@unocss/preset-icons](https://unocss.dev/presets/icons) - Use any icons as class
+- [@unocss/preset-web-fonts](https://unocss.dev/presets/web-fonts) - Use web fonts at ease
+- [@unocss/transformer-directives](https://unocss.dev/transformers/directives) - Use `@apply` in CSS
+
+Slidev also adds shortcuts as can be seen in its [source code](https://github.com/slidevjs/slidev/blob/main/packages/client/uno.config.ts).
+
+You can therefore style your content the way you want. For example:
+
+```html
+
+
+### Name
+
+- Item 1
+- Item 2
+
+
+```
+
+## Configurations
+
+You can create `uno.config.ts` under the root of your project to extend the builtin configurations
+
+```ts
+import { defineConfig } from 'unocss'
+
+export default defineConfig({
+ shortcuts: {
+ // custom the default background
+ 'bg-main': 'bg-white text-[#181818] dark:(bg-[#121212] text-[#ddd])',
+ },
+ // ...
+})
+```
+
+Learn more about [UnoCSS configurations](https://unocss.dev/guide/config-file)
diff --git a/custom/config-vite.md b/custom/config-vite.md
index 8793f81..255db1a 100644
--- a/custom/config-vite.md
+++ b/custom/config-vite.md
@@ -2,7 +2,11 @@
+<<<<<<< HEAD
Под капотом Slidev работает на [Vite](http://vitejs.dev/). Это означает, что вы можете использовать отличную систему плагинов Vite, чтобы ещё больше настраивать свои слайды.
+=======
+Slidev is powered by [Vite](https://vitejs.dev/) under the hood. This means you can leverage Vite's great plugin system to customize your slides even further.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Создайте `vite.config.ts`, если хотите настроить Vite.
@@ -11,9 +15,9 @@
- [@vitejs/plugin-vue](https://github.com/vitejs/vite/tree/main/packages/plugin-vue)
- [unplugin-vue-components](https://github.com/antfu/unplugin-vue-components)
- [unplugin-icons](https://github.com/antfu/unplugin-icons)
-- [vite-plugin-md](https://github.com/antfu/vite-plugin-md)
-- [vite-plugin-windicss](https://github.com/windicss/vite-plugin-windicss)
+- [vite-plugin-vue-markdown](https://github.com/antfu/vite-plugin-vue-markdown)
- [vite-plugin-remote-assets](https://github.com/antfu/vite-plugin-remote-assets)
+- [unocss/vite](https://github.com/unocss/unocss/tree/main/packages/vite)
Узнайте больше о [предварительных настройках здесь](https://github.com/slidevjs/slidev/blob/main/packages/slidev/node/plugins/preset.ts).
diff --git a/custom/config-windicss.md b/custom/config-windicss.md
index a7f5356..3e38790 100644
--- a/custom/config-windicss.md
+++ b/custom/config-windicss.md
@@ -2,12 +2,20 @@
+<<<<<<< HEAD
Markdown, естественно, поддерживает встроенные разметки HTML. Таким образом, вы можете стилизовать свой контент так, как захотите. Для некоторого удобства у нас есть встроенный [Windi CSS](https://github.com/windicss/windicss), так что вы можете стилизовать разметку напрямую с помощью utility-классов.
+=======
+::: warning
+Since Slidev v0.47.0, we no longer support Windi CSS. Please migrate to [UnoCSS](/custom/config-unocss).
+:::
+
+Markdown naturally supports embedded HTML markups. You can therefore style your content the way you want.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Например:
```html
-
+
### Имя
diff --git a/custom/directory-structure.md b/custom/directory-structure.md
index e31e5a9..539fb0f 100644
--- a/custom/directory-structure.md
+++ b/custom/directory-structure.md
@@ -9,11 +9,19 @@ your-slidev/
├── components/ # кастомные компоненты
├── layouts/ # кастомные шаблоны
├── public/ # static assets
+<<<<<<< HEAD
├── setup/ # кастомные настройки / хуки
├── styles/ # кастомные стили
├── index.html # инъекции в index.html
├── slides.md # описание слайдов
└── vite.config.ts # расширение конфигурации vite
+=======
+ ├── setup/ # custom setup / hooks
+ ├── styles/ # custom style
+ ├── index.html # injections to index.html
+ ├── slides.md # the main slides entry
+ └── vite.config.ts # extending vite config
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```
Все они необязательны.
@@ -48,7 +56,11 @@ your-slidev/
```
+<<<<<<< HEAD
Эта функция работает благодаря [`vite-plugin-components`](https://github.com/antfu/vite-plugin-components).
+=======
+This feature is powered by [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components), learn more there.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Slidev также предоставляет вам некоторые [встроенные компоненты](/builtin/components).
@@ -115,18 +127,24 @@ import './code.css'
import './layouts.css'
```
+<<<<<<< HEAD
Стили будут обрабатываться через [Windi CSS](http://windicss.org/) и [PostCSS](https://postcss.org/), поэтому вы можете использовать вложенные css стили и [at-директивы](https://windicss.org/features/directives.html) прямо из коробки. Например:
+=======
+Styles will be processed by [UnoCSS](https://unocss.dev/) and [PostCSS](https://postcss.org/), so you can use css nesting and [at-directives](https://unocss.dev/transformers/directives#apply) out-of-box. For example:
+
+
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```less
.slidev-layout {
- @apply px-14 py-10 text-[1.1rem];
+ --uno: px-14 py-10 text-[1.1rem];
h1, h2, h3, h4, p, div {
- @apply select-none;
+ --uno: select-none;
}
pre, code {
- @apply select-text;
+ --uno: select-text;
}
a {
@@ -135,7 +153,11 @@ import './layouts.css'
}
```
+<<<<<<< HEAD
[Подробнее о синтаксисе](https://windicss.org/features/directives.html).
+=======
+[Learn more about the syntax](https://unocss.dev/transformers/directives#apply).
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## `index.html`
@@ -183,5 +205,9 @@ import './layouts.css'
Соглашения: `global-top.vue` | `global-bottom.vue`
+<<<<<<< HEAD
Подробнее: [Глобальные слои](/custom/global-layers)
+=======
+Learn more: [Global Layers](/custom/global-layers)
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/custom/fonts.md b/custom/fonts.md
index c48badf..218b3ce 100644
--- a/custom/fonts.md
+++ b/custom/fonts.md
@@ -9,12 +9,21 @@
```yaml
---
fonts:
+<<<<<<< HEAD
# основной текст
sans: 'Robot'
# использование с css классом `font-serif` от windicss
serif: 'Robot Slab'
# для блоков кода, inline-кода и т.д.
mono: 'Fira Code'
+=======
+ # basically the text
+ sans: Robot
+ # use with `font-serif` css class from UnoCSS
+ serif: Robot Slab
+ # for code blocks, inline code, etc.
+ mono: Fira Code
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
---
```
@@ -24,15 +33,24 @@ fonts:
## Локальные шрифты
+<<<<<<< HEAD
По умолчанию Slidev считает, что все шрифты, указанные в конфигурациях `fonts`, взяты из Google Fonts. Если вы хотите использовать локальные шрифты, укажите `fonts.local`, чтобы отключить автоматический импорт.
+=======
+By default, Slidev assumes all the fonts specified via `fonts` configurations come from Google Fonts. If you want to use local fonts, specify the `fonts.local` to opt-out the auto-importing.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```yaml
---
fonts:
# вы можете использовать `,` чтобы использовать несколько шрифтов для fallback'а (как font-family в css)
sans: 'Helvetica Neue,Robot'
+<<<<<<< HEAD
# пометить 'Helvetica Neue' как локальный шрифт
local: 'Helvetica Neue'
+=======
+ # mark 'Helvetica Neue' as local font
+ local: Helvetica Neue
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
---
```
@@ -43,8 +61,13 @@ fonts:
```yaml
---
fonts:
+<<<<<<< HEAD
sans: 'Robot'
# по умолчанию
+=======
+ sans: Robot
+ # default
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
weights: '200,400,600'
# импорт курсивных шрифтов, по умолчанию `false`
italic: false
@@ -60,13 +83,19 @@ fonts:
```yaml
---
fonts:
- sans: 'Robot'
- serif: 'Robot Slab'
- mono: 'Fira Code'
+ sans: Robot
+ serif: Robot Slab
+ mono: Fira Code
---
```
+<<<<<<< HEAD
сбилдится в
+=======
+will result in
+
+
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```css
.font-sans {
@@ -86,7 +115,7 @@ fonts:
---
fonts:
mono: 'Fira Code, monospace'
- fallback: false
+ fallbacks: false
---
```
@@ -100,8 +129,6 @@ fonts:
```yaml
---
fonts:
- provide: 'none'
+ provider: none
---
```
-
-
diff --git a/custom/global-layers.md b/custom/global-layers.md
index 5f8777f..237482f 100644
--- a/custom/global-layers.md
+++ b/custom/global-layers.md
@@ -1,5 +1,6 @@
# Глобальные слои
+<<<<<<< HEAD
> Доступно с версии v0.17
Глобальные слои позволяют иметь кастомные компоненты, **постоянно** доступные в слайдах. Это может быть полезно для футера, анимации смены слайдов, глобальных эффектов и т.д.
@@ -11,11 +12,34 @@ Slidev предоставляет два слоя для этого: созда
- Глобальный Top (`global-top.vue`)
- Слайды
- Глобальный Bottom (`global-bottom.vue`)
+=======
+Global layers allow you to have custom components that **persist** across slides. This could be useful for having footers, cross-slide animations, global effects, etc.
+
+Slidev provides three layers for this usage, create `global-top.vue`, `global-bottom.vue` or `custom-nav-controls.vue` under your project root and it will pick up automatically.
+
+There are also layers for **each** slide: `layouts/slide-top.vue` and `layouts/slide-bottom.vue`. The usage is similar to the global layers, but they are applied to every slide, so there may be more than one instance of them.
+
+::: tip
+When exporting, the `--per-slide` option should be used to ensure the global layers are applied to each slide correctly.
+:::
+
+## Layers relationship
+
+At z-axis, from top to bottom:
+
+- NavControls
+ - Customized Navigation Controls (`custom-nav-controls.vue`)
+- Global Top (`global-top.vue`) - single instance
+- Slide Top (`slide-top.vue`) - instance per slide
+- Slide Content
+- Slide Bottom (`slide-bottom.vue`) - instance per slide
+- Global Bottom (`global-bottom.vue`) - single instance
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Примеры
```html
-
+
@@ -23,13 +47,28 @@ Slidev предоставляет два слоя для этого: созда
Текст `Ваше имя` будет отображаться на всех ваших слайдах.
+<<<<<<< HEAD
Чтобы использовать при определённых условиях, вы можете применить его с помощью [глобального контекста Vue](/custom/vue-context).
+=======
+```html
+
+
+
+
+```
+
+The button `Next` will appear in NavControls.
+
+To enable it conditionally, you can apply it with the [Vue Global Context](/custom/vue-context).
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```html
+=======
+
+
+ Hello **World**
+
+
+
Hey!
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```
### `v-after`
+<<<<<<< HEAD
Использование `v-after` очень похоже на `v-click`, но элемент появится только при срабатывании предыдущего `v-click`.
```md
@@ -34,33 +57,218 @@
```
Когда вы нажмёте кнопку «Далее», `Привет` и `Мир` появятся вместе.
+=======
+`v-after` is only provided as a directive. It will turn the element visible when the previous `v-click` is triggered.
+
+```md
+
Hello
+
World
+```
+
+When you press "next", both `Hello` and `World` will show up together.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-### `v-click-hide`
+### Hide after clicking
+<<<<<<< HEAD
То же, что и `v-click`, но вместо того, чтобы отображать элемент, он скроет его после клика.
```md
Привет
+=======
+Add a `.hide` modifier to `v-click` or `v-after` to make the element invisible after clicking, instead of showing up.
+
+```md
+
Visible after 1 click
+
Hidden after 2 click
+
Hidden after 2 click
+```
+
+For `v-click` component, you can use the `hide` prop to achieve the same effect:
+
+```md
+ Visible after 1 click
+ Hidden after 2 click
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```
### `v-clicks`
+<<<<<<< HEAD
`v-clicks` используется только как компонент. Это сокращение для директивы `v-click` ко всем её дочерним элементам. Особенно полезно при работе со списками.
+=======
+`v-clicks` is only provided as a component. It's a shorthand to apply the `v-click` directive to all its child elements. It is especially useful when working with lists and tables.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```md
+<<<<<<< HEAD
- Пункт 1
- Пункт 2
- Пункт 3
- Пункт 4
+=======
+- Item 1
+- Item 2
+- Item 3
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```
+<<<<<<< HEAD
Каждый пункт будет отображаться по клику на «Далее».
### Кастомный счётчик кликов
+=======
+An item will become visible each time you click "next".
+It accepts a `depth` prop for nested list:
+
+```md
+
+
+- Item 1
+ - Item 1.1
+ - Item 1.2
+- Item 2
+ - Item 2.1
+ - Item 2.2
+
+
+```
+
+Also, you can use the `every` prop to specify the number of items to show after each click:
+
+```md
+
+
+- Item 1 (part 1)
+- Item 1 (part 2)
+- Item 2 (part 1)
+- Item 2 (part 2)
+
+
+```
+
+### Positioning
+
+By default, the clicking animations take place one by one. You can customize the animation position of elements by using the `at` prop or the `v-click` directive with value.
+
+Like the CSS layout system, click-animated elements can be "relative" or "absolute":
+
+#### Relative Position
+
+This actual position of relative elements are calculated based on the previous relative elements:
+
+````md
+
visible after 1 click
+
visible after 3 clicks
+
hidden after 2 clicks
+
+```js {none|1|2}{at:'+5'}
+1 // highlighted after 7 clicks
+2 // highlighted after 8 clicks
+```
+````
+
+> [!NOTE]
+> The default value of `v-click` is `'+1'` when you don't specify it.
+
+In fact, `v-after` are just shortcuts for `v-click` with `at` prop:
+
+```md
+
+
+
+
+
+
+
+
+```
+
+:::info
+Only string values start with `'+'` or `'-'` like `'+1'` are treated as relative positions:
+
+| Value | Kind |
+| -------------- | -------- |
+| `'-1'`, `'+1'` | Relative |
+| `+1` === `1` | Absolute |
+| `'1'` | Absolute |
+
+So don't forget the single quotes for the relative values.
+:::
+
+#### Absolute Position
+
+The given value is the exact click count to show the element:
+
+````md
+
visible after 3 clicks
+
visible after 2 clicks
+
hidden after 1 click
+
+```js {none|1|2}{at:3}
+1 // highlighted after 3 clicks
+2 // highlighted after 4 clicks
+```
+````
+
+#### Mixed Case
+
+You can mix the absolute and relative positions:
+
+```md
+
visible after 1 click
+
visible after 3 clicks
+
visible after 2 click
+
visible after 1 click
+
visible after 4 clicks
+```
+
+The following example synchronizes the highlighting of the two code blocks:
+
+````md
+```js {1|2}{at:1}
+1 + 1
+'a' + 'b'
+```
+
+```js {1|2}{at:1}
+2
+'ab'
+```
+````
+
+### Enter & Leave
+
+You can also specify the enter and leave index for the `v-click` directive by passing an array. The end index is exclusive.
+
+```md
+
+ This will be hidden at click 2 and 3.
+
+
+
+ This will be shown at click 3, and hidden since click 4.
+
+```
+
+You can also use `v-switch` to achieve the same effect:
+
+```md
+
+ show at click 1, hide at click 2.
+ show at click 2, hide at click 5.
+ show at click 5, hide at click 7.
+
+```
+
+See [`VSwitch` Component](/builtin/components#vswitch) for more details.
+
+### Custom Total Clicks Count
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
По умолчанию Slidev подсчитывает, сколько шагов нужно сделать, прежде чем перейти к следующему слайду. Вы можете переопределить этот параметр, передав frontmatter опцию `clicks`:
@@ -71,6 +279,7 @@ clicks: 10
---
```
+<<<<<<< HEAD
### Порядок
Передав индекс кликов в свои директивы, вы можете настроить порядок раскрытия
@@ -100,6 +309,9 @@ clicks: 3
```
### Переходы элементов
+=======
+### Element Transitions
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Когда вы применяете директиву `v-click` к элементам, она добавляет к ним класс `slidev-vclick-target`. Когда элементы скрыты, будет добавлен класс `slidev-vclick-hidden`. Например:
@@ -128,12 +340,18 @@ clicks: 3
}
```
+<<<<<<< HEAD
Вы можете переопределить их, чтобы настроить эффекты перехода в своих стилях.
Например, вы можете добавить переход масштабирования следующим образом:
+=======
+You can override them to customize the transition effects in your custom stylesheets.
+
+For example, you can achieve the scaling up transitions by:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```css
-// styles.css
+/* styles.css */
.slidev-vclick-target {
transition: all 500ms ease;
@@ -161,7 +379,47 @@ clicks: 3
Подробнее в [кастомизации стилей](/custom/directory-structure#style).
+<<<<<<< HEAD
## Перемещение
+=======
+## Rough Markers
+
+> Available since v0.48.0
+
+Slidev integrates [Rough Notation](https://github.com/linkstrifer/react-rough-notation) to allow marking or highlighting elements in your slides.
+
+### `v-mark`
+
+Rough Notation integrates comes with the `v-mark` directive.
+
+#### Type
+
+`v-mark.underline` for Underline mark, `v-mark.circle` for Circle mark, etc. Default to `underline`
+
+#### Color
+
+`v-mark.red` make the notation `red`. Supported builtin color themes from UnoCSS. For custom colors, use object syntax `v-mark="{ color: '#234' }"`
+
+#### Clicks
+
+`v-mark` works like `v-click` and will trigger after a click. Same as `v-click`, it allows you to pass a custom click value, like `v-mark="5"` or `v-mark="'+1'"`.
+
+#### Options
+
+Optionally you can pass an object to `v-mark` to specify the options, for example:
+
+```vue
+
+Important text
+
+```
+
+#### Preview
+
+
+
+## Motion
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Slidev имеет встроенный [@vueuse/motion](https://motion.vueuse.org/). Вы можете использовать директиву `v-motion` к любым элементам, чтобы применить к ним перемещение. Например
@@ -196,8 +454,116 @@ Slidev имеет встроенный [@vueuse/motion](https://motion.vueuse.or
>
> ```
+<<<<<<< HEAD
Подробнее: [Демо](https://sli.dev/demo/starter/7) | [@vueuse/motion](https://motion.vueuse.org/) | [v-motion](https://motion.vueuse.org/directive-usage.html) | [Presets](https://motion.vueuse.org/presets.html)
## Переходы страниц
> Встроенная поддержка слайдов ЕЩЁ НЕ предусмотрена в текущей версии. Мы планируем добавить их в следующей мажорной версии. Но сейчас вы всё ещё можете использовать свои собственные стили и библиотеки для этого.
+=======
+Learn mode: [Demo](https://sli.dev/demo/starter/7) | [@vueuse/motion](https://motion.vueuse.org/) | [v-motion](https://motion.vueuse.org/features/directive-usage) | [Presets](https://motion.vueuse.org/features/presets)
+
+## Slide Transitions
+
+
+
+> Available since v0.39.0
+
+Slidev supports slide transitions out of the box. You can enable it by setting the `transition` frontmatter option:
+
+```md
+---
+transition: slide-left
+---
+```
+
+This will give you a nice sliding effects on slide switching. Setting it in the frontmatter will apply to all slides. You can also set different transition per slide.
+
+### Builtin Transitions
+
+- `fade` - Crossfade in/out
+- `fade-out` - Fade out and then fade in
+- `slide-left` - Slides to the left (slide to right when going backward)
+- `slide-right` - Slides to the right (slide to left when going backward)
+- `slide-up` - Slides to the top (slide to bottom when going backward)
+- `slide-down` - Slides to the bottom (slide to top when going backward)
+- `view-transition` - Slides with the view transitions API
+
+### View Transitions
+
+> Available since v0.43.0
+
+The **View Transitions API** provides a mechanism for easily creating animated transitions between different DOM states. Learn more how it works in [View Transitions API - MDN Web Docs - Mozilla](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API).
+
+:::warning
+Experimental: This is not supported by all browsers. Check the [Browser compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API#browser_compatibility) carefully before using this.
+:::
+
+You can use the `view-transition-name` CSS property to name view transitions, which creates connections between different page elements and smooth transitions when switching slides.
+
+You can enable [MDC (Markdown Component) Syntax](/guide/syntax#mdc-syntax) support to conveniently name view-transitions:
+
+```md
+---
+transition: view-transition
+mdc: true
+---
+
+# View Transition {.inline-block.view-transition-title}
+
+---
+
+# View Transition {.inline-block.view-transition-title}
+```
+
+### Custom Transitions
+
+Slidev's slide transitions are powered by [Vue Transition](https://vuejs.org/guide/built-ins/transition.html). You can provide your custom transitions by:
+
+```md
+---
+transition: my-transition
+---
+```
+
+and then in your custom stylesheets:
+
+```css
+.my-transition-enter-active,
+.my-transition-leave-active {
+ transition: opacity 0.5s ease;
+}
+
+.my-transition-enter-from,
+.my-transition-leave-to {
+ opacity: 0;
+}
+```
+
+Learn more how it works in [Vue Transition](https://vuejs.org/guide/built-ins/transition.html).
+
+### Forward & Backward Transitions
+
+You can specify different transitions for forward and backward navigation using `|` as a separator in the transition name:
+
+```md
+---
+transition: go-forward | go-backward
+---
+```
+
+With this, when you go from slide 1 to slide 2, the `go-forward` transition will be applied. When you go from slide 2 to slide 1, the `go-backward` transition will be applied.
+
+### Advanced Usage
+
+The `transition` field accepts an option that will passed to the [``](https://vuejs.org/api/built-in-components.html#transition) component. For example:
+
+```md
+---
+transition:
+ name: my-transition
+ enterFromClass: custom-enter-from
+ enterActiveClass: custom-enter-active
+---
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/guide/drawing.md b/guide/drawing.md
index c38f982..58c7633 100644
--- a/guide/drawing.md
+++ b/guide/drawing.md
@@ -2,15 +2,15 @@
> Available since v0.23
-We have [drauu](https://github.com/antfu/drauu) built-in for drawing and annotation that could enhance your presentation further.
+[drauu](https://github.com/antfu/drauu) is built-in for drawing and annotation, should that help improve your presentation further.
-To start, click the icon in the toolbar and start drawing. It's also available in the [Presenter Mode](/guide/presenter-mode). Drawings and annotations you created will be **synced up** automatically across all instances in real-time.
+To start, click the icon in the toolbar and start drawing. It's also available in the [Presenter Mode](/guide/presenter-mode). Drawings and annotations you created will be **synced** automatically across all instances in real time.
-
+
## Use with Stylus Pen
-When using a stylus pen on a tablet (for example, iPad with Apple Pencil), Slidev could smartly detect the input type. You can directly draw on your slides with the pen without turning on the drawing mode, while having your fingers or mouse control the navigation.
+When using a stylus pen on a tablet (for example, iPad with Apple Pencil), Slidev will intelligently detect the input type. You can directly draw on your slides with the pen without turning on the drawing mode, while having your fingers or mouse control the navigation.
## Persist Drawings
@@ -18,7 +18,7 @@ The following frontmatter configuration allows you to persist your drawings as S
```md
---
-drawings:
+drawings:
persist: true
---
```
@@ -29,7 +29,7 @@ Entirely:
```md
---
-drawings:
+drawings:
enabled: false
---
```
@@ -38,7 +38,7 @@ Only in Development:
```md
---
-drawings:
+drawings:
enabled: dev
---
```
@@ -47,22 +47,20 @@ Only in Presenter Mode:
```md
---
-drawings:
+drawings:
presenterOnly: true
---
```
## Drawing Syncing
-By default, Slidev syncs up your drawings across all instances. If you are sharing your slides with others, you might want to disable the syncing by:
+By default, Slidev syncs up your drawings across all instances. If you are sharing your slides with others, you might want to disable the syncing via:
```md
---
-drawings:
+drawings:
syncAll: false
---
```
With this config, only the drawing from the presenter instance will be able to sync with others.
-
-
diff --git a/guide/editors.md b/guide/editors.md
index 0416449..3a7e5b3 100644
--- a/guide/editors.md
+++ b/guide/editors.md
@@ -1,12 +1,20 @@
# Поддержка редакторов
+<<<<<<< HEAD
Поскольку Slidev использует Markdown в качестве источника, вы можете использовать ЛЮБЫЕ редакторы, которые вам нравятся.
+=======
+Since Slidev uses Markdown as the source entry, you can use any editor you prefer to create your slides.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Если вам нужно высокоуровневое управление слайдами, мы подготовили для вас следующие интеграции редакторов!
## Встроенный редактор
+<<<<<<< HEAD
Slidev поставляется со встроенным редактором [CodeMirror](https://codemirror.net/), который мгновенно перезагружает и сохраняет изменения в вашем файле.
+=======
+Slidev comes with an integrated editor that will instantly reload and save the changes to your file.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Нажмите на кнопку , чтобы открыть его.
@@ -32,12 +40,55 @@ Slidev поставляется со встроенным редактором [
### Особенности
+<<<<<<< HEAD
- Просмотр слайдов на боковой панели
- Переход по кнопкам "Далее" / "Назад"
- Изменение порядка слайдов
- Сворачивание блоков слайда
- Преобразование Markdown в HTML
+=======
+- Preview slides in the side panel
+- Slides tree view
+- Re-ordering slides
+- Folding for slide blocks
+- Multiple slides project support
+- Start the dev server with one click
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-
+
-
+::: code-group
+
+
+
+
+
+:::
+
+### Installation
+
+You can install the extension from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=antfu.slidev).
+
+### Usage
+
+Click the `Slidev` icon in the activity bar to open the **Slidev panel**. In the Slidev panel, you can see the projects tree view, slides tree view, and the preview webview.
+
+In the **projects tree view**, you can see all the Slidev projects in your workspace. You can dlick the item to open the corresponding file, and click the icon over it to switch the active project. The icon allows you to load a slides project that wasn't scanned automatically.
+
+In the **slides tree view**, you can see all the slides in the active project. You can click the item to move you cursor to the slide in the editor, and drag and drop to reorder the slides.
+
+In the **preview webview**, you can click the icon to start the dev server and click the icon to open the slides in the browser. Toggle icon to sync/unsync the preview navigation with the editor cursor.
+
+There are also some **commands** you can use. Type `Slidev` in the command palette to see them.
+
+You can add glob patterns to the `slidev.include` configuration to include files as Slidev entries. The default value is `["**/*.md"]`. Example:
+
+```json
+{
+ "slidev.include": ["**/presentation.md"]
+}
+```
+
+## Prettier Plugin
+
+Slidev also provides a Prettier plugin to format your slides. You can use it with your favorite editor that supports Prettier. Docs for the plugin can be found [here](https://github.com/slidevjs/prettier-plugin).
diff --git a/guide/exporting.md b/guide/exporting.md
index 1ad405a..4034c87 100644
--- a/guide/exporting.md
+++ b/guide/exporting.md
@@ -1,22 +1,36 @@
# Экспорт
-## PDF
+## Slides
+<<<<<<< HEAD
> Экспорт в PDF или PNG происходит за счёт [Playwright](https://playwright.dev) рендеринга. Поэтому вам необходимо установить [`playwright-chromium`](https://playwright.dev/docs/installation#download-single-browser-binary), чтобы использовать этот функционал.
> Если вы выполняете экспорт в CI, то взгляните на [руководство по playwright CI](https://playwright.dev/docs/ci).
Установите `playwright-chromium`
+=======
+### PDF
+
+> Exporting to PDF, PPTX, or PNG relies on [Playwright](https://playwright.dev) for rendering. You will therefore need to install [`playwright-chromium`](https://npmjs.com/package/playwright-chromium) to use this feature.
+> If you are exporting within a CI environment, [the playwright CI guide](https://playwright.dev/docs/ci) can be helpful.
+
+1. Install `playwright-chromium`:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```bash
$ npm i -D playwright-chromium
```
+<<<<<<< HEAD
Теперь можете экспортировать слайды в PDF с помощью следующей команды
+=======
+2. Now export your slides to PDF using the following command:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```bash
$ slidev export
```
+<<<<<<< HEAD
Через несколько секунд ваши слайды будут находиться в `./slides-exports.pdf`.
### Экспорт с кликами
@@ -32,11 +46,120 @@ $ slidev export --with-clicks
## PNG
При передаче параметра `--format png` Slidev будет экспортировать каждый слайд в изображения PNG вместо PDF.
+=======
+After a few seconds, your slides will be ready at `./slides-export.pdf`.
+
+### PNGs and Markdown
+
+When passing in the `--format png` option, Slidev will export PNG images for each slide instead of a PDF:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```bash
$ slidev export --format png
```
+You can also compile a markdown file composed of compiled png using `--format md`:
+
+```bash
+$ slidev export --format md
+```
+
+### PPTX (Microsoft PowerPoint)
+
+Slidev can also export your slides as a PPTX file:
+
+```bash
+$ slidev export --format pptx
+```
+
+Note that all the slides in the PPTX file will be exported as images, so the text will not be selectable. Presenter notes will be conveyed into the PPTX file on a per-slide basis.
+
+In this mode, the `--with-clicks` option is enabled by default. To disable it, use `--with-clicks false`.
+
+### Dark mode
+
+In case you want to export your slides using the dark version of the theme, use the `--dark` option:
+
+```bash
+$ slidev export --dark
+```
+
+### Export Clicks Steps
+
+> Available since v0.21
+
+By default, Slidev exports one page per slide with clicks animations disabled. If you want to export slides with multiple steps into multiple pages, pass the `--with-clicks` option:
+
+```bash
+$ slidev export --with-clicks
+```
+
+### PDF outline
+
+> Available since v0.36.10
+
+You can generate the PDF outline by passing the `--with-toc` option:
+
+```bash
+$ slidev export --with-toc
+```
+
+### Output filename
+
+You can specify the output filename with the `--output` option:
+
+```bash
+$ slidev export --output my-pdf-export
+```
+
+Or in the frontmatter configuration:
+
+```yaml
+---
+exportFilename: my-pdf-export
+---
+```
+
+### Export a range of slides
+
+By default, all slides in the presentation are exported. If you want to export a specific slide or a range of slides you can set the `--range` option and specify which slides you would like to export:
+
+```bash
+$ slidev export --range 1,6-8,10
+```
+
+This option accepts both specific slide numbers and ranges.
+
+The example above would export slides 1,6,7,8, and 10.
+
+### Multiple entries
+
+You can also export multiple slides at once:
+
+```bash
+$ slidev export slides1.md slides2.md
+```
+
+Or
+
+```bash
+$ slidev export *.md
+```
+
+In this case, each input file will generate its own PDF file.
+
+## Presenter notes
+
+> Available since v0.36.8
+
+Export only the presenter notes (the last comment block for each slide) into a text document in PDF:
+
+```bash
+$ slidev export-notes
+```
+
+This command also accept multiple entries like for the [export command](#multiple-entries)
+
## Single-Page Application (SPA)
<<<<<<< HEAD
@@ -86,4 +209,68 @@ download: 'https://myside.com/my-talk.pdf'
- [Composable Vue](https://talks.antfu.me/2021/composable-vue) от [Anthony Fu](https://github.com/antfu)
=======
See [Static Hosting](/guide/hosting).
+<<<<<<< HEAD
>>>>>>> ee7ae42035591cb6565a72f5217129c670a59b0c
+=======
+
+## Exportable Docker Image
+
+To support the export feature, there is a [docker image](/guide/install#install-on-docker) (maintained by [@tangramor](https://github.com/tangramor)) with tag **playwright**. Run following command in your work folder:
+
+```bash
+docker run --name slidev --rm -it \
+ -v ${PWD}:/slidev \
+ -p 3030:3030 \
+ -e NPM_MIRROR="https://registry.npmmirror.com" \
+ tangramor/slidev:playwright
+```
+
+Then you can use the export feature like the following under your work folder:
+
+```bash
+docker exec -i slidev npx slidev export --timeout 2m --output slides.pdf
+```
+
+## Troubleshooting
+
+### Timeouts
+
+For big presentations you might want to increase the Playwright timeout with `--timeout`:
+
+```bash
+$ slidev export --timeout 60000
+```
+
+### Wait
+
+Some parts of your slides may require a longer time to render. You can use the `--wait` option to have an extra delay before exporting:
+
+```bash
+$ slidev export --wait 10000
+```
+
+There is also a `--wait-until` option to wait for a state before exporting each slide:
+
+```bash
+$ slidev export --wait-until none
+```
+
+Possible values:
+
+- `'networkidle'` - (_default_) consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
+- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
+- `'load'` - consider operation to be finished when the `load` event is fired.
+- `'none'` - do not wait for any event.
+
+::: warning
+When specifying values other than `'networkidle'`, please make sure the printed slides are complete and correct. If some contents are missing, you may need to use the `--wait` option.
+:::
+
+### Executable path
+
+Chromium may miss some features like codecs that are required to decode some videos. You can set the browser executable path for Playwright to your Chrome or Edge using `--executable-path`:
+
+```bash
+$ slidev export --executable-path [path_to_chromium]
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/guide/faq.md b/guide/faq.md
index 33c8554..fbe0a60 100644
--- a/guide/faq.md
+++ b/guide/faq.md
@@ -4,7 +4,11 @@
Поскольку Slidev использует в своей работе интернет, вы можете использовать любые макеты сетки по своему усмотрению. [CSS Grids](https://css-tricks.com/snippets/css/complete-guide-grid/), [flexboxes](https://css-tricks.com/snippets/css/a-guide-to-flexbox/), или даже [Masonry](https://css-tricks.com/native-css-masonry-layout-in-css-grid/).
+<<<<<<< HEAD
Поскольку у нас есть встроенный [Windi CSS](https://windicss.org/), вот один из простых способов использовать его:
+=======
+Since [UnoCSS](https://unocss.dev/) is built-in, here's one way that you can reference:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```html
@@ -24,7 +28,7 @@
Пойдём дальше, вы можете настроить размер каждого столбца, например:
```html
-
+
Первая колонка (200px)
@@ -43,9 +47,13 @@
```
+<<<<<<< HEAD
Подробнее о [Windi CSS сетках](https://windicss.org/utilities/grid.html).
## Позиционирование
+=======
+## Positioning
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Слайды имеют фиксированный размер (по умолчанию `980x552px`) и масштабируются в соответствии с экраном пользователя. Вы можете безопасно использовать абсолютное позиционирование на своих слайдах, поскольку они будут масштабироваться вместе с экраном.
@@ -96,7 +104,7 @@ h1 {
Вы можете указать собственные глобальные стили, например, создав `./style.css`
```css
-/* style.css */
+/* style.css */
h1 {
font-size: 10em !important;
diff --git a/guide/hosting.md b/guide/hosting.md
index f687af2..01b8dfe 100644
--- a/guide/hosting.md
+++ b/guide/hosting.md
@@ -2,17 +2,21 @@
## Build Single Page Applications (SPA)
-You can also build the slides into a self-hostable SPA:
+You can build the slides into a self-hostable SPA:
```bash
$ slidev build
```
-The generated application will be available under `dist/` and then you can host it on [GitHub Pages](https://pages.github.com/), [Netlify](https://netlify.app/), [Vercel](https://vercel.com/), or whatever you want. Now you can share your slides with the rest of the world with a single link.
+The generated application will be available under `dist/`.
+
+You can test the generated build using a web server (Apache, NGINX, Caddy...etc.) or in the project you can directly run: `npx vite preview`.
+
+Then you can host it on [GitHub Pages](https://pages.github.com/), [Netlify](https://netlify.app/), [Vercel](https://vercel.com/), or whatever other web server or service that you want. Now you can share your slides with the rest of the world with a single link.
### Base Path
-To deploy your slides under sub-routes, you will need to pass the `--base` option. For example:
+To deploy your slides under sub-routes, you will need to pass the `--base` option. The `--base` path **must begin and end** with a slash `/`; for example:
```bash
$ slidev build --base /talks/my-cool-talk/
@@ -20,7 +24,7 @@ $ slidev build --base /talks/my-cool-talk/
Refer to [Vite's documentation](https://vitejs.dev/guide/build.html#public-base-path) for more details.
-### Provide Downloadable PDF
+### Provide a Downloadable PDF
You can provide a downloadable PDF to the viewers of your SPA with the following config:
@@ -30,9 +34,9 @@ download: true
---
```
-Slidev will generate a pdf file along with the build, and a download button will be displayed in the SPA.
+Slidev will generate a PDF file along with the build, and a download button will be displayed in the SPA.
-You can also provide a custom url to the PDF. In that case, the rendering process will be skipped.
+You can also provide a custom URL for the PDF. In that case, the rendering process will be skipped.
```md
---
@@ -40,6 +44,49 @@ download: 'https://myside.com/my-talk.pdf'
---
```
+This can also be done with the CLI option `--download` (`boolean` only).
+
+```bash
+$ slidev build --download
+```
+
+When using the download option, you can also provide the export options:
+
+- By using [CLI export options](/guide/exporting.html)
+- Or [frontmatter export options](/custom/#frontmatter-configures)
+
+### Output directory
+
+You can change the output directory using `--out`.
+
+```bash
+$ slidev build --out my-build-folder
+```
+
+### Watch mode
+
+By passing the `--watch` option the build will run in watch mode and will rebuild anytime the source changes.
+
+```bash
+$ slidev build --watch
+```
+
+### Multiple entries
+
+You can build multiple slide decks at once.
+
+```bash
+$ slidev build slides1.md slides2.md
+```
+
+Or
+
+```bash
+$ slidev build *.md
+```
+
+In this case, each input file will generate a folder containing the build in the output directory.
+
## Examples
Here are a few examples of the exported SPA:
@@ -51,7 +98,7 @@ For more, check out [Showcases](/showcases).
## Hosting
-We recommend to use `npm init slidev@lastest` to scaffolding your project, which contains the necessary configuration files for hosting services out-of-box.
+We recommend to use `npm init slidev@latest` to scaffold your project, which contains the necessary configuration files for hosting services out-of-the-box.
### Netlify
@@ -59,21 +106,21 @@ We recommend to use `npm init slidev@lastest` to scaffolding your project, which
Create `netlify.toml` in your project root with the following content.
-```ts
-[build.environment]
- NODE_VERSION = "14"
-
+```toml
[build]
- publish = "dist"
- command = "npm run build"
+publish = 'dist'
+command = 'npm run build'
+
+[build.environment]
+NODE_VERSION = '20'
[[redirects]]
- from = "/*"
- to = "/index.html"
- status = 200
+from = '/*'
+to = '/index.html'
+status = 200
```
-Then go to your Netlify dashboard, create new site with the repository.
+Then go to your Netlify dashboard and create a new site with the repository.
### Vercel
@@ -89,33 +136,62 @@ Create `vercel.json` in your project root with the following content.
}
```
-Then go to your Vercel dashboard, create new site with the repository.
+Then go to your Vercel dashboard and create a new site with the repository.
-## GitHub Pages
+### GitHub Pages
- [GitHub Pages](https://pages.github.com/)
-Create `.github/workflows/deploy.yml` with following content to deploy your slides to GitHub Pages via GitHub Actions.
+To deploy your slides on GitHub Pages:
+
+- upload all the files of the project in your repo (i.e. named `name_of_repo`)
+- create `.github/workflows/deploy.yml` with the following content to deploy your slides to GitHub Pages via GitHub Actions.
```yaml
name: Deploy pages
-on: push
+
+on:
+ workflow_dispatch: {}
+ push:
+ branches:
+ - main
+
jobs:
deploy:
runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v4
+
+ - uses: actions/setup-node@v4
with:
- node-version: '14'
+ node-version: 'lts/*'
+
- name: Install dependencies
run: npm install
+
- name: Build
- run: npm run build
- - name: Deploy pages
- uses: crazy-max/ghaction-github-pages@v2
+ run: npm run build -- --base /${{github.event.repository.name}}/
+
+ - uses: actions/configure-pages@v4
+
+ - uses: actions/upload-pages-artifact@v3
with:
- build_dir: dist
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ path: dist
+
+ - name: Deploy
+ id: deployment
+ uses: actions/deploy-pages@v4
```
+
+- In your repository, go to Settings>Pages. Under "Build and deployment", select "Github Actions".
+- Finally, after all workflows are executed, a link to the slides should appear under Settings>Pages.
diff --git a/guide/index.md b/guide/index.md
index c695f7a..eae5388 100644
--- a/guide/index.md
+++ b/guide/index.md
@@ -1,14 +1,28 @@
+<<<<<<< HEAD
# Руководство
## Введение
Slidev (slide + dev, произносится `/slʌɪdɪv/`) – это веб-приложение для создания и презентации слайдов. Предназначен для разработчиков, которые сосредоточены на написании контента в Markdown, в то же время используя HTML и Vue-компоненты для реализации pixel-perfect шаблонов и дизайна со встроенными интерактивными демо в ваши презентации.
+=======
+---
+outline: deep
+---
+
+# Getting Started
+
+Slidev (slide + dev, **/slaɪdɪv/**) is a web-based slides maker and presenter. It's designed for developers to focus on writing content in Markdown while also having the power of HTML and Vue components to deliver pixel-perfect layouts and designs with embedded interactive demos in your presentations.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Slidev использует многофункциональный markdown-файл для создания красивых слайдов с мгновенной перезагрузкой, а также множество встроенных интеграций, таких как live-кодинг, экспорт PDF, запись презентаций и т.д. Поскольку он работает через интернет, вы можете делать с Slidev всё что угодно — возможности безграничны.
Вы можете узнать больше о создании проекта на странице [Почему Slidev](/guide/why).
+<<<<<<< HEAD
### Особенности
+=======
+## Features
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
<<<<<<< HEAD
- 📝 [**Markdown-based**](/guide/syntax.html) - используйте свои любимые редакторы и рабочие процессы
@@ -29,12 +43,12 @@ Slidev использует многофункциональный markdown-фа
- 📝 [**Markdown-based**](/guide/syntax.html) - use your favorite editors and workflow
- 🧑💻 [**Developer Friendly**](/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.
- 🎨 [**Themable**](/themes/gallery.html) - theme can be shared and used with npm packages
-- 🌈 [**Stylish**](/guide/syntax.html#embedded-styles) - [Windi CSS](https://windicss.org/) on-demand utilities, easy-to-use embedded stylesheets
+- 🌈 [**Stylish**](/guide/syntax.html#embedded-styles) - on-demand utilities via [UnoCSS](https://github.com/unocss/unocss).
- 🤹 [**Interactive**](/custom/directory-structure.html#components) - embedding Vue components seamlessly
- 🎙 [**Presenter Mode**](/guide/presenter-mode.html) - use another window, or even your phone to control your slides
- 🎨 [**Drawing**](/guide/drawing.html) - draw and annotate on your slides
- 🧮 [**LaTeX**](/guide/syntax.html#latex) - built-in LaTeX math equations support
-- 📰 [**Diagrams**](/guide/syntax.html#diagrams) - creates diagrams with textual descriptions
+- 📰 [**Diagrams**](/guide/syntax.html#diagrams) - creates diagrams with textual descriptions
- 🌟 [**Icons**](/guide/syntax.html#icons) - Access to icons from any iconset directly
- 💻 [**Editors**](/guide/editors.html) - integrated editor, or [extension for VS Code](https://github.com/slidevjs/slidev-vscode)
- 🎥 [**Recording**](/guide/recording.html) - built-in recording and camera view
@@ -43,6 +57,7 @@ Slidev использует многофункциональный markdown-фа
- 🛠 [**Hackable**](/custom/config-vite.html) - using Vite plugins, Vue components, or any npm packages
>>>>>>> ee7ae42035591cb6565a72f5217129c670a59b0c
+<<<<<<< HEAD
### Технический стек
Slidev разработан благодаря набору этих инструментов и технологий.
@@ -80,26 +95,51 @@ Slidev разработан благодаря набору этих инстр
#### Try it Online
[sli.dev/new](https://sli.dev/new)
+=======
+## Scaffolding Your First Presentation
+
+### Try it Online
+
+Start Slidev right in your browser: [sli.dev/new](https://sli.dev/new)
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
[](https://sli.dev/new)
-#### Create Locally
+### Create Locally
+<<<<<<< HEAD
With NPM:
>>>>>>> ee7ae42035591cb6565a72f5217129c670a59b0c
+=======
+::: code-group
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-```bash
-$ npm init slidev
+```bash [npm]
+npm init slidev@latest
```
+<<<<<<< HEAD
Через Yarn:
```bash
$ yarn create slidev
```
Следуйте инструкциям и начните создавать слайды прямо сейчас! Подробнее о markdown-синтаксисе читайте в [руководстве о синтаксисе](/guide/syntax).
+=======
+```bash [yarn]
+yarn create slidev
+```
+
+```bash [pnpm]
+pnpm create slidev
+```
+
+:::
+
+Follow the prompts and start making your slides now! For more details about the markdown syntax, read through the [syntax guide](/guide/syntax).
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-### Command Line Interface
+## Command Line Interface
В проекте, где установлен Slidev, вы можете использовать бинарную версию `slidev` в своих npm-скриптах.
@@ -113,7 +153,11 @@ $ yarn create slidev
}
```
+<<<<<<< HEAD
В противном случае вы можете использовать [`npx`](https://www.npmjs.com/package/npx)
+=======
+Otherwise, you can use it with [`npx`](https://github.com/npm/cli/blob/latest/bin/npx)
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```bash
$ npx slidev
@@ -121,11 +165,15 @@ $ npx slidev
Запустите `slidev --help` для просмотра дополнительный опций.
+<<<<<<< HEAD
### Markdown синтакс
+=======
+## Markdown Syntax
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Slidev считывает ваш `slides.md` файл в корне проекта и конвертирует его в файлы. Всякий раз, когда вы вносите в него изменения, содержание слайдов будет моментально обновлено. Например:
-~~~md
+````md
# Slidev
Привет, мир!
@@ -136,6 +184,7 @@ Slidev считывает ваш `slides.md` файл в корне проект
Использование блоков кода для подсветки
+<<<<<<< HEAD
//```ts
console.log('Привет, мир!')
//```
@@ -146,3 +195,30 @@ console.log('Привет, мир!')
~~~
Подробнее о Markdown синтаксисе Slidev читайте в [руководстве по синтаксису](/guide/syntax).
+=======
+```ts
+console.log('Hello, World!')
+```
+
+---
+
+# Page 3
+````
+
+Read more about the Slidev Markdown syntax in the [syntax guide](/guide/syntax).
+
+## Tech Stack
+
+Slidev is made possible by combining these tools and technologies.
+
+- [Vite](https://vitejs.dev) - An extremely fast frontend tooling
+- [Vue 3](https://v3.vuejs.org/) powered [Markdown](https://daringfireball.net/projects/markdown/syntax) - Focus on the content while having the power of HTML and Vue components whenever needed
+- [UnoCSS](https://github.com/unocss/unocss) - On-demand utility-first CSS framework, style your slides at ease
+- [Shiki](https://github.com/shikijs/shiki), [Monaco Editor](https://github.com/Microsoft/monaco-editor) - First-class code snippets support with live coding capability
+- [RecordRTC](https://recordrtc.org) - Built-in recording and camera view
+- [VueUse](https://vueuse.org) family - [`@vueuse/core`](https://github.com/vueuse/vueuse), [`@vueuse/head`](https://github.com/vueuse/head), [`@vueuse/motion`](https://github.com/vueuse/motion), etc.
+- [Iconify](https://iconify.design/) - Iconsets collection.
+- [Drauu](https://github.com/antfu/drauu) - Drawing and annotations support
+- [KaTeX](https://katex.org/) - LaTeX math rendering.
+- [Mermaid](https://mermaid-js.github.io/mermaid) - Textual Diagrams.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/guide/install.md b/guide/install.md
index db2cbb4..8def8a2 100644
--- a/guide/install.md
+++ b/guide/install.md
@@ -2,16 +2,25 @@
## Стартовый шаблон
+<<<<<<< HEAD
> Для Slidev требуется [**Node.js >=14.0**](https://nodejs.org/)
Наилучшим способом начать, будет использование нашего официального стартового шаблона.
Через NPM:
+=======
+> Slidev requires [**Node.js >=18.0**](https://nodejs.org/)
-```bash
-$ npm init slidev@latest
+The best way to get started is by using our official starter template:
+
+::: code-group
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
+
+```bash [npm]
+npm init slidev@latest
```
+<<<<<<< HEAD
Через Yarn:
```bash
@@ -21,26 +30,49 @@ $ yarn create slidev
Следуйте подсказкам и презентация автоматически откроется на http://localhost:3030/
Шаблон также содержит базовую настройку и короткую демонстрацию с инструкциями о том, как начать работу со Slidev.
+=======
+```bash [yarn]
+yarn create slidev
+```
+
+```bash [pnpm]
+pnpm create slidev
+```
+
+:::
+
+Follow the prompts and it will open the slideshow at `http://localhost:3030/` automatically for you.
+
+It also contains a basic setup along with a short demo with instructions on how to get started with Slidev.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Ручная установка
+<<<<<<< HEAD
Если вы по-прежнему хотите установить Slidev вручную или хотите интегрировать его в свои существующие проекты, вы можете сделать:
+=======
+If you prefer to install Slidev manually or would like to integrate it into an existing project, you can do:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```bash
-$ npm install @slidev/cli @slidev/theme-default
-```
-```bash
-$ touch slides.md
-```
-```bash
-$ npx slidev
+npm install @slidev/cli @slidev/theme-default
```
+<<<<<<< HEAD
> Обратите внимание, если вы используете [pnpm](https://pnpm.io), вам нужно включить [shamefully-hoist](https://pnpm.io/npmrc#shamefully-hoist) опцию для корректной работы Slidev:
>
> ```bash
> echo 'shamefully-flatten=true' >> .npmrc
> ```
+=======
+```bash
+touch slides.md
+```
+
+```bash
+npx slidev
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Глобальная установка
@@ -49,19 +81,180 @@ $ npx slidev
Вы можете установить Slidev глобально с помощью следующей команды
```bash
-$ npm i -g @slidev/cli
+npm i -g @slidev/cli
```
И далее использовать `slidev` в любом месте, без создания проекта каждый раз.
```bash
-$ slidev
+npx slidev
```
Эта команда также попытается использовать локальный `@slidev/cli`, если найдёт его в `node_modules`.
## Установка на Docker
+<<<<<<< HEAD
Если вам нужен быстрый способ запуска презентации в контейнерах, вы можете использовать предварительно созданный [docker](https://hub.docker.com/r/stig124/slidev) образ, поддерживаемый [stig124](https://github.com/Stig124), либо создать свой собственный.
Более подробно в [slidevjs/container repo](https://github.com/slidevjs/container).
+=======
+If you need a rapid way to run a presentation with containers, you can use the prebuilt [docker](https://hub.docker.com/r/tangramor/slidev) image maintained by [tangramor](https://github.com/tangramor), or build your own.
+
+Just run following command in your work folder:
+
+```bash
+docker run --name slidev --rm -it \
+ --user node \
+ -v ${PWD}:/slidev \
+ -p 3030:3030 \
+ -e NPM_MIRROR="https://registry.npmmirror.com" \
+ tangramor/slidev:latest
+```
+
+**_Note_**: You can use `NPM_MIRROR` to specify a npm mirror to speed up the installation process.
+
+If your work folder is empty, it will generate a template `slides.md` and other related files under your work folder, and launch the server on port `3030`.
+
+You can access your slides from `http://localhost:3030/`
+
+### Build deployable images
+
+You can create your own slidev project as a docker image with Dockerfile:
+
+```Dockerfile
+FROM tangramor/slidev:latest
+
+ADD . /slidev
+```
+
+Create the docker image: `docker build -t myppt .`
+
+And run the container: `docker run --name myslides --rm --user node -p 3030:3030 myppt`
+
+You can visit your slides from `http://localhost:3030/`
+
+### Build hostable SPA (Single Page Application)
+
+Run `docker exec -i slidev npx slidev build` on the running container `slidev`. It will generate static HTML files under `dist` folder.
+
+#### Host on Github Pages
+
+You can host `dist` as a static website via services such as [GitHub Pages](https://tangramor.github.io/slidev_docker/) or GitLab Pages.
+
+Since in GitHub Pages the URL may contain subfolders, you may use `--base=//` option during the build process, such as `docker exec -i slidev npx slidev build --base=/slidev_docker/`.
+
+To avoid the Jekyll build process, you'll need to add an empty file `.nojekyll`.
+
+#### Host via docker
+
+You can also host Slidev yourself via docker:
+
+```bash
+docker run --name myslides --rm -p 80:80 -v ${PWD}/dist:/usr/share/nginx/html nginx:alpine
+```
+
+Or create a static image with following Dockerfile:
+
+```Dockerfile
+FROM nginx:alpine
+
+COPY dist /usr/share/nginx/html
+```
+
+Create the docker image: `docker build -t mystaticppt .`
+
+And run the container: `docker run --name myslides --rm -p 80:80 mystaticppt`
+
+You can visit your slides from http://localhost/
+
+Refer to [tangramor/slidev_docker](https://github.com/tangramor/slidev_docker) for more details.
+
+## Command Line Interface (CLI)
+
+`@slidev/cli` exposes a few commands you can use with `npx slidev ...` or by adding scripts in your `package.json`:
+
+```json
+{
+ "script": {
+ "dev": "slidev"
+ }
+}
+```
+
+In that case you will be able to run `npm run dev`.
+
+You can pass options to any commands:
+
+- boolean option are `true` if they are present, false otherwise (example: `slidev --open`)
+- some options can have values you can add just after the option or by using the `=` character (example: `slidev --port 8080` or `slidev --port=8080`)
+
+If you use npm scripts, don't forget to add `--` after the npm command:
+
+```bash
+npm run slidev -- --open
+```
+
+### `slidev [entry]`
+
+Start a local server for Slidev.
+
+- `[entry]` (`string`, default: `slides.md`): path to the markdown file containing your slides.
+
+Options:
+
+- `--port`, `-p` (`number`, default: `3030`): port number.
+- `--open`, `-o` (`boolean`, default: `false`): open in browser.
+- `--remote [password]` (`string`): listen to 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.
+- `--bind` (`string`, default: `0.0.0.0`): specify which IP addresses the server should listen on in the remote mode.
+- `--log` (`'error', 'warn', 'info', 'silent'`, default: `'warn'`): Log level.
+- `--force`, `-f` (`boolean`, default: `false`): force the optimizer to ignore the cache and re-bundle.
+- `--theme`, `-t` (`string`): override theme.
+
+### `slidev build [entry]`
+
+Build a hostable SPA.
+
+- `[entry]` (`string`, default: `slides.md`): path to the slides markdown file.
+
+Options:
+
+- `--out`, `-o` (`string`, default: `dist`): output dir.
+- `--base` (`string`, default: `/`): base URL (see https://cli.vuejs.org/config/#publicpath)
+- `--download` (`boolean`, default: `false`): allow the download of the slides as a PDF inside the SPA.
+- `--theme`, `-t` (`string`): override theme.
+
+### `slidev export [entry]`
+
+Export slides to PDF (or other format). See [Exporting](/guide/exporting.html) for more details.
+
+- `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
+
+Options:
+
+- `--output` (`string`, default: use `exportFilename` (see https://sli.dev/custom/#frontmatter-configures) or use `[entry]-export`): path to the output.
+- `--format` (`'pdf', 'png', 'pptx', 'md'`, default: `'pdf'`): output format.
+- `--timeout` (`number`, default: `30000`): timeout for rendering the print page (see https://playwright.dev/docs/api/class-page#page-goto).
+- `--range` (`string`): page ranges to export (example: `'1,4-5,6'`).
+- `--dark` (`boolean`, default: `false`): export as dark theme.
+- `--with-clicks`, `-c` (`boolean`, default: `false`): export pages for every clicks (see https://sli.dev/guide/animations.html#click-animations).
+- `--theme`, `-t` (`string`): override theme.
+
+### `slidev format [entry]`
+
+Format the markdown file.
+
+- `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
+
+### `slidev theme [subcommand]`
+
+Theme related operations.
+
+Subcommands:
+
+- `eject [entry]`: Eject current theme into local file system
+ - `[entry]` (`string`, default: `slides.md`): path to the slides markdown entry.
+ - Options:
+ - `--dir` (`string`, default: `theme`): output dir.
+ - `--theme`, `-t` (`string`): override theme.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
diff --git a/guide/navigation.md b/guide/navigation.md
index 796ed5c..ab545dd 100644
--- a/guide/navigation.md
+++ b/guide/navigation.md
@@ -2,6 +2,7 @@
## Панель навигации
+<<<<<<< HEAD
Переместите указатель мыши в левый нижний угол страницы Slidev, и у вас появится панель навигации.

@@ -23,11 +24,38 @@
| - | | отображение информации о слайдах |
| - | | отображение меню настроек |
| g | - | переход к ... |
+=======
+Move your mouse to the bottom left corner of Slidev page to make the navigation bar appear.
+
+
+
+| Shortcuts | Button | Description |
+| ----------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
+| f | | toggle fullscreen |
+| right / space | | next animation or slide |
+| left | | previous animation or slide |
+| up | - | previous slide |
+| down | - | next slide |
+| o | | toggle [slides overview](#slides-overview) |
+| d | | toggle dark mode |
+| - | | toggle [camera view](/guide/recording#camera-view) |
+| - | | [recording](/guide/recording#camera-view) |
+| - | | enter [presenter mode](/guide/presenter-mode) |
+| - | | toggle [integrated editor](/guide/editors#integrated-editor) |
+| - | | download slides (only appear in [SPA build](/guide/exporting#single-page-application-spa)) |
+| - | | show information about the slides |
+| - | | show settings menu |
+| g | - | show goto... |
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Обзор слайдов
+<<<<<<< HEAD
Нажав на o или кликнув на кнопку в панели навигации, вы можете просмотреть свои слайды и без труда переключиться на них
+=======
+By pressing o or clicking the button in the navigation bar, you can have the overview of your slides so you can jump between them easily.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3

diff --git a/guide/presenter-mode.md b/guide/presenter-mode.md
index 1e02fa0..3ce903e 100644
--- a/guide/presenter-mode.md
+++ b/guide/presenter-mode.md
@@ -1,5 +1,41 @@
# Режим докладчика
+<<<<<<< HEAD
Нажмите на кнопку на панели навигации или перейдите вручную на http://localhost:3030/presenter, чтобы войти в режим докладчика. Каждый раз, когда вы входите в режим докладчика, другие экземпляры страницы будут автоматически синхронизироваться с докладчиком.
+=======
+Click the button in the navigation panel, or visit `http://localhost:3030/presenter` manually, to enter the presenter mode. To present, you'll want to open two browser windows, one for the presenter and one for the audience. Generally maximizing the slideshow window on your projector screen, then controlling it from your laptop's screen is how people present with Slidev.
+
+Whenever you change slides in the presenter mode, all other page instances will automatically change as well, to stay in sync with the presenter.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3

+
+## Disabling
+
+Presenter mode is enabled by default.
+
+You can disable this feature with the following config:
+
+```md
+---
+presenter: false
+---
+```
+
+Alternately you can enable it only for `dev` or `build` modes by setting the mode you want in the config:
+
+```md
+---
+presenter: dev
+---
+```
+
+In that case the presenter will only be available when running `slidev` but not when running `slidev build`.
+
+## Remote restricted access
+
+You can run your presentation with remote access by running `slidev --remote`.
+
+If you want to share your slides with other people but you don't want them to access the presenter mode (either because you're ashamed of your presenter notes, or because you don't want them to mess up your presentation), you can provide a password to protect the presenter server by running `slidev --remote=your_password`.
+
+In that case you will need to provide the password when accessing `/presenter/*` routes.
diff --git a/guide/recording.md b/guide/recording.md
index 536da70..f592e90 100644
--- a/guide/recording.md
+++ b/guide/recording.md
@@ -1,16 +1,20 @@
# Запись
+<<<<<<< HEAD
Slidev имеет встроенную поддержку записи и просмотра камеры. Вы можете использовать их для простой записи презентации.
+=======
+Slidev has a built-in recording feature, as well as a camera view. You can use them to record your presentation easily in one simple tool rather than juggling a bunch of disparate recording options while also giving a talk.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
## Просмотр камеры
Нажмите кнопку на панели навигации, чтобы отобразить изображение с камеры в презентации. Вы можете переместить его и настроить его размер, используя меню в правом нижнем углу. Размер и позиция будут сохраняться в `localStorage` и, следовательно, будут иметь актуальные настройки при обновлениях страницы, так что не нужно об этом беспокоиться.
-
+
## Запись
-Clicking the button in the navigation panel will bring up a dialog for you. Here you can choose to either record your camera embedded in your slides or to separate them into two video files.
+Clicking the button in the navigation panel will bring up a dialog for you. Here you can choose to either record your camera output embedded in your slides or to separate them into two video files.
При нажатии на кнопку на панели навигации откроется диалоговое окно. Здесь вы можете выбрать запись камеры, встроенную в слайды, либо разделить их на два видеофайла.
diff --git a/guide/syntax.md b/guide/syntax.md
index d706ae6..8d483ce 100644
--- a/guide/syntax.md
+++ b/guide/syntax.md
@@ -1,10 +1,22 @@
+<<<<<<< HEAD
# Markdown синтаксис
Слайды описываются в **одном markdown-файле** (по умолчанию `./slides.md`).
Вы можете использовать обычный [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet), с дополнительной поддержкой встроенного HTML и Vue-компонентов. Также поддерживается стилизация с использованием [Windi CSS](https://windicss.org). Используйте `---` с добавлением новой строки для разделения слайдов.
+=======
+---
+outline: deep
+---
+
+# Markdown Syntax
-~~~md
+Slides are written within **a single markdown file** (by default `./slides.md`).
+
+You can use [the Markdown features](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) as you normally would, with the additional support of inlined HTML and Vue Components. Styling using [UnoCSS](/custom/config-unocss) is also supported. Use `---` padded with a new line to separate your slides.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
+
+````md
# Slidev
Привет, мир!
@@ -15,9 +27,15 @@
Использование блоков кода для подсветки
+<<<<<<< HEAD
//```ts
console.log('Привет, мир!')
//```
+=======
+```ts
+console.log('Hello, World!')
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
---
@@ -28,13 +46,21 @@ console.log('Привет, мир!')
-~~~
+````
+<<<<<<< HEAD
## Front Matter и Шаблоны
Укажите макеты и другие метаданные для каждого слайда, преобразовав разделители в [front matter блоки](https://jekyllrb.com/docs/front-matter/). Каждый frontmatter блок начинается с тройного тире и заканчивается ими же. Тексты между ними представляют собой объекты данных в формате [YAML](https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started/). Например:
+=======
+## Frontmatter & Layouts
+
+Specify layouts and other metadata for each slide by converting the separators into [frontmatter blocks](https://jekyllrb.com/docs/front-matter/). Each frontmatter starts with a triple-dash and ends with another. Texts between them are data objects in [YAML](https://www.cloudbees.com/blog/yaml-tutorial-everything-you-need-get-started/) format. For example:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
+
+
-~~~md
+```md
---
layout: cover
---
@@ -45,9 +71,9 @@ layout: cover
---
layout: center
-background: './images/background-1.png'
+background: /background-1.png
class: 'text-white'
----
+---
# Page 2
@@ -57,11 +83,17 @@ class: 'text-white'
# Page 3
+<<<<<<< HEAD
Это дефолтная страниц без каких-либо дополнительных метаданных.
~~~
+=======
+This is a default page without any additional metadata.
+```
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Подробная информация описана на странице [кастомизации](/custom/).
+<<<<<<< HEAD
## Блоки кода
Одна из главных причин, по которой я создала Slidev – это то, что мой код должен хорошо выглядеть на слайдах. Так, как вы и ожидали, вы можете использовать блоки кода Markdown, чтобы подсветить свой код.
@@ -73,50 +105,295 @@ console.log('Привет, мир!')
~~~
### Подсветка строк
+=======
+### Prettier Support
+
+> Available since v0.44
+
+The custom syntax might not be compactible with some formatters like Prettier.
+You can either install the [Prettier Plugin](/guide/editors#prettier-plugin) or use a direct `yaml` code block to define the frontmatter instead:
+
+````md
+---
+layout: cover
+---
+
+# Slidev
+
+This is the cover page.
+
+---
+
+```yaml
+# The first yaml block will be treated as the frontmatter of that slide
+layout: center
+background: /background-1.png
+class: 'text-white'
+```
+
+# Page 2
+
+This is a page with the layout `center` and a background image.
+````
+
+## Code Blocks
+
+One big reason that led to the creation of Slidev was the need to perfectly display code in slides. Consequently, you can use Markdown-flavored code blocks to highlight your code.
+
+````md
+```ts
+console.log('Hello, World!')
+```
+````
+
+Slidev has [Shiki](https://github.com/shikijs/shiki) built in as the syntax highlighter. Refer to [the highlighters section](/custom/highlighters) for more details.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Мы поддерживаем [Prism](http://prismjs.com) и [Shiki](https://github.com/shiki/shiki) в качестве подсветки синтаксиса. Обратитесь к [разделу подсветки](/custom/highlighters) для получения более подробной информации.
+<<<<<<< HEAD
Чтобы выделить определённые строки, просто добавьте номера строк в скобки `{}`. Нумерация строк начинается с 1.
+=======
+To highlight specific lines, simply add line numbers within brackets `{}`. Line numbers start counting from 1 by default.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-~~~ts
-//```ts {2,3}
+````md
+```ts {2,3}
function add(
a: Ref | number,
b: Ref | number
) {
return computed(() => unref(a) + unref(b))
}
-//```
-~~~
+```
+````
+<<<<<<< HEAD
Чтобы изменить выделение в несколько шагов, вы можете использовать `|` для их разделения. Например
+=======
+To change what's highlighted with multiple clicks, you can use `|` to separate each stage:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-~~~ts
-//```ts {2-3|5|all}
+````md
+```ts {2-3|5|all}
function add(
a: Ref | number,
b: Ref | number
) {
return computed(() => unref(a) + unref(b))
}
-//```
-~~~
+```
+````
+<<<<<<< HEAD
Сначала будет выделено `a: Ref | number` и `b: Ref | number`, а затем `return computed(() => unref(a) + unref(b))` после одного клика, и наконец, весь блок. Подробнее в [руководстве анимации по кликам](/guide/animations).
+=======
+This will first highlight `a: Ref | number` and `b: Ref | number`, and then `return computed(() => unref(a) + unref(b))` after one click, and lastly, the whole block.
+
+You can set the line number to `hide` to hide the code block or `none` to not highlight any line:
+
+````md
+```ts {hide|none}
+function add(
+ a: Ref | number,
+ b: Ref | number
+) {
+ return computed(() => unref(a) + unref(b))
+}
+```
+````
+
+::: tip
+Learn more in the [click animations guide](./animations#positioning).
+:::
+
+### Line Numbers
+
+You can enable line numbering for all slides by setting `lineNumbers: true` in the global config or enable each code block individually by setting `lines: true`. You can also set the starting line for each code block and highlight the lines accordingly; it defaults to 1:
+
+````md
+```ts {6,7}{lines:true,startLine:5}
+function add(
+ a: Ref | number,
+ b: Ref | number
+) {
+ return computed(() => unref(a) + unref(b))
+}
+```
+````
+
+### Max Height
+
+If the code doesn't fit into one slide, you use the `maxHeight` to set fixed height and enable scrolling:
+
+````md
+```ts {2|3|7|12}{maxHeight:'100px'}
+function add(
+ a: Ref | number,
+ b: Ref | number
+) {
+ return computed(() => unref(a) + unref(b))
+}
+/// ...as many lines as you want
+const c = add(1, 2)
+```
+````
+
+### TwoSlash Integration
+
+> Available since v0.46
+
+This feature is only available when you [set `highlighter` to `shiki`](/custom/highlighters)
+
+[TwoSlash](https://twoslash.netlify.app/) is a powerful tool for rendering TypeScript code blocks with type information on hover or inlined. It's quite useful for preparing slides for JavaScript/TypeScript-related topics.
+
+To use it, you can add `twoslash` to the code block's language identifier:
+
+````md
+```ts twoslash
+import { ref } from 'vue'
+
+const count = ref(0)
+// ^?
+```
+````
+
+It will be rendered as:
+
+```ts twoslash
+import { ref } from 'vue'
+
+const count = ref(0)
+// ^?
+```
+
+
+
+
+### Shiki Magic Move
+
+> Available since v0.48
+
+[Shiki Magic Move](https://github.com/shikijs/shiki-magic-move) enables you to have granular transition between code changes, similar to Keynote's Magic Move. You can check [the playground](https://shiki-magic-move.netlify.app/) to see how it works.
+
+
+
+In Slidev, we bind the magic-move to the [clicks system](/guide/animations#click-animations). The syntax is to wrap multiple code blocks representing each step with ````md magic-move (mind it's **4** backticks), this will be transformed into one code block, that morphs to each step as you click.
+
+`````md
+````md magic-move
+```js
+console.log(`Step ${1}`)
+```
+```js
+console.log(`Step ${1 + 1}`)
+```
+```ts
+console.log(`Step ${3}` as string)
+```
+````
+`````
+
+It's also possible to mix Magic Move with [line highlighting](#line-highlighting) and [line numbers](#line-numbers), for example:
+
+`````md
+````md magic-move {at:4, lines: true} // [!code hl]
+```js {*|1|2-5} // [!code hl]
+let count = 1
+function add() {
+ count++
+}
+```
+
+Non-code blocks in between as ignored, you can put some comments.
+
+```js {*}{lines: false} // [!code hl]
+let count = 1
+const add = () => count += 1
+```
+````
+`````
+
+
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
### Monaco редактор
Всякий раз, когда вы хотите внести какие-либо изменения в презентацию, просто добавьте `{monaco}` после указания языка подсветки - это превратит блок в полнофункциональный Monaco редактор!
+<<<<<<< HEAD
~~~ts
//```ts {monaco}
console.log('ПриветМир')
//```
~~~
+=======
+````md
+```ts {monaco}
+console.log('HelloWorld')
+```
+````
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Подробнее в [конфигурации Monaco](/custom/config-monaco).
+<<<<<<< HEAD
## Встроенные стили
+=======
+#### Monaco Diff
+
+Monaco can also generate a diff between two code blocks. Use `{monaco-diff}` to turn the block into a [diff Monaco editor](https://microsoft.github.io/monaco-editor/playground.html?source=v0.36.1#example-creating-the-diffeditor-multi-line-example) and use `~~~` to separate both original and modified version of the code!
+
+````md
+```ts {monaco-diff}
+This line is removed on the right.
+just some text
+abcd
+efgh
+Some more text
+~~~
+just some text
+abcz
+zzzzefgh
+Some more text.
+This line is removed on the left.
+```
+````
+
+It provides the editor with a "Run" button, and shows the result of the code execution right below the code block. You may also modify the code and the result will be re-evaluated on the fly.
+
+By default it will automatically run the code when the slide is loaded; if you want to instead explicitly trigger the run, you can set `{autorun:false}`.
+
+````md
+```ts {monaco-run} {autorun:false}
+console.log('Click the play button to run me')
+```
+````
+
+If you want to only show the output in certain clicks, you can use the `showOutputAt` prop. The value is the same as `v-click`.
+
+````md
+```ts {monaco-run} {showOutputAt:'+1'}
+console.log('Shown after 1 click')
+```
+````
+
+Currently Slidev supports running JavaScript and TypeScript code out-of-box. Refer to [Custom Code Runners](/custom/config-code-runners) for custom languages support.
+
+#### Writable Monaco Editor
+
+> Available since v0.49.5
+
+You can also use the [Import Code Snippets](#import-code-snippets) syntax combining with the `{monaco-write}` directive, to link your Monaco Editor with a file on your filesystem. This will allow you to edit the code directly in the editor and save the changes back to the file.
+
+```md
+<<< ./some-file.ts {monaco-write}
+```
+
+When using this, be sure to back up your files beforehand, as the changes will be saved directly to the file.
+
+## Embedded Styles
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Вы можете использовать тег `
@@ -156,7 +439,11 @@ blockquote {
Как и в случае с markdown, вы можете вставлять изображения, использующие удаленный или локальный URL.
+<<<<<<< HEAD
Для удаленных ресурсов встроенный [`vite-plugin-remote-assets`](https://github.com/antfu/vite-plugin-remote-assets) кэширует их на диск при первом запуске, поэтому позже у вас будет мгновенная загрузку даже для больших изображений.
+=======
+For remote assets, the built-in [`vite-plugin-remote-assets`](https://github.com/antfu/vite-plugin-remote-assets) will cache them onto the disk at first run, ensuring instant loading even for large images later on.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```md

@@ -168,7 +455,11 @@ blockquote {

```
+<<<<<<< HEAD
Если вы хотите применить кастомные размеры или стили, вы можете вставить их через `` тег
+=======
+For you want to apply custom sizes or styles, you can convert them to the `` tag
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```html
@@ -176,12 +467,16 @@ blockquote {
## Заметки
+<<<<<<< HEAD
Вы также можете делать заметки для каждого слайда. Они будут отображаться в [Режиме презентации](/guide/presenter-mode), чтобы вы могли ссылаться на них во время презентаций.
В Markdown последний блок комментария в каждом слайде будет считаться как примечание.
+=======
+You can also create presenter notes for each slide. They will show up in [Presenter Mode](/guide/presenter-mode) for you to reference during presentations.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
-~~~md
+```md
---
layout: cover
---
@@ -203,10 +498,37 @@ layout: cover
-~~~
+```
+
+Basic Markdown and HTML are also supported in notes when the Presenter renders note content.
+
+### Click Markers
+
+> Available since v0.48
+
+For some slides you might have longer notes that could be hard to find your place. Slidev supports click markers that allow highlighting and auto-scrolling to the section of notes from your corresponding content. Put `[click]` markers at the beginning of any line in your notes for the timing you need to go to another [click](/guide/animations#click-animations). You may skip `n` clicks by using `[click:{n+1}]`. For example:
+
+```md
+
+```
+
+Slidev divides the content between the click markers and highlights it in presenter notes, synchronized with your slide progress.
+
+
## Иконки
+<<<<<<< HEAD
Slidev позволяет вам получить доступ практически ко всем популярным наборам иконок с открытым исходным кодом **прямо** в вашем markdown. Работает это через [`vite-plugin-icons`](https://github.com/antfu/vite-plugin-icons) и [Iconify](https://iconify.design/).
Именование следует [Iconify](https://iconify.design/) преобразованию `{collection-name}-{icon-name}`. Например:
@@ -217,6 +539,18 @@ Slidev позволяет вам получить доступ практиче
- `` - из [Twemoji](https://github.com/twitter/twemoji)
- `` - из [SVG Logos](https://github.com/gilbarbara/logos)
- И многое другое...
+=======
+Slidev allows you to have access to virtually all open-source icon sets **directly** in your markdown after installing the corresponding package. Powered by [`unplugin-icons`](https://github.com/antfu/unplugin-icons) and [Iconify](https://iconify.design/).
+
+The naming follows [Iconify](https://iconify.design/)'s convention of `{collection-name}-{icon-name}`. For example:
+
+- `` - from [Material Design Icons](https://github.com/Templarian/MaterialDesign) - [`@iconify-json/mdi`](https://npmjs.com/package/@iconify-json/mdi)
+- `` - from [Carbon](https://github.com/carbon-design-system/carbon/tree/main/packages/icons) - [`@iconify-json/carbon`](https://npmjs.com/package/@iconify-json/carbon)
+- `` - from [Unicons Monochrome](https://github.com/Iconscout/unicons) - [`@iconify-json/uim`](https://npmjs.com/package/@iconify-json/uim)
+- `` - from [Twemoji](https://github.com/twitter/twemoji) - [`@iconify-json/twemoji`](https://npmjs.com/package/@iconify-json/twemoji)
+- `` - from [SVG Logos](https://github.com/gilbarbara/logos) - [`@iconify-json/logos`](https://npmjs.com/package/@iconify-json/logos)
+- And much more...
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Просмотрите и найдите все иконки, доступные с [Icônes](https://icones.js.org/).
@@ -274,7 +608,11 @@ layout: two-cols
+<<<<<<< HEAD
Мы также предоставляем сокращённый синтаксический сахар `::name::` для имени слота. Следующий пример работает точно так же, как и предыдущий.
+=======
+We also provide a shorthand syntactical sugar `::name::` for slot name. The following works exactly the same as the previous example.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```md
---
@@ -292,7 +630,11 @@ layout: two-cols
Это отобразится справа
```
+<<<<<<< HEAD
Вы также можете явно указать слот по умолчанию и в произвольном порядке
+=======
+You can also explicitly specify the default slot and provide in the custom order.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```md
---
@@ -312,9 +654,31 @@ layout: two-cols
Это отобразится слева
```
+<<<<<<< HEAD
## Конфигурации
Все необходимые конфигурации можно определить в Markdown файле. Например:
+=======
+## Import Code Snippets
+
+> Available since v0.47.0
+
+You can import code snippets from existing files via following syntax:
+
+```md
+<<< @/snippets/snippet.js
+```
+
+::: tip
+The value of `@` corresponds to the source root, the directory where the `slides.md` is located.
+:::
+
+This feature is vendored from VitePress, learn more about it in [VitePress's documentation](https://vitepress.dev/guide/markdown#import-code-snippets).
+
+## Configurations
+
+All configurations can be defined in the Markdown file. For example:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
```md
---
@@ -334,7 +698,7 @@ background: 'https://source.unsplash.com/1600x900/?nature,water'
Slidev поставляется с встроенной поддержкой LaTeX на базе [KaTeX](https://katex.org/).
-
+
### Строка
@@ -348,7 +712,7 @@ $\sqrt{3x-1}+(1+x)^2$
Используйте 2 (`$$`) для блочного рендеринга. В этом режиме используются более крупные символы и результат центрируется.
-```md
+```latex
$$
\begin{array}{c}
@@ -365,30 +729,53 @@ $$
Подробнее: [Демо](https://sli.dev/demo/starter/8) | [KaTeX](https://katex.org/) | [`markdown-it-katex`](https://github.com/waylonflinn/markdown-it-katex)
+<<<<<<< HEAD
## Диаграммы
+=======
+### LaTex line highlighting
+
+> Available since v0.43.1
+
+To highlight specific lines, simply add line numbers within bracket `{}`. Line numbers start counting from 1 by default.
+
+```latex
+$$ {1|3|all}
+\begin{array}{c}
+\nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} &
+= \frac{4\pi}{c}\vec{\mathbf{j}} \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\
+\nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\
+\nabla \cdot \vec{\mathbf{B}} & = 0
+\end{array}
+$$
+```
+
+The `at` and `finally` options of [code blocks](#line-highlighting) are also available for LaTeX blocks.
+
+## Diagrams
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Вы также можете создавать диаграммы / графики из текстовых описаний в вашем Markdown, используя [Mermaid](https://mermaid-js.github.io/mermaid).
Блоки кода, помеченные как `mermaid`, будут преобразованы в диаграммы, например:
-~~~md
-//```mermaid
+````md
+```mermaid
sequenceDiagram
Alice->John: Hello John, how are you?
Note over Alice,John: A typical interaction
-//```
-~~~
+```
+````
Кроме того, вы можете передать ему объект параметров, чтобы указать масштабирование и тему. Синтаксис объекта - это литерал объекта JavaScript, вам нужно будет добавить кавычки (`'`) для строк и использовать запятую (`,`) между ключами.
-~~~md
-//```mermaid {theme: 'neutral', scale: 0.8}
+````md
+```mermaid {theme: 'neutral', scale: 0.8}
graph TD
B[Text] --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
-//```
-~~~
+```
+````
Подробнее: [Демо](https://sli.dev/demo/starter/9) | [Mermaid](https://mermaid-js.github.io/mermaid)
@@ -396,10 +783,16 @@ C -->|Two| E[Result 2]
> Доступны с версии v0.15
+<<<<<<< HEAD
Вы можете разделить свой `slides.md` на несколько файлов и организовать их по своему усмотрению.
+=======
+You can split your `slides.md` into multiple files and organize them however you'd like.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
`slides.md` :
+
+
```md
# Страница 1
@@ -423,7 +816,11 @@ src: ./subpage2.md
### Frontmatter слияние
+<<<<<<< HEAD
Вы можете использовать frontmatters как со своей основной страницы, так и с внешней markdown страницы. Если в них есть одинаковые ключи, то **приоритет будут иметь ключи из основной записи**. Например
+=======
+You can provide frontmatter instructions from both your main entry and external markdown pages. If there are duplicate keys in them, the ones from the **main entry have the higher priority**. For example:
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
`slides.md` :
@@ -462,7 +859,11 @@ class: text-center
Страница обложки
```
+<<<<<<< HEAD
### Переиспользование страниц
+=======
+### Page Reuse
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Благодаря поддержке множественных вхождений переиспользование страниц может быть довольно простым. Например:
@@ -484,3 +885,27 @@ src: ./content.md
src: ./content.md
---
```
+
+## MDC Syntax
+
+> Available since v0.43.0
+
+Slidev supports optional [MDC (Markdown Components) Syntax](https://content.nuxtjs.org/guide/writing/mdc) powered by [`markdown-it-mdc`](https://github.com/antfu/markdown-it-mdc).
+
+You can enable it by adding `mdc: true` to the frontmatter of your markdown file.
+
+```mdc
+---
+mdc: true
+---
+
+This is a [red text]{style="color:red"} :inline-component{prop="value"}
+
+{width=500px lazy}
+
+::block-component{prop="value"}
+The **default** slot
+::
+```
+
+Learn more about [MDC Syntax](https://content.nuxt.com/guide/writing/mdc).
diff --git a/guide/why.md b/guide/why.md
index 61051b2..464456d 100644
--- a/guide/why.md
+++ b/guide/why.md
@@ -2,7 +2,11 @@
Есть множество богатых функционалом, универсальных WYSIWYG редакторов презентаций, например [Microsoft PowerPoint](https://www.microsoft.com/en-us/microsoft-365/powerpoint) или [Apple Keynote](https://www.apple.com/keynote/). Они не плохо работают для создания красивых презентаций с анимациями, графиками, и множества других штук, оставаясь при этом очень интуитивными и лёгкими в изучении. Так зачем вообще нужен Slidev?
+<<<<<<< HEAD
Slidev направлен на поддержку гибкости и интерактивности для разработчиков, чтобы делать их презентации более интересными, выразительными и привлекательными. Используя инструменты и технологии, с которыми они уже знакомы.
+=======
+Slidev aims to provide the flexibility and interactivity for developers to make their presentations even more interesting, expressive, and attractive by using the tools and technologies they are already familiar with.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
При работе с WYSIWYG редакторами очень легко отвлечься на варианты стилизации. Slidev исправляет это, разделяя контент и визуальную часть. Что позволяет вам сфокусироваться на чем-то одном, а также даёт возможность переиспользовать темы из сообщества. Slidev не стремится полностью заменить другие конструкторы презентаций. Скорее, он фокусируется на разнообразии сообщества разработчиков новыми возможностями.
@@ -26,13 +30,21 @@ Slidev использует расширенный Markdown формат для
## Удобство разработки
+<<<<<<< HEAD
Slidev предоставляет разработчикам первоклассную поддержку фрагментов кода. Он поддерживает как [Prism](https://prismjs.com/), так и [Shiki](https://github.com/shikijs/shiki), чтобы добиться идеальной pixel-perfect подсветки синтаксиса, при этом сохраняя возможность изменять код в любое время. Благодаря встроенному редактору [Monaco](https://microsoft.github.io/monaco-editor/), он также даёт вам возможность выполнять кодирование / демонстрацию в реальном времени в вашей презентации с автозаполнением, наведением курсора и даже с поддержкой проверки типов TypeScript.
+=======
+Slidev provides first-class support for code snippets for developers. It supports [Shiki](https://github.com/shikijs/shiki) to get pixel-perfect syntax highlighting, while still being able to modify the code at any time. With [Monaco editor](https://microsoft.github.io/monaco-editor/) built-in, it also empowers you to do live coding / demonstration in your presentation with autocompletion, type hovering, and even TypeScript type check support.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Узнайте больше о [подсветки](/custom/highlighters) и [конфигурации Monaco](/custom/config-monaco).
## Скорость
+<<<<<<< HEAD
Slidev разработан на [Vite](https://vitejs.dev/), [Vue 3](https://v3.vuejs.org/) и [Windi CSS](https://windicss.org/), которые в совокупности дают прекрасный опыт разработки. Каждое внесённое вами изменение **мгновенно** отразится на слайдах.
+=======
+Slidev is powered by [Vite](https://vitejs.dev/), [Vue 3](https://v3.vuejs.org/) and [UnoCSS](https://unocss.dev/), which give you the most wonderful authoring experience. Every change you made will reflect to your slides **instantly**.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Почитайте подробнее о [нашем техническом стеке](/guide/#tech-stack).
@@ -48,7 +60,11 @@ Slidev обеспечивает встроенную запись и просм
## Портативность
+<<<<<<< HEAD
Экспортируйте ваши слайды в PDF, PNGs, или даже a hostable Single-page Application (SPA) with a single command, and share them anywhere.
+=======
+Export your slides into PDF, PPTX, PNGs, or even a hostable Single-page Application (SPA) with a single command, and share them anywhere.
+>>>>>>> 21fdadc17cd2018f65c637e5727de640db5036e3
Read more about that in the [exporting docs](/guide/exporting).
@@ -66,6 +82,4 @@ $ npm init slidev
Или посмотрите демо:
-