-
Notifications
You must be signed in to change notification settings - Fork 334
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
pkgdown 1.1.0 does not process \doi tags #720
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
One problem is the #' \doi{blah}
test <- function() {} triggers For reference: devtools::load_all("~/devel/pkgdown")
#> Loading pkgdown
rd_text("\\doi{10.1177/0163278703255230}")
#> \Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("#1")}10.1177/0163278703255230[results=rd,stage=build]{tools:::Rd_expr_doi("10.1177/0163278703255230")}
tools:::Rd_expr_doi("10.11177/0163278703255230")
#> [1] "\\ifelse{text}{doi: 10.11177/0163278703255230 (URL: http://doi.org/10.11177/0163278703255230)}{\\ifelse{latex}{doi:\\out{\\nobreakspace{}}\\href{http://doi.org/10.11177/0163278703255230}{10.11177\\out{\\slash{}}0163278703255230}}{doi: \\href{http://doi.org/10.11177/0163278703255230}{10.11177/0163278703255230}}}"
# rd2html deals with this OK
rd2html(tools:::Rd_expr_doi("10.11177/0163278703255230"))
#> [1] "doi: <a href='http://doi.org/10.11177/0163278703255230'>10.11177/0163278703255230</a>" Created on 2018-06-15 by the reprex package (v0.2.0). |
I haven't checked systematically yet, but I can confirm that for all .rd-file I remember where an error occured, these also contained a doi-tag. |
In the meantime I have also prepared an example package: https://github.com/aqualogy/pdtest720 First I suspected the Rdpack macro @KasperSkytte Since I used to explicitely overwrite the destination of the output to a subdirectory of public/ (Gitlab's standard directory for static html output) depending on the R version (public/R-3.5.0/), I didn't expect to get a directory docs/ produced by |
I removed |
so what has changed with the parsing, as all works well in version 1.0.0? |
Hmm, good question. Your DOI links were previously linked just fine using 1.0.0. https://strengejacke.github.io/sjstats/reference/deff.html#references It's most likely a change in This test needs to pass: test_that("DOIs are linked", {
expect_equal(
rd2html("\\doi{10.1177/0163278703255230}"),
"doi: <a href='http://doi.org/10.11177/0163278703255230'>10.11177/0163278703255230</a>"
)
}) |
The tag |
Sexpr with multiple args \Sexpr[results=rd,stage=build] were not parsed correctly Closes #720
|
Not yet! After updating to current master ( sessionInfo()R version 3.5.0 (2018-04-23) Platform: x86_64-redhat-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core) Matrix products: default locale: attached base packages: other attached packages: loaded via a namespace (and not attached): traceback5: stop(err[[2]]) 4: get_result(output = out, options) 3: callr::r(function(...) pkgdown::build_site(...), args = args, show = TRUE) 2: build_site_external(pkg = pkg, examples = examples, document = document, run_dont_run = run_dont_run, seed = seed, mathjax = mathjax, lazy = lazy, override = override, preview = preview) 1: pkgdown::build_site(".") |
Fixes parsing of Sexpr with multiple args (`\Sexpr[results=rd,stage=build]`). Fixes #720.
thanks, works for me now! |
Same here! Thanks! |
same here
|
It's fixed in the latest development version. Just install it with |
I can confirm @KasperSkytte last comment. With current master, installed by devtools::install_github("r-lib/pkgdown") everything works well and \insertRef or \doi don't cause problems. |
When I use
build_site()
with my package (https://github.com/strengejacke/sjstats), I get following error for pkgdown 1.1.0:Reverting to pkgdown 1.0.0 solves the problem, there's no error then.
The text was updated successfully, but these errors were encountered: