diff options
| author | Chris Callison-Burch <[email protected]> | 2026-01-14 05:14:30 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-14 11:14:30 +0100 |
| commit | d14dee0dc2dd8d0d929d695feee18588aa4707a9 (patch) | |
| tree | b11138b80fd2b84a4091062e516d58e8ddbedcde /src | |
| parent | ca0f375498be7de671a32ad3a0590780d8490e0c (diff) | |
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 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/Powerpoint/Presentation.hs | 8 |
1 files changed, 7 insertions, 1 deletions
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]) |
