Type: Package
Title: R Markdown Output Formats for Storytelling
Version: 0.2
Description: R Markdown output formats based on JavaScript libraries such as 'Scrollama' (https://github.com/russellsamora/scrollama) for storytelling.
Imports: htmltools, bookdown, jsonlite
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.2
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
URL: https://github.com/yihui/rolldown
BugReports: https://github.com/yihui/rolldown/issues
NeedsCompilation: no
Packaged: 2025-04-03 14:17:57 UTC; runner
Author: Yihui Xie ORCID iD [aut, cre] (URL: https://yihui.org), Siqi Zhang [ctb], Russell Goldenberg [ctb] (The JS library inst/resources/scrollama/scrollama.min.js)
Maintainer: Yihui Xie <xie@yihui.name>
Repository: CRAN
Date/Publication: 2025-04-03 14:30:01 UTC

R Markdown output formats for using Scrollama

Description

Include the Scrollama JS library in the HTML output from R Markdown.

Usage

scrollama(...)

scrollama_sidebar(..., template = pkg_resource("html", "scrollama-side.html"))

scrollama_setup(
  options = list(step = ".section, img, video, embed", offset = 0.5)
)

Arguments

..., template

Arguments to be passed to bookdown::html_document2().

options

A list of initialization options for Scrollama.

Value

scrollama() and scrollama_sidebar() return R Markdown output formats; scrollama_setup() is a helper function to return the JavaScript code for initializing Scrollama.

References

The Scrollama library: https://github.com/russellsamora/scrollama.

Examples

rolldown::scrollama_setup(list(step = ".level1", offset = 0.2))