forked from Roche/Global-HTA-Evidence-Open
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_github_sites.R
108 lines (86 loc) · 4.06 KB
/
update_github_sites.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# script to update the documentation and vignettes hosted at https://roche.github.io/Global-HTA-Evidence-Open/index.html
# for each package once a change is made update the following files then run the appropriate section of code
# this will pre-compile all the vignettes and documentation to the website
##############################################
# Updates to add a new package
# when adding a new package is necessary to include links/make updates in the following files as well as in this script:
# README.md
# all existing _pkgdown.yml files (update the navbar section for other packages)
# update the index page (just converts the README.md to html)
markdown::markdownToHTML("README.md", output = "docs/index.html")
##############################################
# rpsftmPlus
##############################################
# 1) make any updates to the package
# 2) update documentation using devtools
devtools::document(pkg = "Rpackages/rpsftmPlus")
# 3) reinstall the updated package
devtools::install(pkg = "Rpackages/rpsftmPlus")
# 4) update the file Rpackages/rpsftmPlus/_pkgdown.yml
# 5) rebuild documentation using pkgdown
pkgdown::build_site(pkg = "Rpackages/rpsftmPlus")
# 6) copy site to correct location in repo for github sites hosting
file.copy(from = "Rpackages/rpsftmPlus/docs",
to = "docs/Rpackages/rpsftmPlus",
overwrite = TRUE,
recursive = TRUE)
##############################################
# MAIC
##############################################
# 1) make any updates to the package
# 2) update documentation using devtools
devtools::document(pkg = "Rpackages/MAIC")
# 3) reinstall the updated package
devtools::install(pkg = "Rpackages/MAIC")
# 4) update the file Rpackages/MAIC/_pkgdown.yml
# 5) rebuild documentation using pkgdown
pkgdown::build_site(pkg = "Rpackages/MAIC")
# 6) copy site to correct location in repo for github sites hosting
file.copy(from = "Rpackages/MAIC/docs",
to = "docs/Rpackages/MAIC",
overwrite = TRUE,
recursive = TRUE)
##############################################
# gemtcPlus
##############################################
# 1) make any updates to the package
# 2) update documentation using devtools
devtools::document(pkg = "Rpackages/gemtcPlus")
# 3) reinstall the updated package
devtools::install(pkg = "Rpackages/gemtcPlus")
# 4) update the file Rpackages/gemtcPlus/_pkgdown.yml
# 5) rebuild documentation using pkgdown
pkgdown::build_site(pkg = "Rpackages/gemtcPlus")
# Note as the vignettes for gemtcPlus can take a long time to run it is
# also possible just to update partial sections by just running the
# below functions without regenerating the vignettes
pkgdown::build_home(pkg = "Rpackages/gemtcPlus")
pkgdown::build_reference(pkg = "Rpackages/gemtcPlus")
pkgdown::build_articles_index(pkg = "Rpackages/gemtcPlus")
# 6) copy site to correct location in repo for github sites hosting
file.copy(from = "Rpackages/gemtcPlus/docs",
to = "docs/Rpackages/gemtcPlus",
overwrite = TRUE,
recursive = TRUE)
##############################################
# flexsurvPlus
##############################################
# 1) make any updates to the package
# 2) update documentation using devtools
devtools::document(pkg = "Rpackages/flexsurvPlus")
# 3) reinstall the updated package
devtools::install(pkg = "Rpackages/flexsurvPlus")
# 4) update the file Rpackages/flexsurvPlus/_pkgdown.yml
# 5) rebuild documentation using pkgdown
pkgdown::build_site(pkg = "Rpackages/flexsurvPlus")
# Note as the vignettes for flexsurvPlus can take a long time to run it is
# also possible just to update partial sections by just running the
# below functions without regenerating the vignettes
pkgdown::build_home(pkg = "Rpackages/flexsurvPlus")
pkgdown::build_reference(pkg = "Rpackages/flexsurvPlus")
pkgdown::build_articles_index(pkg = "Rpackages/flexsurvPlus")
# 6) copy site to correct location in repo for github sites hosting
file.copy(from = "Rpackages/flexsurvPlus/docs",
to = "docs/Rpackages/flexsurvPlus",
overwrite = TRUE,
recursive = TRUE)