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

Can .envir be used to autolink exported functions in a not loaded package in cli_code()? #692

Open
olivroy opened this issue May 9, 2024 · 1 comment
Labels
feature a feature request or enhancement

Comments

@olivroy
Copy link
Contributor

olivroy commented May 9, 2024

cli::cli_code(format(pkgdown::check_pkgdown))

If package is not loaded

image

Note that as_pkgdown() is exported by pkgdown. So I was wondering if there was another solution to autolink as_pkgdown() than to load the package?

Using

cli::cli_code(format(pkgdown::check_pkgdown), .envir = environment(pkgdown::check_pkgdown))

doesn't solve it.

Or is there a way to temporarily load the package for cli code and unloading immediately?

After library(pkgdown), I get what I'd like

image

@gaborcsardi
Copy link
Member

This is indeed not possible currently, and also hard to implement.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label Jun 20, 2024
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

No branches or pull requests

2 participants