Skip to content

Commit 73e83dd

Browse files
committed
use xfun 0.52 and rename wd.out to wd_out (working directory for output)
1 parent 2e14488 commit 73e83dd

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: litedown
22
Type: Package
33
Title: A Lightweight Version of R Markdown
4-
Version: 0.6.6
4+
Version: 0.6.7
55
Authors@R: c(
66
person("Yihui", "Xie", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0003-0645-5666", URL = "https://yihui.org")),
77
person("Tim", "Taylor", role = "ctb", comment = c(ORCID = "0000-0002-8587-7113")),
@@ -22,7 +22,7 @@ Depends: R (>= 3.2.0)
2222
Imports:
2323
utils,
2424
commonmark (>= 1.9.5),
25-
xfun (>= 0.51)
25+
xfun (>= 0.52)
2626
Suggests:
2727
rbibutils,
2828
rstudioapi,

R/fuse.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ fuse = function(input, output = NULL, text = NULL, envir = parent.frame(), quiet
464464
if (is_file(input) && is.null(opts$wd)) opts$wd = dirname(normalizePath(input))
465465

466466
# store output dir so we can calculate relative paths for plot files later
467-
.env$wd.out = normalize_path(
467+
.env$wd_out = normalize_path(
468468
if (is.null(output_base)) {
469-
if (is.character(.env$wd.out)) .env$wd.out else '.'
469+
if (is.character(.env$wd_out)) .env$wd_out else '.'
470470
} else dirname(output_base)
471471
)
472472
# store the environment and output format
@@ -746,7 +746,7 @@ fuse_code = function(x, blocks) {
746746
p3 = unlist(p2) # vector of plot paths
747747
# get the relative path of the plot directory
748748
fig.dir = if (length(p3)) tryCatch(
749-
sub('^[.]/', '.', paste0(dirname(relative_path(p3[1], .env$wd.out)), '/')),
749+
sub('^[.]/', '.', paste0(dirname(relative_path(p3[1], .env$wd_out)), '/')),
750750
error = function(e) NULL
751751
)
752752

R/utils.R

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ sans_yaml = function(x) {
4040
x
4141
}
4242

43-
# TODO: remove `if` after xfun 0.52
44-
split_chunk = function(...) {
45-
f = xfun::divide_chunk
46-
if ('...' %in% names(formals(f))) f(..., use_yaml = FALSE) else f(...)
47-
}
43+
split_chunk = function(...) xfun::divide_chunk(..., use_yaml = FALSE)
4844

4945
is_lang = function(x) is.symbol(x) || is.language(x)
5046

0 commit comments

Comments
 (0)