ff_sup_rmd2htmlpdfr: Searchs for Rmd Files in several folders, render to HTML or...

Description Usage Arguments Value Author(s) References Examples

View source: R/ff_sup_inout.R

Description

searches in several directories for files with Rmd suffix. Skip some file names that contain strings in ar_spn_skip. Save output rendered HTML and PDF files to a directory. And control if to render Rmd to PDF, HTML as well as R.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ff_sup_rmd2htmlpdfr(
  ar_spt_root = c("C:/Users/fan/R4Econ/amto/array/",
    "C:/Users/fan/R4Econ/math/integration"),
  ar_spn_skip = c("basics", "integrate"),
  st_rmd_suffix_pattern = ".Rmd",
  st_save_add_suffix = "",
  spt_out_directory = "C:/Users/fan/downloads",
  bl_recursive = TRUE,
  ls_bool_convert = list(bl_pdf = TRUE, bl_html = TRUE, bl_R = TRUE),
  bl_verbose = TRUE
)

Arguments

ar_spt_root

array of string paths of folders to search in

ar_spn_skip

array a string array of names, if path found contains any of the string in the array, will skip.

st_rmd_suffix_pattern

string name of file suffix to search over

st_save_add_suffix

string suffix to add to rendered html, pdf files

spt_out_directory

string full path of where to store the rendered html, pdf, r files

bl_recursive

boolean if to search in folders recursively

ls_bool_convert

list of booleans to generate pdf, html and or R file. Generate only HTML for example. considered included, searched and found

bl_verbose

verbose printing more

Value

a list of string paths of files generated

#'

Author(s)

Fan Wang, http://fanwangecon.github.io

References

https://fanwangecon.github.io/R4Econ/development/inout/htmlpdfr/fs_rmd_pdf_html.html https://github.com/FanWangEcon/REconTools/blob/master/R/ff_sup_inout.R

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ar_spt_root <- c('C:/Users/fan/R4Econ/support/rmd')
ar_spn_skip <- c('matrix', 'tibble', '_main')
spt_out_directory <- 'C:/Users/fan/downloads'
st_save_add_suffix <- '_newsave'
ls_bool_convert <- list(bl_pdf=TRUE, bl_html=TRUE, bl_R=TRUE)
bl_verbose <- TRUE
ff_sup_rmd2htmlpdfr(ar_spt_root=ar_spt_root, ar_spn_skip=ar_spn_skip,
                    spt_out_directory=spt_out_directory, st_save_add_suffix=st_save_add_suffix,
                    ls_bool_convert=ls_bool_convert,
                    bl_verbose=bl_verbose)

FanWangEcon/REconTools documentation built on Jan. 21, 2022, 10:28 p.m.