Can `.envir` be used to autolink exported functions in a not loaded package in `cli_code()`?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with cli::cli_code() and the .envir argument, using pkgdown::check_pkgdown and its environment as the reproducing case. Investigate how exported functions are resolved for autolinking when pkgdown is not loaded; done means the exported as_pkgdown() reference is linked without requiring the package to remain loaded.
Written by the indexing model from the issue text.
Description
cli::cli_code(format(pkgdown::check_pkgdown))
If package is not loaded
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
- Dominant language
- R
- Stars
- 726
- Forks
- 94
- Avg merge
- 3h 35m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Similar issues
-
documentation pkg infrastructure
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiverse-trace/epiparameter#511 ·
-
function:write_dwc
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Urgent request: Due to vulnerabilities move to API version 12.6.1 (12.6.2 eventually) or 13.1.1 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
jbkunst/highcharter#849 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
r-lib/pkgdepends#485 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100