Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/src/features/speaker-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Starting on version 0.10.0, _presenterm_ allows presentations to define speaker
which you will present like you usually do.
* Another instance should be started using the `--listen-speaker-notes` parameter. This instance will only display
speaker notes in the presentation and will automatically change slides whenever the main instance does so.
* Optionally, you can start another instance using the `--mirror-main-slide` parameter. This instance will display the
main slide content (what the audience sees) and will automatically follow the main instance. This is useful when the
speaker cannot directly see the projected screen.

For example:

Expand All @@ -15,6 +18,9 @@ presenterm demo.md --publish-speaker-notes

# In another shell: start the speaker notes instance
presenterm demo.md --listen-speaker-notes

# Optionally, in a third shell: mirror the main slide for the speaker
presenterm demo.md --mirror-main-slide
```

[![asciicast](https://asciinema.org/a/ETusvlmHuHrcLKzwa0CMQRX2J.svg)](https://asciinema.org/a/ETusvlmHuHrcLKzwa0CMQRX2J)
Expand Down
9 changes: 6 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ struct Cli {
#[clap(short, long, group = "speaker-notes")]
listen_speaker_notes: bool,

/// Whether to mirror the main slide being presented.
#[clap(short = 'M', long, group = "speaker-notes")]
mirror_main_slide: bool,

/// Whether to validate snippets.
#[clap(long)]
validate_snippets: bool,
Expand Down Expand Up @@ -337,15 +341,14 @@ impl SpeakerNotesComponents {
fn new(cli: &Cli, config: &Config, path: &Path) -> anyhow::Result<Self> {
let full_presentation_path = path.canonicalize().unwrap_or_else(|_| path.to_path_buf());
let publish_speaker_notes =
cli.publish_speaker_notes || (config.speaker_notes.always_publish && !cli.listen_speaker_notes);
cli.publish_speaker_notes || (config.speaker_notes.always_publish && !cli.listen_speaker_notes && !cli.mirror_main_slide);
let events_publisher = publish_speaker_notes
.then(|| {
SpeakerNotesEventPublisher::new(config.speaker_notes.publish_address, full_presentation_path.clone())
})
.transpose()
.map_err(|e| anyhow!("failed to create speaker notes publisher: {e}"))?;
let events_listener = cli
.listen_speaker_notes
let events_listener = (cli.listen_speaker_notes || cli.mirror_main_slide)
.then(|| SpeakerNotesEventListener::new(config.speaker_notes.listen_address, full_presentation_path))
.transpose()
.map_err(|e| anyhow!("failed to create speaker notes listener: {e}"))?;
Expand Down