Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions vignettes/_AGENTS.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,23 @@ In addition to help the analysis these two packages might be used on modules:
- Group related utilities in shared files (e.g., `utils.R`, `validations.R`).

```{r teal_content, echo=FALSE, results='asis'}
# Append common shared instructions from teal framework (special case as they are on this repo)
common_agents_shared <- readLines(params$url)
# remove a heading line only intented to aovid a markdown lint error
line_to_avoid_lintr <- grep("^# ", common_agents_shared)
# remove section intended only for module packages
begins_module_section <- grep("<!-- Begins Module Section", common_agents_shared, fixed = TRUE)
ends_module_section <- grep("<!-- Ends Module Section", common_agents_shared, fixed = TRUE)
common_agents_shared <- common_agents_shared[
-1 * c(line_to_avoid_lintr, seq(from = begins_module_section, to = ends_module_section))
]
cat(common_agents_shared, sep = "\n")
# Append common shared instructions from teal framework
common_agents_url <- params$url
common_agents_shared <- readLines(common_agents_url)
# remove optional sections
remove_sections <- c("<!-- (Begins|Ends) Module Section")
Reduce(
function(x, y) {
delim <- grep(y, x)
if (length(delim) == 0) {
return(x)
} else if (length(delim) != 2) {
stop("Section delimiters are not balanced")
}
x[-1 * seq(from = delim[1], to = delim[2])]
},
remove_sections,
init = common_agents_shared
) |>
cat(sep = "\n")
```
Loading