There were some artifact code blocks around from before
`reference-doc` functionality was implemented. This led to ignoring
the reference-doc in places. Though I fixed this, I kept the old
hacked-up functions instead of replacing them with
`parseXml` (imported from Writers.OOXML) which does this in a
consistent manner. This commit corrects that oversight.
We now pull the filtered blocks and speaker notes out at the top of
the `blocksToSlide` function, and then make SpeakerNotes into a
parameter of the `blocksToSlide'` subfunction. The output is the same,
but the logic should be easier to follow now.
We used to keep a map of the slideId-to-notes for each slide. Since we
now extract them at the slide level, this is overcomplicated, and we
can just extract them before converting a slide and then clear the
state after.
Previously, we had treated it as a `Maybe`. But there is no difference
between not having speaker notes and having empty speaker notes. So we
make the SpeakerNotes newtype into a monoid, and test for memptiness
instead of testing for Just/Nothing.
Tests speaker notes appearing after (and inside of) separating blocks.
Output checked on Windows10 (archlinux virtualbox), PowerPoint
2013. Not corrupted, and output as expected.
Internal change: We were getting bad results with the empty text box
created by the conversion of notes into an empty paragraph. So we now
convert the notes at the `blocksToSlide` stage, by `walkM`ing a
function over the blocks that returns `()`, and then filters the notes
out. This avoids the need to have a return value for speaker notes,
and thus avoids the empty TextBox.
Together with the previous commit (256f14c5a), closes#4477.
Some blocks automatically split slides (imgs, tables, `column`
divs). We assume that any speaker notes immediately following these
are connected to these elements, and keep them with the related
blocks, splitting after them.
The documentation states that the target format name should match the output format, which isn't the case for `docx`/`openxml`.
This PR adds a remark and a frequently requested example (inserting a pagebreak in docx output) to the documentation.
language is now consistently Haskell2010, and other-extensions
is consistently NoImplicitPrelude. Everything else to be specified
in the module header as needed.