support speaker notes and timing comments on the title slide
Pandoc puts content written before the first heading into an otherwise
empty phantom slide right after the title slide. When such a slide
consists of nothing but ::: notes blocks, timing comments, and
whitespace, it is now merged into the title slide: the title gets the
data-timing attribute and the notes, the phantom slide disappears, and
slide_timing() reports the title time as "(title)".
Change-Id: I984e924c467c4e15905b97c128c380887132f09d
diff --git a/R/revealjs_presentation.R b/R/revealjs_presentation.R
index f641284..75d6c23 100644
--- a/R/revealjs_presentation.R
+++ b/R/revealjs_presentation.R
@@ -31,7 +31,8 @@
#' Content of speaker notes
#' :::
#' ```
-#' to create notes only viewable in presentation mode.
+#' to create notes only viewable in presentation mode. Notes placed before
+#' the first heading are attached to the title slide.
#'
#' On mobile browsers (touch devices), a button next to the fullscreen
#' toggle overlays the current slide with its speaker notes (plus the slide
@@ -55,7 +56,8 @@
#'
#' This means Marc Kupietz will need 30 seconds for that slide. For talks
#' presented by a single speaker, the speaker code can be omitted:
-#' `<!-- 00:30 -->`.
+#' `<!-- 00:30 -->`. Comments placed before the first heading are applied to
+#' the title slide.
#'
#' Typically you start from a known total time budget and adjust the
#' individual slides to it. You can set this budget yourself with the
@@ -408,6 +410,7 @@
# timer of the notes plugin) and reporting per-speaker totals
post_processor <- function(metadata, input_file, output_file, clean, verbose) {
lines <- readLines(output_file, warn = FALSE, encoding = "UTF-8")
+ lines <- merge_title_slide_notes(lines)
result <- apply_timing_attributes(lines)
comments <- attr(result, "comments")
if (nrow(comments) > 0) {