1
0
mirror of https://github.com/mfontanini/presenterm.git synced 2026-09-01 23:33:21 -06:00

Merge 394d4e235f7c641478efc219e0d15a2eedd07506 into 5f8add11a24af9d257fd18da48c8004dd9c516f8

This commit is contained in:
Martino Fornasa 2026-05-25 10:41:38 +08:00 committed by GitHub
commit 361da9f604
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -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:
@ -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)

View File

@ -138,6 +138,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,
@ -363,15 +367,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}"))?;