Several files
A deck in several files, with chapters that have their own settings, and a file that a chapter brings in.
This deck is four files. slides.md names two chapters, and one of the
chapters names a third file. The deck shows the slides of all the files,
in order.
One deck, several files
Each chapter is a file of its own
1 / 8
Slide 1 of 8: Several files
A slide with src in its frontmatter stands for the slides of that file.
See Several files for the rules.
Source
The deck file names the chapters. The class next to the second src goes
to each slide of that chapter:
---
title: Several files
layout: cover
defaults:
transition: fade
---
# One deck, several files
Each chapter is a file of its own
<!-- notes
This slide is in `slides.md`. The slides after it are in the `chapters`
folder: `slides.md` only names their files.
-->
---
src: chapters/why.md
---
---
src: chapters/how.md
class: how
---
---
layout: center
---
# Back in `slides.md`
The deck goes on after its chapters.
The first chapter:
---
layout: section
---
# Why
---
# Decks grow
- A chapter is easier to find in a file of its own
- Two people can write two chapters at the same time
- A chapter can be part of more than one deck
<!-- notes
This file is `chapters/why.md`. It is a deck too: `slidewright dev
chapters/why.md` presents it alone.
-->
The second chapter. Its defaults apply to its slides only, and its last
slide brings in a file that other chapters can use too:
---
defaults:
layout: center
layout: section
---
# How
---
# A slide with `src`
```md
---
src: chapters/how.md
class: how
---
```
It stands for the slides of that file. Its other keys, here `class`, go to
each of them: `style.css` colours the headings of `.how` slides.
---
# The settings of a chapter
```md
---
defaults:
layout: center
---
```
`defaults` at the top of a chapter apply to its slides, so this slide is
centred. The theme, the colours and the size are those of `slides.md`.
---
src: ../shared/questions.md
---
---
layout: statement
---
# Questions?
<!-- notes
`chapters/how.md` ends with this file. A path is from the folder of the
file that has it: `../shared/questions.md`.
-->
/* `class: how`, next to the `src` of the chapter, is on each of its slides. */
[data-slide].how h1 {
color: var(--deck-accent);
}
To present this deck from a clone of the repository, run this command in
the examples folder:
bun run dev chapters