diff --git a/website_generator/package_page_template.Rmd b/website_generator/package_page_template.Rmd index 9f8cb70..d5d438f 100644 --- a/website_generator/package_page_template.Rmd +++ b/website_generator/package_page_template.Rmd @@ -75,6 +75,18 @@ cat(paste(authors, collapse = "
")) #### Module files +```{r} +dir_size <- function(path, recursive = TRUE) { + stopifnot(is.character(path)) + files <- list.files(path, full.names = T, recursive = recursive) + vect_size <- sapply(files, function(x) file.size(x)) + size_files <- sum(vect_size) + return(round(size_files/10**6, digits = 2)) # in MB, rounded to two decimal digits +} + +moduleSize <- paste(dir_size(module_path), "MB") +``` + ```{r} github_link <- htmltools::tags$a( fontawesome::fa("github", fill = "#03989E", height = '100px'), @@ -97,15 +109,15 @@ download_link <- htmltools::tags$a( Go to repository - - Download + + Download (`r moduleSize`) `r github_link` - + `r download_link`