| Line 7... |
Line 7... |
| 7 |
## Test processing and conversion of bibtools.Rd
|
7 |
## Test processing and conversion of bibtools.Rd
|
| 8 |
Rd2txt("bibtools.Rd", stages = "build") |>
|
8 |
Rd2txt("bibtools.Rd", stages = "build") |>
|
| 9 |
assertWarning(verbose = TRUE)
|
9 |
assertWarning(verbose = TRUE)
|
| 10 |
|
10 |
|
| 11 |
## Also test for changes in HTML conversion
|
11 |
## Also test for changes in HTML conversion
|
| 12 |
Rd2HTML("bibtools.Rd", htmlfile <- tempfile(),
|
12 |
Rd2HTML("bibtools.Rd", out <- "bibtools.html",
|
| 13 |
stages = "build", standalone = FALSE) |>
|
13 |
stages = "build", standalone = FALSE) |>
|
| 14 |
assertWarning() # the same
|
14 |
assertWarning() # the same
|
| 15 |
## FIXME: carry-over of unshown citation (cache not cleared)
|
15 |
## FIXME: carry-over of unshown citation (cache not cleared)
|
| 16 |
Rdiff(htmlfile, "bibtools.html.save")
|
16 |
if (!Rdiff(out, "bibtools.html.save")) unlink(out)
|
| 17 |
|
17 |
|
| 18 |
## Check cited but not shown
|
18 |
## Check cited but not shown
|
| 19 |
pkgdir <- package.skeleton("bibtools", list = ".NotYetImplemented",
|
19 |
pkgdir <- package.skeleton("bibtools", list = ".NotYetImplemented",
|
| 20 |
path = tempdir()) |> suppressMessages()
|
20 |
path = tempdir()) |> suppressMessages()
|
| 21 |
file.copy("bibtools.Rd", file.path(pkgdir, "man")) |> stopifnot()
|
21 |
file.copy("bibtools.Rd", file.path(pkgdir, "man")) |> stopifnot()
|
| 22 |
tools:::.check_Rd_bibentries_cited_not_shown(dir = pkgdir)
|
22 |
tools:::.check_Rd_bibentries_cited_not_shown(dir = pkgdir)
|
| 23 |
## ("unexpected_macro_expansion" as there is no build/partial.rdb)
|
23 |
## ("unexpected_macro_expansion" as there is no build/partial.rdb)
|
| 24 |
|
- |
|
| 25 |
|
- |
|
| 26 |
## FIXME: "srcref" of usermacro expansion such as from \bibshow{*}
|
- |
|
| 27 |
rd <- parse_Rd(textConnection(r"(\newcommand{\Emph}{\emph{#1}}
|
- |
|
| 28 |
\Emph{this}
|
- |
|
| 29 |
)"), fragment = TRUE, verbose = TRUE, macros = FALSE)
|
- |
|
| 30 |
rd
|
- |
|
| 31 |
print(lapply(rd, getSrcref), useSource = FALSE)
|
- |
|
| 32 |
## The expansion [[4]] currently refers to source "chars 2:12 to 2:11".
|
- |
|
| 33 |
## We would need this to refer to column 1 (re-use the invocations "srcref")
|
- |
|
| 34 |
## such that also in R < 4.6.0, Rd2HTML() would addParaBreaks()
|
- |
|
| 35 |
## for multiple references separated by blank lines in bibshow's \Sexpr result.
|
- |
|