r
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
645B

  1. #' @importFrom rmarkdown pandoc_convert
  2. #' @importFrom yaml read_yaml
  3. extract_outputs <- function(docx,
  4. track_changes,
  5. wrap,
  6. verbose = FALSE) {
  7. md_tmp <- tempfile(fileext = ".md")
  8. pandoc_convert(normalizePath(docx),
  9. from = "docx+styles+empty_paragraphs",
  10. to = "markdown+fenced_code_blocks",
  11. options = c(
  12. paste0(
  13. "--lua-filter=",
  14. system.file("lua-filters", "extract-outputs.lua", package = "redoc")
  15. ),
  16. "--standalone"
  17. ),
  18. output = md_tmp,
  19. verbose = verbose
  20. )
  21. yml <- yaml::read_yaml(md_tmp)
  22. yml
  23. }