-
-
Notifications
You must be signed in to change notification settings - Fork 996
Enable pkgdown/downlit cross-package links to rmarkdown #1843
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
Conversation
|
@cderv I didn't merge this PR because I don't like having two URLs here. Is there a way to configure pkgdown so that it doesn't have to read the URL from |
|
There isn’t, sorry. |
|
Perhaps it's a stupid question, but what is |
|
It's the url of the site? pkgdown needs it in order to generate the full path to the reference and article parts of the site. |
|
I mean why we have to define the same URL in both |
|
Because many people have existing urls in their DESCRIPTION file that are not pkgdown sites. Additionally, people often want to list both the user facing website and the github website, so pkgdown would then need some heuristic to figure out which url you mean when there were multiple urls. |
|
@yihui I did not know that as there was not comment. I just thought is was waiting to be reviewed and merged. I felt it was better to have the link from downlit autolinking points toward our pkgdown website instead of the default, currently > downlit::autolink("rmarkdown::render")
[1] "<a href='https://rdrr.io/pkg/rmarkdown/man/render.html'>rmarkdown::render</a>"IMO it seems better to have this > downlit::autolink("rmarkdown::render")
[1] "<a href='https://rmarkdown.rstudio.com/docs//reference/render.html'>rmarkdown::render</a>"What is the drawback of having two URLs in DESCRIPTION ? |
@hadley Sorry I didn't get it. I was asking, since you have
I don't know if this "people often want to list both" is true. Even if it is true, it feels weird to me that pkgdown needs to force users into listing a pkgdown website in
@cderv The PR came at a difficult time of mine, and was left behind. I'll try to be more active in the future if I have concerns about certain PRs.
I have no question with that.
First, I prefer a single entry point. When you have two URLs, users have to think about or try to decide which URL to open. This URL could be either the Github repo, or rmarkdown.rstudio.com. Second, for citation entries automatically generated from The URL may end up being |
|
@yihui pkgdown needs a url at two times — it needs a url when you build the site in order to generate (e.g.) https://rmarkdown.rstudio.com/docs/pkgdown.yml. It also needs the url when other packages build their websites in order to find the I can't replicate your problem with packageDescription("dplyr")$URL
#> [1] "https://dplyr.tidyverse.org, https://github.com/tidyverse/dplyr"
toBibtex(citation("dplyr"))
#> @Manual{,
#> title = {dplyr: A Grammar of Data Manipulation},
#> author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller},
#> year = {2021},
#> note = {R package version 1.0.4},
#> url = {https://CRAN.R-project.org/package=dplyr},
#> }Created on 2021-02-08 by the reprex package (v1.0.0) |
|
After installing the dev version, see the two url in citation toBibtex(citation("rmarkdown"))
#> @Manual{,
#> title = {rmarkdown: Dynamic Documents for R},
#> author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
#> year = {2021},
#> note = {R package version 2.6.6},
#> url = {https://rmarkdown.rstudio.com/docs/,
#> https://github.com/rstudio/rmarkdown},
#> }
#>
#> @Book{,
#> title = {R Markdown: The Definitive Guide},
#> author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
#> publisher = {Chapman and Hall/CRC},
#> address = {Boca Raton, Florida},
#> year = {2018},
#> note = {ISBN 9781138359338},
#> url = {https://bookdown.org/yihui/rmarkdown},
#> }
#>
#> @Book{,
#> title = {R Markdown Cookbook},
#> author = {Yihui Xie and Christophe Dervieux and Emily Riederer},
#> publisher = {Chapman and Hall/CRC},
#> address = {Boca Raton, Florida},
#> year = {2020},
#> note = {ISBN 9780367563837},
#> url = {https://bookdown.org/yihui/rmarkdown-cookbook},
#> }Created on 2021-02-09 by the reprex package (v1.0.0) But I think this because of what we use in Lines 8 to 19 in de0e2ec
You don't have that file in dplyr so the citation generated if the default one, which is NOT using the URL field in DESCRIPTION So we could in rmarkdown directly handle the multiple url cases to only keep one of them for citation. |
Merge remote-tracking branch 'rstudio_origin/master' into jg-devel * rstudio_origin/master: (26 commits) Use data-external=1 to prevent encoding by Pandoc of img src add `subdirs` documentation for site generator (rstudio#2058) fix: corrected typo in `ghostscript` (rstudio#2059) Add CoC contact email quillt has moved to rstudio/quillt fix invalid HTML code in shiny_prerendered documents (rstudio#1942) Allow pkgdown PR preview (rstudio#2055) Adding pkgdown site built by GHA (rstudio#1955) Add shiny bslib dependency inside html_document_base pre-process (rstudio#2049) start the next version CRAN release v2.7 place <div> in \code{} amend 62ae2ed and rstudio#1989: make sure output_format_filter is a function; testing NULL is not enough, e.g., the radix package still calls use CRAN releases of shiny and bslib tweak news Only keep the first url in citation (rstudio#2041) Fix for knit_print.data.frame (rstudio#2050) set gfm_auto_identifiers to input format if toc is TRUE (rstudio#2040) Enable pkgdown/downlit cross-package links to rmarkdown (rstudio#1843) update CONTRIBUTING.md ... # Conflicts: # DESCRIPTION
See https://github.com/r-lib/downlit#cross-package-links for details