LICENSE Documentation

Official TypeScript developer resources and documentation for lirantal/LICENSE. Verified technical context for AI.

0 stars TypeScript TypeScript 1 file ยท ~7,117 tokens
RAW Doc

1. Project Overview & Quickstart (lirantal/LICENSE)

LICENSE

Open-source repository lirantal/LICENSE

Repository Details

Note: High-volume repository documentation is actively indexed and synchronized by YakaAI.

2. Official Technical Reference & Guides (lirantal/docs)

File: README.md

[sli.dev](https://sli.dev)

Documentation for Slidev

Translations

Repo Site Maintainers
English docs sli.dev @antfu
็ฎ€ไฝ“ไธญๆ–‡ docs-cn cn.sli.dev @QC-L @Ivocin
Franรงais docs-fr fr.sli.dev @ArthurDanjou
Espaรฑol docs-es es.sli.dev @owlnai
ะ ัƒััะบะธะน docs-ru ru.sli.dev @xesjkeee
Viแป‡t Nam docs-vn vn.sli.dev @bongudth
Deutsch docs-de de.sli.dev @fabiankachlock
Portuguรชs (BR) docs-br br.sli.dev @luisfelipesdn12
ฮ•ฮปฮปฮทฮฝฮนฮบฮฌ docs-el el.sli.dev @GeopJr
ๆ—ฅๆœฌ่ชž docs-ja ja.sli.dev @IkumaTadokoro

Start Server Locally

text
npm i pnpm

pnpm i
pnpm run dev

And then visit http://localhost:3000

Or install the Vite extension for VS Code to edit side-by-side.

Help on Translating

See TRANSLATIONS.md


File: guide/animations.md

Animations

Click Animations

`v-click`

To apply "click animations" for elements, you can use the v-click directive or <v-click> components

md
# Hello


<v-click>

Hello World

</v-click>




Hey!

`v-after`

The usage of v-after is similar to v-click but it will turn the element visible when the previous v-click is triggered.

md
Hello
World

When you click the "next" button, both Hello and World will show up together.

`v-click-hide`

Same as v-click but instead of making the element appear, it makes the element invisible after clicking.

md
Hello

`v-clicks`

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.

md
<v-clicks>

- Item 1
- Item 2
- Item 3
- Item 4

</v-clicks>

An item will become visible each time you click "next".

Custom Clicks Count

By default, Slidev counts how many steps are needed before going to the next slide. You can override this setting by passing the clicks frontmatter option:

yaml
---
# 10 clicks in this slide, before going to the next
clicks: 10
---

Ordering

Passing the click index to your directives, you can customize the order of the revealing

md
1
2
3
md
1
2
3
md
---
clicks: 3
---


<v-clicks at="3">
  Hi
</v-clicks>

Element Transitions

When you apply the v-click directive to your elements, it will attach the class name slidev-vclick-target to it. When the elements are hidden, the class name slidev-vclick-hidden will also be attached. For example:

html
Text

After a click, it will become

html
Text

By default, a subtle opacity transition is applied to those classes:

css
// the default

.slidev-vclick-target {
  transition: opacity 100ms ease;
}

.slidev-vclick-hidden {
  opacity: 0;
  pointer-events: none;
}

You can override them to customize the transition effects in your custom stylesheets.

For example, you can achieve the scaling up transitions by:

css
// styles.css

.slidev-vclick-target {
  transition: all 500ms ease;
}

.slidev-vclick-hidden {
  transform: scale(0);
}

To specify animations for only certain slide or layout

scss
.slidev-page-7,
.slidev-layout.my-custom-layout {
  .slidev-vclick-target {
    transition: all 500ms ease;
  }

  .slidev-vclick-hidden {
    transform: scale(0);
  }
}

Learn more about customizing styles.

Motion

Slidev has @vueuse/motion built-in. You can use the v-motion directive to any elements to make apply motion on them. For example

html
Slidev

The text Slidev will move from -80px to its original position on initialization.

Note: Slidev preloads the next slide for performance, which means the animations might start before you navigate to the page. To get it works properly, you can disable the preloading for the particular slide

md
---
preload: false
---

Or control the element life-cycle with v-if to have fine-grained controls

html
v-if="$slidev.nav.currentPage === 7"
  v-motion
  :initial="{ x: -80 }"
  :enter="{ x: 0 }">
  Slidev

Learn mode: Demo | @vueuse/motion | v-motion | Presets

Pages Transitions

Built-in support for slides is NOT YET provided in the current version. We are planning to add support for them in the next major version. Before that, you can still use your custom styles and libraries to do that.


File: guide/drawing.md

Drawing & Annotations

Available since v0.23

We have drauu built-in for drawing and annotation that could enhance your presentation further.

To start, click the icon in the toolbar and start drawing. It's also available in the Presenter Mode. Drawings and annotations you created will be synced up 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.

Persist Drawings

The following frontmatter configuration allows you to persist your drawings as SVGs under .slidev/drawings directory and have them inside your exported pdf or hosted site.

md
---
drawings: 
  persist: true
---

Disable Drawings

Entirely:

md
---
drawings: 
  enabled: false
---

Only in Development:

md
---
drawings: 
  enabled: dev
---

Only in Presenter Mode:

md
---
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:

md
---
drawings: 
  syncAll: false
---

With this config, only the drawing from the presenter instance will be able to sync with others.


File: guide/editors.md

Editor Support

Since Slidev is using Markdown as the source entry, you can use ANY editors you love to write it.

If you want some high-level management to your slides, we have provided the following editor integrations for you!

Integrated Editor

Slidev comes with an integrated CodeMirror editor that will instantly reload and save the changes to your file.

Click the button to open it.

VS Code Extension

The VS Code extension provides some features to help you better organize your slides and have a quick overview of them.

Features

  • View slides in the side panel
  • Go to next / prev buttons
  • Re-ordering slides
  • Folding for slide blocks
  • Convert Markdown to HTML

File: guide/exporting.md

Exporting

PDF

Exporting to PDF or PNG relies on Playwright for rendering. You will therefore need to install playwright-chromium to use this feature.
If you are doing exporting in a CI environment, the playwright CI guide can be helpful.

Install playwright-chromium

bash
$ npm i -D playwright-chromium

Now export your slides to PDF using the following command

bash
$ slidev export

After a few seconds, your slides will be ready at ./slides-export.pdf.

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 export slides with multiple steps into multiple pages, pass the --with-clicks options.

bash
$ slidev export --with-clicks

PNGs

When passing in the --format png option, Slidev will export PNG images for each slide instead of a PDF.

bash
$ slidev export --format png

Single-Page Application (SPA)

See Static Hosting.


File: guide/faq.md

FAQ

Grids

Since Slidev is based on the Web, you can apply any grid layouts as you want. CSS Grids, flexboxes, or even Masonry, you get the full controls.

Since we have Windi CSS built-in, here is one simple way for you to reference:

html
The first column




The second column

Go further, you can customize the size of each column like:

html
The first column (200px)




The second column (auto fit)




The third column (10% width to parent container)

Learn more about Windi CSS Grids.

Positioning

Slides are defined in fixed sizes (default 980x552px) and scale to fit with the user screen. You can safely use absolute position in your slides as they will scale along with the screen.

For example:

html
This is a left-bottom aligned footer

To change the canvas' actual size, you can pass the canvasWidth options in your first frontmatter:

yaml
---
canvasWidth: 800
---

Font Size

If you feel the font size in your slides are too small, you can adjust it in a few ways:

Override Local Style

You can override styles for each slide with the inlined <style> tag.

md
# Page 1

<style>
h1 {
  font-size: 10em;
}
</style>

---

# Page 2

This will not be affected.

Learn more: Embedded Styles

Override Global Style

You can provide custom global styles by creating ./style.css, for example

css
/* style.css */ 

h1 {
  font-size: 10em !important;
}

Learn more: Global Style

Scale the Canvas

Changing the canvas' actual size will scale all your contents(text, images, components, etc.) and slides

yaml
---
# default: 980
# since the canvas gets smaller, the visual size will become larger
canvasWidth: 800
---

Use Transform

We provide a built-in component ``, which is a thin wrapper of CSS transform property.

md
- Item 1
- Item 2

File: guide/hosting.md

Static Hosting

Build Single Page Applications (SPA)

You can also 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, Netlify, Vercel, or whatever 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:

bash
$ slidev build --base /talks/my-cool-talk/

Refer to Vite's documentation for more details.

Provide Downloadable PDF

You can provide a downloadable PDF to the viewers of your SPA with the following config:

md
---
download: true
---

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.

md
---
download: 'https://myside.com/my-talk.pdf'
---

Examples

Here are a few examples of the exported SPA:

For more, check out 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.

Netlify

Create netlify.toml in your project root with the following content.

ts
[build.environment]
  NODE_VERSION = "14"

[build]
  publish = "dist"
  command = "npm run build"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Then go to your Netlify dashboard, create new site with the repository.

Vercel

Create vercel.json in your project root with the following content.

json
{
  "rewrites": [
    { "source": "/(.*)", "destination": "/index.html" }
  ]
}

Then go to your Vercel dashboard, create new site with the repository.

GitHub Pages

Create .github/workflows/deploy.yml with following content to deploy your slides to GitHub Pages via GitHub Actions.

yaml
name: Deploy pages
on: push
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
      - name: Install dependencies
        run: npm install
      - name: Build
        run: npm run build
      - name: Deploy pages
        uses: crazy-max/ghaction-github-pages@v2
        with:
          build_dir: dist
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

File: guide/index.md

Getting Started

Overview

Slidev (slide + dev, /slสŒษช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.

It uses a feature-rich markdown file to generate beautiful slides with an instant reloading experience, along with many built-in integrations such as live coding, PDF exporting, presentation recording, and so on. Since it's powered by the web, you can do anything with Slidev - the possibilities are endless.

You can learn more about the rationale behind the project in the Why Slidev section.

Features

  • ๐Ÿ“ Markdown-based - use your favorite editors and workflow
  • ๐Ÿง‘โ€๐Ÿ’ป Developer Friendly - built-in syntax highlighting, live coding, etc.
  • ๐ŸŽจ Themable - theme can be shared and used with npm packages
  • ๐ŸŒˆ Stylish - Windi CSS on-demand utilities, easy-to-use embedded stylesheets
  • ๐Ÿคน Interactive - embedding Vue components seamlessly
  • ๐ŸŽ™ Presenter Mode - use another window, or even your phone to control your slides
  • ๐ŸŽจ Drawing - draw and annotate on your slides
  • ๐Ÿงฎ LaTeX - built-in LaTeX math equations support
  • ๐Ÿ“ฐ Diagrams - creates diagrams with textual descriptions
  • ๐ŸŒŸ Icons - Access to icons from any iconset directly
  • ๐Ÿ’ป Editors - integrated editor, or extension for VS Code
  • ๐ŸŽฅ Recording - built-in recording and camera view
  • ๐Ÿ“ค Portable - export into PDF, PNGs, or even a hostable SPA
  • โšก๏ธ Fast - instant reloading powered by Vite
  • ๐Ÿ›  Hackable - using Vite plugins, Vue components, or any npm packages

Tech Stack

Slidev is made possible by combining these tools and technologies.

Scaffolding Your First Presentation

Try it Online

sli.dev/new

Create Locally

With NPM:

bash
$ npm init slidev

With Yarn:

bash
$ yarn create slidev

Follow the prompts and start making your slides now! For more details about the markdown syntax, read through the syntax guide.

Command Line Interface

In a project where Slidev is installed, you can use the slidev binary in your npm scripts.

json
{
  "scripts": {
    "dev": "slidev", // start dev server
    "build": "slidev build", // build for production SPA
    "export": "slidev export" // export slides to pdf
  }
}

Otherwise, you can use it with npx

bash
$ npx slidev

Run slidev --help for more options available.

Markdown Syntax

Slidev reads your slides.md file under your project root and converts them into slides. Whenever you made changes to it, the content of the slides will be updated immediately. For example:

md
# Slidev

Hello World

---

# Page 2

Directly use code blocks for highlighting

//```ts
console.log('Hello, World!')
//```

---

# Page 3

Read more about the Slidev Markdown syntax in the syntax guide.


File: guide/install.md

Installation

Starter Template

Slidev requires Node.js >=14.0

The best way to get started is using our official starter template.

With NPM:

bash
$ npm init slidev@latest

With Yarn:

bash
$ yarn create slidev

Follow the prompts and it will open up the slideshow at http://localhost:3030/ automatically for you.

It also contains the basic setup and a short demo with instructions on how to get started with Slidev.

Install Manually

If you still prefer to install Slidev manually or would like to integrate it into your existing projects, you can do:

bash
$ npm install @slidev/cli @slidev/theme-default
bash
$ touch slides.md
bash
$ npx slidev

Please note if you are using pnpm, you will need to enable shamefully-hoist option for Slidev to work properly:

bash
echo 'shamefully-hoist=true' >> .npmrc

Install Globally

Available since v0.14

You can install Slidev globally with the following command

bash
$ npm i @slidev/cli

And then use slidev everywhere without creating a project every time.

bash
$ slidev

This command will also try to use local @slidev/cli if it has been found in the node_modules.

Install on Docker

If you need a rapid way to run a presentation with containers, you can use the prebuilt docker image maintained by 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 \
    tangramor/slidev:latest

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 image

Or you can create your own slidev project to 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 command 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 in a static web site such as Github Pages or Gitlab Pages.

Because in Github pages the url may contain subfolder, so you need to modify the generated index.html to change href="/assets/xxx to href="./assets/xxx. Or you may use --base=/<subfolder>/ option during the build process, such as: docker exec -i slidev npx slidev build --base=/slidev_docker/.

And to avoid Jekyll build process, you need to add an empty file .nojekyll.

Host by docker

You can also host it by yourself with 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 the tangramor/slidev_docker for more details.

Command Line Interface (CLI)

@slidev/cli Expose 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 slides markdown entry.

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.
  • --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 hostable SPA.

  • [entry] (string, default: slides.md): path to the slides markdown entry.

Options:

  • --watch, -w (boolean, default: false): build watch.
  • --out, -o (string, default: dist): output dir.
  • --base (string, default: /): base URL (see https://cli.vuejs.org/config/#publicpath)
  • --download (boolean, default: false): allow to download the slides as PDF inside the SPA.
  • --theme, -t (string): override theme.

`slidev export [entry]`

Export slides to PDF (or other format).

  • [entry] (string, default: slides.md): path to the slides markdown entry.

Options:

`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.

File: guide/navigation.md

Move your mouse to the left bottom corner of Slidev page, the navigation bar will be appeared.

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
d toggle dark mode
- toggle camera view
- recording
- enter presenter mode
- toggle integrated editor
- download slides (only appear in SPA build)
- show information about the slides
- show settings menu
g - show goto...

Slides Overview

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.