Skip to content
Snippets Groups Projects
Commit a8ed6a02 authored by David Dorchies's avatar David Dorchies
Browse files

fix: remove warnings and notes at Rcheck

- extra folder .devcontainer
- non ascii characters
- remaining folder public after check
parent 84a4372f
No related branches found
No related tags found
No related merge requests found
Pipeline #174767 passed
...@@ -14,3 +14,4 @@ ...@@ -14,3 +14,4 @@
^_pkgdown\.yml$ ^_pkgdown\.yml$
^docs$ ^docs$
^pkgdown$ ^pkgdown$
^\.devcontainer$
...@@ -24,9 +24,6 @@ render_report <- function(input, ...@@ -24,9 +24,6 @@ render_report <- function(input,
cfg_bookdown <- cfg_bookdown <-
yaml::read_yaml(file.path(input, "_bookdown.yml")) yaml::read_yaml(file.path(input, "_bookdown.yml"))
unlink(file.path(input, paste0(cfg_bookdown$book_filename, ".*"))) unlink(file.path(input, paste0(cfg_bookdown$book_filename, ".*")))
dir.create(output_dir,
recursive = TRUE,
showWarnings = FALSE)
attached_packages <- (.packages()) attached_packages <- (.packages())
bookdown::render_book(input, bookdown::render_book(input,
output_format = output_format, output_format = output_format,
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#' #'
render_reports <- function(reports_dir = file.path(pkgload::pkg_path(), "reports"), render_reports <- function(reports_dir = file.path(pkgload::pkg_path(), "reports"),
reports = list.dirs(reports_dir, full.names = FALSE, recursive = FALSE), reports = list.dirs(reports_dir, full.names = FALSE, recursive = FALSE),
publish_dir = "../../public/reports", publish_dir = file.path(dirname(reports_dir), "public/reports"),
...) { ...) {
options(knitr.duplicate.label = 'allow') options(knitr.duplicate.label = 'allow')
......
...@@ -31,11 +31,23 @@ pkg_sys <- function( ...@@ -31,11 +31,23 @@ pkg_sys <- function(
#' @export #' @export
#' #'
#' @examples #' @examples
#' purge_string("Là chaîne pl€ine dé &#/* $péciaux", "_") #' \dontrun{
#' # Download some funny UTF-8 string
#' tmp <- tempfile()
#' download.file(
#' file.path("https://raw.githubusercontent.com",
#' "bits/UTF-8-Unicode-Test-Documents",
#' "master/UTF-8_sequence_unseparated",
#' "utf8_sequence_0-0xff_assigned_printable_unseparated.txt", tmp)
#' )
#' txt_utf8 <- readLines(tmp)
#' txt_utf8
#' purge_string(txt_utf8)
#' }
#' #'
purge_string <- function(x, replacement = " ") { purge_string <- function(x, replacement = " ") {
iconv(gsub(paste0(replacement, "+"), replacement, iconv(gsub(paste0(replacement, "+"), replacement,
gsub("&|=|-|:|\\.|'|\\/|<|>|e0|e9|e8|e7|e6|_|\\(|\\)|\"|\\*|#||\\$|\\%", gsub("&|=|-|:|\\.|'|\\/|<|>|e0|e9|e8|e7|e6|_|\\(|\\)|\"|\\*|#|\u20AC|\\$|\\%",
replacement, replacement,
enc2utf8(x))), enc2utf8(x))),
from = "UTF-8", from = "UTF-8",
......
...@@ -19,8 +19,14 @@ Purge a string from all accents and special characters ...@@ -19,8 +19,14 @@ Purge a string from all accents and special characters
} }
\examples{ \examples{
\dontrun{ \dontrun{
# Download some funny UTF-8 string
tmp <- tempfile() tmp <- tempfile()
download.file("https://raw.githubusercontent.com/bits/UTF-8-Unicode-Test-Documents/master/UTF-8_sequence_unseparated/utf8_sequence_0-0xff_assigned_printable_unseparated.txt", tmp) download.file(
file.path("https://raw.githubusercontent.com",
"bits/UTF-8-Unicode-Test-Documents",
"master/UTF-8_sequence_unseparated",
"utf8_sequence_0-0xff_assigned_printable_unseparated.txt", tmp)
)
txt_utf8 <- readLines(tmp) txt_utf8 <- readLines(tmp)
txt_utf8 txt_utf8
purge_string(txt_utf8) purge_string(txt_utf8)
......
...@@ -16,7 +16,7 @@ render_report( ...@@ -16,7 +16,7 @@ render_report(
render_reports( render_reports(
reports_dir = file.path(pkgload::pkg_path(), "reports"), reports_dir = file.path(pkgload::pkg_path(), "reports"),
reports = list.dirs(reports_dir, full.names = FALSE, recursive = FALSE), reports = list.dirs(reports_dir, full.names = FALSE, recursive = FALSE),
publish_dir = "../../public/reports", publish_dir = file.path(dirname(reports_dir), "public/reports"),
... ...
) )
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment