slide timing: per-speaker timing comments activate speaker view pacing
Port the Google-Docs slide workflow convention: timing comments like
<!-- JD 00:30 --> (speaker code plus MM:SS/HH:MM:SS/seconds duration, or
just <!-- 00:30 --> for single-speaker talks) are converted into
data-timing attributes on the rendered slides' <section> elements, and
the calculated grand total is passed to reveal.js as the totalTime
config value, activating the pacing timer in the speaker view. A
document-supplied totalTime or defaultTiming takes precedence.
A per-speaker time summary is printed during rendering; the new
slide_timing() function computes slide, speaker, and grand totals
directly from an .Rmd source file without rendering it.
Change-Id: I89d37baab06c6ee8be7ab777a70b9b21295c8780
diff --git a/man/slide_timing.Rd b/man/slide_timing.Rd
new file mode 100644
index 0000000..96cdcbf
--- /dev/null
+++ b/man/slide_timing.Rd
@@ -0,0 +1,40 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/slide_timing.R
+\name{slide_timing}
+\alias{slide_timing}
+\title{Compute per-speaker slide times from timing comments}
+\usage{
+slide_timing(input, slide_level = 2)
+}
+\arguments{
+\item{input}{Path to an R Markdown file.}
+
+\item{slide_level}{Level of heading that denotes individual slides (should
+match the \code{slide_level} used when rendering).}
+}
+\value{
+A list with three elements: \code{slides} (one row per slide and
+speaker), \code{speakers} (total time per speaker), and \code{total} (grand total
+in seconds). \code{slide_timing()} is called for its side effect of printing a
+summary.
+}
+\description{
+Parses an R Markdown presentation for timing comments of the form
+\verb{<!-- MK 00:30 -->} (speaker code followed by a duration in \code{MM:SS},
+\code{HH:MM:SS}, or plain seconds format) or, for single-speaker talks, simply
+\verb{<!-- 00:30 -->}, and computes the time allocated to each slide, each
+speaker, and the whole presentation.
+}
+\details{
+The same convention can be used directly in
+\code{\link[=revealjs_presentation]{revealjs_presentation()}}: any such comment in the source document is
+automatically converted into a \code{data-timing} attribute on the enclosing
+slide's \verb{<section>} element, which activates the pacing timer in the
+reveal.js speaker view.
+}
+\examples{
+\dontrun{
+slide_timing("talk.Rmd")
+}
+
+}