Closed remlapmot closed 3 months ago
Thanks for the suggestion! I noticed this as well, but I wasn't sure if it is a good idea to inject html code here.
Also unfortunately R does not expose the code it uses to parse these urls (I think it is done with htmlify_text
which is inlined inside tools:::.DESCRIPTION_to_HTML
.
Also if I look at the CRAN pages, only the doi:
urls are linked? For the examples above the arxiv/isbn/issn urls do not?
Oh yes - sorry I didn't check all the CRAN pages.
Also there is an unexported linkify()
function in pkgdown which can handle the doi, arxiv, and I think ftp and http (this function seems to produce a bad URL if there is a space after the :
).
pkgdown:::linkify("<arXiv:2203.03384>")
#> [1] "<<a href='https://arxiv.org/abs/2203.03384'>arXiv:2203.03384</a>>"
pkgdown:::linkify("<doi:10.1016/j.jeconom.2015.06.004>")
#> [1] "<<a href='https://doi.org/10.1016/j.jeconom.2015.06.004'>doi:10.1016/j.jeconom.2015.06.004</a>>"
Created on 2024-06-05 with reprex v2.1.0
OK I have implemented it for doi:
and arxiv:
and https://
links at least. Do you want to check some packages if it seems to work now? I'm not sure yet if it is worth implementing the others (isbn, ftp, etc).
Works beautifully - thanks very much.
I agree that those other ones don't seem worth it.
This is a super minor issue but I thought I'd check if you'd spotted it.
In the
Description:
field of theDESCRIPTION
file (and I guess in helpfile documentation as well) r-universe doesn't render some R linking syntax as URLs. These are<doi:>
,<url:>
,<arxiv:>
,<issn:>
,<isbn:>
,<ftp:>
- there may be others - apologies I don't know where the official docs are for these.Here are some examples where they haven't been rendered
<doi:>
/<DOI:>
https://remlapmot.r-universe.dev/OneSampleMR<url:>
/<URL:>
https://cran.r-universe.dev/flexsurv/doc/manual.html#ajfit<arxiv:>
/<arXiv:>
https://cran.r-universe.dev/EATME<issn:>
/<ISSN:>
https://cran.r-universe.dev/recapr<isbn:>
/<ISBN:>
https://cran.r-universe.dev/cinterpolate<ftp:>
https://cran.r-universe.dev/homologeneWhereas these do render as hyperlinks on CRAN, e.g. https://cran.r-project.org/package=OneSampleMR.