R/zzz.R

Defines functions .onLoad

.onLoad <- function( libname, pkgname ) {
    pandoc_home <- Sys.getenv("PANDOC_HOME")
    if ( nchar(pandoc_home) ) {
        if ( file.exists((unix_path <- file.path(pandoc_home, "pandoc"))) ) {
            assign("path", unix_path, envir = get_pandoc())
        } else if ( file.exists((windows_path <- file.path(pandoc_home, "pandoc.exe"))) ) {
            assign("path", windows_path, envir = get_pandoc())
        } else {
            msg <- sprintf("'PANDOC_HOME' is set but neither '%s' nor '%s' exists", 
                           unix_path, windows_path)
            warning(msg)
        }
    } 
    set_pandoc_version(detect_pandoc_version())
    set_pandoc_types_version(detect_pandoc_types_version())
}

Try the pandocfilters package in your browser

Any scripts or data that you put into this service are public.

pandocfilters documentation built on Aug. 12, 2022, 1:05 a.m.