Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau committed Nov 15, 2024
1 parent 684181c commit 5e096d9
Show file tree
Hide file tree
Showing 30 changed files with 415 additions and 733 deletions.
16 changes: 8 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Description: Function-oriented Make-like declarative pipelines for
By establishing reusable archetypes for common kinds of
targets and pipelines, these functions help express complicated
reproducible pipelines concisely and compactly.
The methods in this package were influenced by the 'drake' R package
The methods in this package were influenced by the 'targets' R package.
by Will Landau (2018) <doi:10.21105/joss.00550>.
Version: 0.10.0.9004
Version: 0.11.0
License: MIT + file LICENSE
URL: https://docs.ropensci.org/tarchetypes/, https://github.com/ropensci/tarchetypes
BugReports: https://github.com/ropensci/tarchetypes/issues
Expand All @@ -21,6 +21,12 @@ Authors@R: c(
email = "[email protected]",
comment = c(ORCID = "0000-0003-1878-3253")
),
person(
given = "Rudolf",
family = "Siegel",
role = "ctb",
comment = c(ORCID = "0000-0002-6021-804X")
),
person(
given = "Samantha",
family = "Oliver",
Expand All @@ -36,12 +42,6 @@ Authors@R: c(
person(
family = "Eli Lilly and Company",
role = c("cph", "fnd")
),
person(
given = "Rudolf",
family = "Siegel",
role = "ctb",
comment = c(ORCID = "0000-0002-6021-804X")
))
Depends:
R (>= 3.5.0)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# tarchetypes 0.10.0.9004 (development)
# tarchetypes 0.11.0

* Add an `output_file` argument to `tar_quarto()` and `tar_quarto_raw()` for single documents (#198, @mutlusun).
* Detect child quarto documents (#199, @mutlusun).
Expand Down
38 changes: 9 additions & 29 deletions R/tar_quarto_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,19 @@ tar_quarto_files <- function(path = ".", profile = NULL, quiet = TRUE) {
tar_quarto_files_document <- function(path, quiet) {
info <- quarto::quarto_inspect(input = path, quiet = quiet)
out <- list()

# Collect data about source files.
out$sources <- tar_quarto_files_get_source_files(info$fileInformation)

# Collect data about output files.
for (format in info$formats) {
out$output <- c(
out$output,
file.path(dirname(path), format$pandoc$`output-file`)
)
}

# Collect data about input files. As this is not a project, there doesn't
# exist the `info$files` key. However, we can include resources if present.
if (length(info$resources) > 0) {
out$input <- info$resources
out$input <- out$input[file.exists(out$input)]
} else {
out$input <- character(0L)
}

out$input <- as.character(info$resources)
out$input <- out$input[file.exists(out$input)]
out
}

Expand All @@ -95,22 +87,13 @@ tar_quarto_files_project <- function(path, quiet) {
"quarto.org to learn how to set output-dir in _quarto.yml."
)
)

out <- list(output = file.path(path, info$config$project$`output-dir`))

# Collect data about source files.
out$sources <- tar_quarto_files_get_source_files(info$fileInformation)

# Detect input files like the config file (`_quarto.yml`) and resources like
# quarto extensions. Make sure in the end that these files exist.
out$input <- unlist(
c(
info$files$config,
info$files$resources
)
)
out$input <- unlist(c(info$files$config, info$files$resources))
out$input <- out$input[file.exists(out$input)]

out
}

Expand All @@ -126,29 +109,26 @@ tar_quarto_files_project <- function(path, quiet) {
#' @param file_information The `fileInformation` element of the list
#' returned by `quarto::quarto_inspect()`.
tar_quarto_files_get_source_files <- function(file_information) {
ret <- character(0)

out <- character(0)
for (myfile in names(file_information)) {
# Collect relevant source files. The files in `includeMap$target` are always
# relative to the main entry point of the report. Thus, we need to add the
# corresponding paths to the entries.
#
# We don't need to include the `source` column as all files are also present
# in `target` or are `myfile`.
ret <- c(
ret,
out <- c(
out,
myfile,
file.path(
dirname(myfile),
file_information[[myfile]]$includeMap$target
)
)
}

# Check that these files actually exist.
ret <- ret[file.exists(ret)]

# We don't need to call `unique` here on `ret` as this happens on the main
out <- out[file.exists(out)]
# We don't need to call `unique` here on `out` as this happens on the main
# function.
ret
out
}
46 changes: 16 additions & 30 deletions man/tar_age.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 16 additions & 30 deletions man/tar_change.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 16 additions & 30 deletions man/tar_combine.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 16 additions & 30 deletions man/tar_download.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5e096d9

Please sign in to comment.