Pptx reader: mark hidden slides.

Slides hidden from the slide show (`show="0"` on `p:sld`) were read
like any other, with nothing to tell them apart. They are still read,
now with the class `hidden` on their header.

The MANUAL now says how slides are read: a level-2 heading with the
identifier `slide-N`, then the slide's content.

The test fixture was written with python-pptx 1.0.2.

Discussed in #12023.
This commit is contained in:
Nacho García authored and John MacFarlane committed 2026-11-02 14:12:51 -08:00
1 parent df2954da96
commit 9ececd548b
5 files changed
+37 -1

No files matched your search

+5
View File
@@ -7018,6 +7018,11 @@ These layouts are chosen from the default pptx reference doc included with
pandoc, unless an alternative reference doc is specified using
`--reference-doc`.
When reading pptx, each slide becomes a level-2 heading with the
identifier `slide-N`, followed by the slide's content. Slides hidden
from the slide show are read too, with the class `hidden` on their
heading.
## Incremental lists
By default, these writers produce lists that display "all at once."
+5 -1
View File
@@ -55,7 +55,11 @@ slideToBlocks archive slide = do
headerText = if T.null title
then "Slide " <> T.pack (show n)
else title
header = Header 2 (slideIdent, [], []) (B.toList (B.text headerText))
-- A slide hidden from the slide show (show="0") is still read,
-- with a "hidden" class on its header.
classes = ["hidden" | findAttr (unqual "show") slideElem == Just "0"]
header = Header 2 (slideIdent, classes, [])
(B.toList (B.text headerText))
-- Parse shapes and convert to blocks
case findChildByName ns "p" "cSld" slideElem >>=
+6
View File
@@ -53,4 +53,10 @@ tests = [ testGroup "basic"
"pptx-reader/runs.pptx"
"pptx-reader/runs.native"
]
, testGroup "slides"
[ testCompare
"hidden slides"
"pptx-reader/hidden.pptx"
"pptx-reader/hidden.native"
]
]
+21
View File
@@ -0,0 +1,21 @@
Pandoc
Meta { unMeta = fromList [] }
[ Header 2 ( "slide-1" , [] , [] ) [ Str "Shown" ]
, Header
2 ( "slide-2" , [ "hidden" ] , [] ) [ Str "Hidden" ]
, Para
[ Str "Body"
, Space
, Str "of"
, Space
, Str "the"
, Space
, Str "hidden"
, Space
, Str "slide"
]
, Header
2
( "slide-3" , [] , [] )
[ Str "Shown" , Space , Str "explicitly" ]
]
Binary file not shown.