Skip to content

Commit d80417b

Browse files
Add current and next speaker, if known.
1 parent adbdb2b commit d80417b

19 files changed

Lines changed: 178 additions & 0 deletions

lib/presently/presenter_view.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def editor_url_for(path, line = 1)
101101
# @parameter slide [Slide | Nil] The current slide.
102102
def render_timing(builder, slide)
103103
progress = (@controller.slide_progress * 100).round(1)
104+
next_slide = @controller.next_slide
104105
builder.tag(:div, class: "timing", style: "--slide-progress: #{progress}%") do
105106
pacing = @controller.pacing
106107
pacing_class = case pacing
@@ -153,6 +154,21 @@ def render_timing(builder, slide)
153154
builder.text("Slide: #{format_duration(slide.duration)}")
154155
end
155156
end
157+
158+
# Speaker display — only shown when front matter includes a `speaker` key.
159+
if (current_speaker = slide&.speaker)
160+
builder.tag(:span, class: "speaker-info") do
161+
builder.tag(:span, class: "speaker-label"){builder.text("🎤")}
162+
builder.text(" #{current_speaker}")
163+
164+
# Show upcoming speaker only when they differ from the current one.
165+
if (next_speaker = next_slide&.speaker) && next_speaker != current_speaker
166+
builder.tag(:span, class: "next-speaker") do
167+
builder.text(" → #{next_speaker}")
168+
end
169+
end
170+
end
171+
end
156172
end
157173
end
158174
end

lib/presently/slide.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ def transition
213213
@front_matter&.fetch("transition", nil)
214214
end
215215

216+
# The name of the speaker presenting this slide.
217+
# @returns [String | Nil] The speaker name from front_matter, or `nil` if not specified.
218+
def speaker
219+
@front_matter&.fetch("speaker", nil)
220+
end
221+
216222
# The line range to focus on for code slides.
217223
# @returns [Array(Integer, Integer) | Nil] The `[start, end]` line numbers (1-based), or `nil`.
218224
def focus

public/_static/index.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,23 @@ html[data-transition="morph"]::view-transition-new(slide-container) {
675675
margin-left: auto;
676676
}
677677

678+
.timing-info .speaker-info {
679+
display: flex;
680+
align-items: center;
681+
gap: 0.25rem;
682+
font-size: 0.9rem;
683+
background: rgba(255, 255, 255, 0.08);
684+
border: 1px solid rgba(255, 255, 255, 0.12);
685+
border-radius: 6px;
686+
padding: 0.2rem 0.6rem;
687+
white-space: nowrap;
688+
}
689+
690+
.timing-info .next-speaker {
691+
opacity: 0.6;
692+
font-style: italic;
693+
}
694+
678695
/* Notes */
679696
.notes {
680697
background: var(--surface);

releases.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## Unreleased
4+
5+
- Add optional `speaker` front matter key to slides. When present, the current speaker's name is shown in the timing bar. If the next slide has a different speaker, a handoff indicator (e.g. `→ Next Speaker`) is shown alongside, giving presenters an at-a-glance cue for tag-team talks.
6+
37
## v0.4.0
48

59
- Add `bake presently:slides:notes` task to extract all presenter notes into a single Markdown document, with each slide's file path as a heading. Useful for reviewing or sharing speaker notes outside of the presentation.

slides/010-welcome.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: title
33
duration: 30
44
marker: Welcome
5+
speaker: Samuel
56
---
67

78
# Title

slides/020-statement.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: statement
33
duration: 30
44
transition: morph
5+
speaker: Samuel
56
---
67

78
<div style="view-transition-name: welcome-title">The best way to predict the future is to create it.</div>

slides/030-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: default
33
duration: 20
44
transition: morph
5+
speaker: Samuel
56
---
67

78
- Real-time synchronization between display and presenter

slides/031-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: default
33
duration: 20
44
transition: morph
5+
speaker: Samuel
56
---
67

78
- Real-time synchronization between display and presenter

slides/032-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: default
33
duration: 20
44
transition: morph
5+
speaker: Samuel
56
---
67

78
- Real-time synchronization between display and presenter

slides/033-overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
template: default
33
duration: 20
44
transition: morph
5+
speaker: Samuel
56
---
67

78
- Real-time synchronization between display and presenter

0 commit comments

Comments
 (0)