From d14dee0dc2dd8d0d929d695feee18588aa4707a9 Mon Sep 17 00:00:00 2001 From: Chris Callison-Burch Date: Wed, 14 Jan 2026 05:14:30 -0500 Subject: PPTX writer: support notes field in metadata for title slide (#11396) This adds support for a `notes` field in the YAML metadata block that will be used as speaker notes for the title slide in PowerPoint output. Previously, there was no way to add speaker notes to the title slide since it is generated from metadata rather than from content blocks. The `::: notes` syntax only works for content slides. Example usage: --- title: My Presentation notes: | Welcome everyone to this presentation. Remember to introduce yourself. --- Closes #5844 (for PPTX output). Co-authored-by: Chris Callison-Burch --- src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs index 9e7bcb04f..b969c645b 100644 --- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs +++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs @@ -887,6 +887,12 @@ getMetaSlide = do subtitle <- inlinesToParElems $ lookupMetaInlines "subtitle" meta authors <- mapM inlinesToParElems $ docAuthors meta date <- inlinesToParElems $ docDate meta + -- Get speaker notes from metadata "notes" field + let notesBlocks = lookupMetaBlocks "notes" meta + speakerNotes <- if null notesBlocks + then return mempty + else local (\env -> env{envInSpeakerNotes=True}) $ + SpeakerNotes . mconcat <$> mapM blockToParagraphs notesBlocks if null title && null subtitle && null authors && null date then return Nothing else return $ @@ -894,7 +900,7 @@ getMetaSlide = do Slide metadataSlideId (MetadataSlide title subtitle authors date) - mempty + speakerNotes Nothing addSpeakerNotesToMetaSlide :: Slide -> [Block] -> Pres (Slide, [Block]) -- cgit v1.2.3