-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_custom.R
38 lines (26 loc) · 1.03 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
setwd(here::here())
# Rebuilding the test data
#source(file.path(here::here(), "inst", "test_scripts", "mk_multipage_table.R"))
rm(list=ls())
repo_root = here::here()
devtools::load_all()
# building documentation
devtools::document(roclets = c('rd', 'collate', 'namespace', 'vignette'))
# Rebuilding the pkgdown site
pkgdown::build_site()
# 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 = "../../../../../Google%20Drive/Ubiquity/github/ubiquity/vignettes/"
#trim_txt = "../../../../../Google%20Drive/onbrand/github/onbrand/vignettes/"
trim_txt = "../../../../../../My%20Drive/projects/onbrand/github/onbrand/articles/"
htd_lines = gsub(trim_txt, "", htd_lines)
write(htd_lines, file=fn, append=FALSE)
}