inst/app/global.R

### Load libraries ###
library(shiny)
library(shinyAce)
library(shinyFiles)
library(shinyBS)
library(knitr)
library(rmarkdown)
### ###


### Set options ###
editR:::.loadOptions()
### ###


### Load app bits ###
bits <- paste0("bits/",
               c("header", "about", "keyboard", "hidden",
                 "navbar", "editor", "preview"), ".R")
sapply(bits, source)
### ###


### Prepare file ###
if (is.null(md_path)) {
  setwd(tempdir())
} else {
  setwd(md_path)
  
  if (!file.exists(md_name)) {
    template_path <- paste0(find.package("editR"), "/app/template.Rmd")
    template <- readChar(template_path, file.info(template_path)$size)
    cat(template, file = md_name)
  }
  
  md_bak <- NULL
}
### ###
swarm-lab/editR documentation built on May 30, 2019, 9:35 p.m.