The bookdown contest is a great place to find a wide range of example books made with bookdown.

See a full list of books built with bookdown here: https://bookdown.org/

See below some featured books:

# rerun to change the example yml file
library(rvest)
url <- "https://bookdown.org/home"
html <- read_html(url)
books_node <- html %>%
  html_nodes(".article-list")

books_info <- books_node %>%
  purrr::map(~{
    res <- list(
      title = html_node(.x, "h1 > a") %>% html_text(),
      img = html_node(.x, ".thumbnail > a > img") %>% html_attr("src"),
      href = html_node(.x, "h1 > a") %>% html_attr("href"),
      source = html_node(.x, "a.github-button") %>% html_attr("href"),
      showcase = TRUE
    )
    res[is.na(res)] <- NULL
    res
  })
yaml::write_yaml(books_info, "examples.yml")
# remove some books from showcase
books_info <- yaml::read_yaml("examples.yml") %>%
  purrr::map(~{
    # some of our books
    no_show <- grepl("yihui|adv-r|rstudio|r4ds|r-pkgs", .x$href)
    # books with no source code repo
    no_source <- is.null(.x$source)
    if (no_show || no_source) .x$showcase <- FALSE
    .x
  })

yaml::write_yaml(books_info, "examples.yml")
quillt::examples("examples.yml", showcaseOnly = TRUE)


rstudio/bookdown documentation built on April 20, 2024, 12:11 p.m.