File: docs.R

package info (click to toggle)
r-cran-cli 3.6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,300 kB
  • sloc: ansic: 16,412; cpp: 37; sh: 13; makefile: 2
file content (51 lines) | stat: -rw-r--r-- 1,155 bytes parent folder | download | duplicates (3)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#' Frequently Asked Questions
#'
#' @name faq
#' @includeRmd man/chunks/FAQ.Rmd
NULL


docs_progress_c_api <- function() {
  if (file.exists("inst/include/cli/progress.h")) {
    lines <- readLines("inst/include/cli/progress.h")
  } else {
    lines <- readLines("../inst/include/cli/progress.h")
  }

  ## Remove non-matching lines, but leave an empty line between blocks
  ptn <- "^//'[ ]?"
  mtch <- grepl(ptn, lines)
  lines[!mtch] <- ""
  prev <- c("", lines[-length(lines)])
  lines <- lines[mtch | prev != lines]

  ## Remove doc pattern
  lines <- sub(ptn, "", lines)

  tmp <- tempfile(fileext = ".Rmd")
  cat(lines, sep = "\n", file = tmp)
  tmp
}

#' @title The cli progress C API
#' @name progress-c
#' @section The cli progress C API:
#'
#' ```{r include = FALSE, cache = FALSE, child = cli:::docs_progress_c_api()}
#' ```
NULL

#' @title cli environment variables and options
#' @name cli-config
#'
#' @section User facing configuration:
#'
#' ```{r include = FALSE, child = "vignettes/cli-config-user.Rmd"}
#' ```
#'
#' @section Internal configuration:
#'
#' ```{r include = FALSE, child = "vignettes/cli-config-internal.Rmd"}
#' ```
NULL