Skip to content
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

Allow user-defined tags from external packages, have a way to load an external package in roxygenize() #1013

Closed
hadley opened this issue Dec 23, 2019 · 4 comments · Fixed by #1059
Labels
feature a feature request or enhancement
Milestone

Comments

@hadley
Copy link
Member

hadley commented Dec 23, 2019

Before:

Roxygen: { library(roxygenlabs); list(markdown = TRUE,
    roclets = c("collate", "namespace", "roxygenlabs_rd")) }

After:

Roxygen: list(
      markdown = TRUE,
      roclets = c("collate", "namespace", "roxygenlabs::roxygenlabs_rd")
    )
@hadley hadley added the feature a feature request or enhancement label Mar 5, 2020
@hadley hadley added this to the 7.1.0 milestone Mar 5, 2020
@hadley
Copy link
Member Author

hadley commented Mar 9, 2020

This already seems to work, as far I can tell.

@hadley hadley closed this as completed Mar 9, 2020
@gaborcsardi
Copy link
Member

Wow.

@gaborcsardi
Copy link
Member

Actually, one issue is defining new tags without defining new roclets. E.g. roxygenlabs has

roxy_tag_parse.roxy_tag_examplesIf <- function(x) {
   ...
}

roxy_tag_rd.roxy_tag_examplesIf <- function(x, base_path, env) {
  rd_section("examples", x$val)
}

which adds a new @examplesIf tag. But this only works if the roxygenlabs package is loaded when roxygenize() is called. So it would be nice if we had a way for loading it at the beginning of roxygenize(). E.g. processx currently has this in DESCRIPTION as a workaround:

Roxygen: { library(roxygenlabs); list(markdown = TRUE) }

Which is not terrible, but it would be cleaner to write

Roxygen: list(markdown = TRUE, roxy_packages = "roxygenlabs")

@gaborcsardi gaborcsardi reopened this Mar 10, 2020
@gaborcsardi gaborcsardi changed the title Allow roclets to contain namespaced roclets Allow user-defined tags from external packages, have a way to load an external package in roxygenize() Mar 10, 2020
@gaborcsardi
Copy link
Member

One solution would be to load roxy_packages when the options are loaded, at the beginning of roxygenize(). And we would give a warning if they are not available.

hadley added a commit that referenced this issue Mar 10, 2020
hadley added a commit that referenced this issue Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants