-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_custom.R
58 lines (46 loc) · 1.33 KB
/
build_custom.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
rm(list=ls())
library(here)
repo_root = here::here()
setwd(repo_root)
#loading everything
devtools::load_all()
# creating app example
FM_compact = system.file(package="formods", "templates", "FM_compact.R")
fmapp = readLines(FM_compact)
fmapp = c("if(interactive()){",
fmapp,
"}")
FM_compact_example = file.path(repo_root, "inst", "test_apps", "FM_compact.R")
fileConn=file(FM_compact_example)
writeLines(fmapp, fileConn)
close(fileConn)
if(file.exists("docs")){
unlink("docs", recursive = TRUE)
}
# building documentation
devtools::document(roclets = c('rd', 'collate', 'namespace', 'vignette'))
# Build the favicons
pkgdown::build_favicons(overwrite=TRUE)
# Rebuilding the pkgdown site
pkgdown::build_site()
file.copy("CNAME", "docs/CNAME")
# # Fixing any broken image references
# art_dir = file.path("docs", "articles")
#
# # Getting all of the html files in the article dir
# htds = dir(art_dir, "*.html")
#
# for(htd in htds){
# fn = file.path(art_dir, htd)
#
# cfn = file(fn, open="r")
# htd_lines = readLines(cfn)
# close(cfn)
#
# # For some reason it's doing this weird relative path thing, so I'm stripping that out here:
# trim_txt = "../../../../../../My%20Drive/projects/formods/github/nlmixr2rpt/articles/"
# htd_lines = gsub(trim_txt, "", htd_lines)
#
# write(htd_lines, file=fn, append=FALSE)
#
# }