File: helper-bs4_book.R

package info (click to toggle)
r-cran-bookdown 0.42%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,752 kB
  • sloc: javascript: 11,343; makefile: 21; sh: 20
file content (32 lines) | stat: -rw-r--r-- 937 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
skip_if_bs4_book_deps_missing <- function() {
  lapply(bs4_book_deps(), skip_if_not_installed)
  invisible(TRUE)
}

local_bs4_book <- function(name = "book",
                           title = "Awesome Cookbook",
                           author = "Yoda",
                           output_options = NULL,
                           description = NULL,
                           url = NULL,
                           verbose = FALSE,
                           env = parent.frame()) {

  # don't run test using this book skeleton when Pandoc is not available
  skip_if_not_pandoc('2.0')

  path <- local_book(name = name, title = title, author = author,
    description = description, url = url, verbose = verbose, env = env)

  .render_book_quiet(
    path,
    output_format = "bookdown::bs4_book",
    output_options = output_options,
  )

  return(path)
}

get_meta_content <- function(node) {
  xml2::xml_attr(node, "content")
}