-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: @docType package assigns title and description from the DESCRIPTION file #349
Comments
That seems reasonable to me. Is |
It's relatively straightforward to modify process.docType <- function(partitum, base_path) {
doctype <- partitum$docType
if (is.null(doctype)) return()
tags <- list(new_tag("docType", doctype))
if (doctype == "package") {
name <- partitum$name
if (!str_detect(name, "-package")) {
tags <- c(tags, new_tag("alias", paste0(name, "-package")))
}
desc <- read.description(file.path(base_path, "DESCRIPTION"))
if (is.null(partitum$title)) {
tags <- c(tags, new_tag("title", desc$Title))
}
if (is.null(partitum$descr)) {
tags <- c(tags, new_tag("description", desc$Description))
}
}
tags
} But a better approach would be to come up with a sentinel value so that you could do (e.g.): #' Title
packageName() And roxygen could automatically figure out you want to document the package, and could then generate defaults for name, docType, title, and description. (You'd still need one roxygen comment in order to trigger documentation generation) |
Where would this |
|
i.e. this proposal makes packages an official top class object understood by roxygen in the same way that functions, methods, classes, data, etc are. |
I don't think |
How about |
Something like that sounds good. |
An
.R
file with the following contentsshould create the
PackageName.Rd
with\title
and\description
set from theDESCRIPTION
file. Of course, both can be overridden manually. One can use#' @details
to add further information.Use case: Automatic creation of consistent and meaningful package documentation files which are useful, e.g., for data-only packages.
The text was updated successfully, but these errors were encountered: