Slides and themes¶
Since narratty 0.8.
A doc that explains more than it runs: a list, a diagram and one command. With
prose: slides its paragraphs show their key
points and the list its items; a theme of its own
restyles every slide, the terminal takes the same colours, and the
frame keeps the section heading at the top.
The spec turns it all on:
slides: {frame: true, css: theme.css}
overlay_styles:
frame: {color: "#7cc4ff"}
terminal:
theme: {background: "#0f2233", foreground: "#e6edf3", blue: "#7cc4ff", brightBlack: "#6b8299"}
scenes:
- markdown: pipeline.md
heading_overlays: 2
prose: slides
The theme is plain CSS for the slide's section, its h1 and its content. Rules it
leaves out keep the built-in look; a Marp theme works the same way:
/* A night-blue theme for narratty slides */
section { background: #0f2233; color: #e6edf3; }
section h1 { color: #7cc4ff; }
section ul.points li.current { background: rgba(124, 196, 255, 0.16); border-left-color: #7cc4ff; }
section code { color: #ffd479; }
section th { color: #7cc4ff; }
section th, section td { border-bottom-color: #23405a; }
The doc is ordinary Markdown, with nothing written for the video alone:
# How narratty builds a video
A narratty video starts as an ordinary Markdown doc. Nothing in it is written for the
video alone, so the same file is read on the page and watched as a video.
## The stages
Every build goes through four stages:
- The doc is parsed into paragraphs, code blocks, tables and diagrams.
- Each paragraph becomes narration, spoken by a local voice.
- Each command block runs in a real terminal while VHS records it.
- Slides, overlays and the narration are laid over the recording.
```mermaid
flowchart LR
doc[Markdown] --> scenes[Scenes] --> record[Recording] --> video[Video]
```
The diagram is drawn when the video is rendered, from the same source the page shows.
## The look
Slides are plain HTML, so a CSS file decides how they look. This example uses its own
theme, and gives the terminal the same colours, so terminal and slides look alike.
The theme is a short CSS file:
```console
$ head -3 theme.css
/* A night-blue theme for narratty slides */
section { background: #0f2233; color: #e6edf3; }
section h1 { color: #7cc4ff; }
```
The heading stays in place while the rest of the picture changes, because the frame
keeps it there for the whole section.
narratty plan --sources examples/slides/slides.narratty.yamllists the key point of each paragraph.- Without
slides.css, the slides keep the built-indarklook, which takes the terminal's background.