Skip to main content

Using Slides in Documentation

This documentation supports creating slide decks using Slidev. Slidev allows you to create beautiful slide decks using Markdown and embed them in the documentation.

Folder Structure

The project is organized into the following main folders:

  • packages/docusaurus: Contains the main documentation site built with Docusaurus.
  • packages/slidev: Contains the slide decks and related scripts for building presentations.

Within packages/slidev, the folder structure is as follows:

packages/
slidev/
slides/ # Source markdown files for slide decks
scripts/ # Scripts for building and managing slides
node_modules/ # Dependencies for Slidev
package.json # Slidev-specific configuration and dependencies

The slides folder contains the source .md files for your presentations, while the scripts folder includes utilities like the build script.

Creating Slides

  1. Create a new .md file in the slides directory:
slides/myslides.md
  1. Write your slides using Slidev's Markdown format:
---
theme: default
---

# Title Slide

- Point 1
- Point 2

---

# Second Slide

Content here

Building Slides

You have several build options:

# Build just the slides (outputs to static/slides/example)
npm run slidev:build

# Build just the documentation
npm run build:docs

# Build everything (slides and documentation)
npm run build

The build process:

  1. Slidev builds slides from slides/example.md
  2. Output is placed in static/slides/example
  3. Docusaurus serves the slides from /slides/example/

File structure:

packages/
docusaurus/
static/
slides/
example/ # Built slides (generated)
index.html
assets/
slidev/
slides/
example.md # Source markdown file

During development, you might want to only rebuild slides when updating them, using npm run slidev:build. For production or full site updates, use npm run build:all.

Using Slides in Documentation

To link to your slides, use an HTML link with target="_blank":

<a href="/slides/yourslides/" target="_blank">View presentation</a> (opens in new window)

This will open the presentation in a new window with full Slidev features enabled.

Example

View intro slides (opens in new window)

Learn More

For more information about creating slides with Slidev, visit the Slidev documentation.