Closed hadley closed 2 years ago
Minimal reprex:
options(downlit.attached = c("ggplot2", "tidyr"))
downlit::href_topic("fill")
#> [1] "https://ggplot2.tidyverse.org/reference/aes_colour_fill_alpha.html"
Created on 2022-06-18 by the reprex package (v2.0.1)
I think we'll need either href_function()
or href_topic(only_function = TRUE)
. But then how do we establish whether a topic is for a function or not? Maybe can just check package namespace for presence of function?
Better reprex:
options(downlit.attached = c("ggplot2", "tidyr"))
downlit::highlight("fill()")
#> [1] "<span class='nf'><a href='https://ggplot2.tidyverse.org/reference/aes_colour_fill_alpha.html'>fill</a></span><span class='o'>(</span><span class='o'>)</span>"
downlit:::href_expr(quote(fill()))
#> [1] "https://ggplot2.tidyverse.org/reference/aes_colour_fill_alpha.html"
Created on 2022-06-22 by the reprex package (v2.0.1)
Created on 2022-04-27 by the reprex package (v2.0.1)
Should prefer function over floating topic