auto-populate Overview/Überblick slides with a clickable TOC
Port the convention from the old Google Docs slide workflow: at
presentation time, any slide whose (only) heading is Overview or
Überblick gets its body content replaced with a hierarchical list of
the deck's h1/h2 slide headings, each entry linking to its slide.
Styled in the ids theme; slides without headings and the title slide
are left out.
Change-Id: I3bfd62d530f297a389030e431a6066b5adc99bb8
diff --git a/tests/testthat/test-slide_timing.R b/tests/testthat/test-slide_timing.R
index 48bc3d1..219a60d 100644
--- a/tests/testthat/test-slide_timing.R
+++ b/tests/testthat/test-slide_timing.R
@@ -212,6 +212,29 @@
)
})
+test_that("overview slides get the TOC script", {
+ skip_if_not_pandoc()
+ rmd <- local_temp_rmd_file(
+ "---",
+ "title: Overview test",
+ "output: revealjs.ids::revealjs_presentation",
+ "---",
+ "",
+ "## Overview",
+ "",
+ "Placeholder",
+ "",
+ "# Chapter One",
+ "",
+ "## Slide",
+ "",
+ "Content"
+ )
+ html <- .render_and_read(rmd, xml = FALSE)
+ expect_true(any(grepl("ids-overview-toc", html)))
+ expect_true(any(grepl("Überblick", html, fixed = TRUE)))
+})
+
test_that("a user-supplied totalTime is respected", {
skip_if_not_pandoc()
rmd <- local_temp_rmd_file(