-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store tag descriptions in inst/tags.yml
Fixes #1375
- Loading branch information
Showing
10 changed files
with
427 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ Suggests: | |
R.oo, | ||
rmarkdown, | ||
testthat (>= 3.1.2), | ||
yaml | ||
LinkingTo: | ||
cpp11 | ||
VignetteBuilder: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#' Access metadata about built-in tags | ||
#' | ||
#' @export | ||
#' @keywords internal | ||
tags_list <- function(built_in = TRUE) { | ||
if (isTRUE(built_in)) { | ||
methods <- attr(methods('roxy_tag_parse'), "info") | ||
methods <- methods[methods$from == "roxygen2", ] | ||
methods <- rownames(methods)[-1] | ||
} else { | ||
# Needed since the info attribute doesn't seem to exist | ||
# during R CMD check | ||
methods <- as.character(methods('roxy_tag_parse'))[-1] | ||
} | ||
sort(sub('.*\\.roxy_tag_', '', methods)) | ||
} | ||
|
||
#' @export | ||
#' @rdname tags_list | ||
tags_metadata <- function() { | ||
check_installed("yaml") | ||
|
||
yaml::read_yaml(yaml_path()) | ||
} | ||
|
||
yaml_path <- function() { | ||
system.file("tags.yml", package = "roxygen2") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.