diff --git a/DESCRIPTION b/DESCRIPTION index 59a29d6..1d1eea7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: litedown Type: Package Title: A Lightweight Version of R Markdown -Version: 0.5 +Version: 0.5.1 Authors@R: c( person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666", URL = "https://yihui.org")), person("Tim", "Taylor", role = "ctb", comment = c(ORCID = "0000-0002-8587-7113")), @@ -22,7 +22,7 @@ Depends: R (>= 3.2.0) Imports: utils, commonmark (>= 1.9.1), - xfun (>= 0.49) + xfun (>= 0.50) Suggests: rbibutils, rstudioapi, diff --git a/NEWS.md b/NEWS.md index 58fef97..d7851d3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# CHANGES IN litedown VERSION 0.6 + # CHANGES IN litedown VERSION 0.5 - Added a wizard in `roam()` to create new `.Rmd`/`.md`/`.R` files with selected HTML features. diff --git a/R/format.R b/R/format.R index 97a4273..135b996 100644 --- a/R/format.R +++ b/R/format.R @@ -101,8 +101,8 @@ map_args = function( # split YAML and body from text input, and normalize rmarkdown output formats in # YAML to litedown's formats -yaml_body = function(text) { - res = xfun::yaml_body(text, use_yaml = FALSE) +yaml_body = function(text, ...) { + res = xfun::yaml_body(text, use_yaml = FALSE, ...) if (!length(out <- res$yaml[['output']])) { # if the key 'format' is provided, normalize it to 'output' if (length(out <- res$yaml[['format']])) res$yaml$format = NULL else return(res) diff --git a/R/preview.R b/R/preview.R index 7e435dc..44bcf49 100644 --- a/R/preview.R +++ b/R/preview.R @@ -327,8 +327,7 @@ new_file = function(path, ext, type, css = NULL, js = NULL) { if (nrow(a)) m$output$html = list(meta = list( css = I(na_omit(a[, 'css'])), js = I(na_omit(a[, 'js'])) )) - taml_save = getFromNamespace('taml_save', 'xfun') # TODO: remove this hack - txt = c('---', taml_save(m), '---', '', 'Relax. I need some information first.') + txt = c('---', xfun::taml_save(m), '---', '', 'Relax. I need some information first.') if (ext == 'r') txt = paste("#'", split_lines(txt)) write_utf8(txt, path) 'view' diff --git a/R/site.R b/R/site.R index 7641ddd..7f6c412 100644 --- a/R/site.R +++ b/R/site.R @@ -230,7 +230,7 @@ fuse_book = function(input = '.', output = NULL, envir = parent.frame()) { } } # remove YAML in the preview mode since we only need the body - if (length(preview)) out = yaml_body(split_lines(out))$body # TODO: use parse = FALSE + if (length(preview)) out = yaml_body(split_lines(out), parse = FALSE)$body if (format != 'html') return(out) # add input filenames to the end for HTML output and wrap each file in a div @@ -261,8 +261,7 @@ fuse_book = function(input = '.', output = NULL, envir = parent.frame()) { # read the config file _litedown.yml yml_config = function(d) { - if (file_exists(cfg <- file.path(d, '_litedown.yml'))) - xfun::yaml_load(read_utf8(cfg), use_yaml = FALSE) + if (file_exists(cfg <- file.path(d, '_litedown.yml'))) xfun::taml_file(cfg) } site_pattern = '[.][Rq]?md$'