Skip to contents

Set up a book by creating a project at the specified path, rendering the demo book in Quarto, opening the book in a web browser, and opening the project in a new RStudio window.

Usage

create_book(
  path = "book",
  title = "Book Template",
  subtitle = "",
  authors = "Me",
  description = "Book Description",
  output_dir = "docs",
  license = "CC-BY",
  google_analytics = "",
  socials = list(),
  downloads = c("pdf", "epub"),
  sharing = c("twitter", "facebook", "linkedin"),
  margin_header = "",
  footer = paste0(license, " (", format(Sys.Date(), "%Y"), ") ", authors),
  light_theme = "flatly",
  dark_theme = "darkly",
  css = stripes(),
  df_print = "kable",
  webexercises = TRUE,
  open = rlang::is_interactive(),
  render = TRUE
)

Arguments

path

path to the location for your book on your machine

title

title of the book

subtitle

subtitle of the book

authors

authors of the book (see Details)

description

short description of the book

output_dir

directory to render output to

license

what license to add (CC-BY only for now)

google_analytics

the google analytics address

socials

a list of social media URLs to put in the footer, named as a relevant icon (see Details)

downloads

download types to include

sharing

"twitter, facebook, linkedin"

margin_header

defaults to ""

footer

defaults to "license (YEAR) author"

light_theme

"flatly" (see https://quarto.org/docs/output-formats/html-themes.html)

dark_theme

"darkly"

css

custom styles (e.g., stripes() creates the signature PsyTeachR rainbow stripes)

df_print

how to print tables (default, kable, tibble, paged)

webexercises

whether to use webexercises for interactive exercises

open

whether to activate the new project in RStudio

render

whether to render the quarto book when opening

Value

sets up a project and renders the demo

Details

The argument authors can be text or a structured list, e.g.:

list(c("Lisa M.", "DeBruine", "0000-0002-7523-5539"),
     c("Daniel", "Lakens", "0000-0002-0247-239X"))

The argument socials adds linked icons to the right footer. See the available icons at https://icons.getbootstrap.com/ E.g.:

list(mastodon = "https://tech.lgbt/@debruine",
     github = "https://github.com/debruine",
     twitter = "https://twitter.com/lisadebruine")