|
1 | | - |
2 | | -#' @name html-manuals |
| 1 | +#' @name build-dbs |
3 | 2 | #' |
4 | 3 | #' @title Helper functions to generate HTML pages for reference manuals |
5 | 4 | #' |
@@ -81,7 +80,7 @@ build_db_from_source <- function(package_dir, reposRoot) { |
81 | 80 | message(xtofile) |
82 | 81 | } |
83 | 82 |
|
84 | | -#' @rdname html-manuals |
| 83 | +#' @rdname build-dbs |
85 | 84 | #' |
86 | 85 | #' @param web_dir `character(1)` The `web/packages` local directory that is |
87 | 86 | #' also hosted on the website e.g., for CRAN |
@@ -132,7 +131,7 @@ build_meta_aliases_db <- |
132 | 131 |
|
133 | 132 | is_file <- function(x) file.exists(x) && !file.info(x)[["isdir"]] |
134 | 133 |
|
135 | | -#' @rdname html-manuals |
| 134 | +#' @rdname build-dbs |
136 | 135 | #' |
137 | 136 | #' @param rdxrefs_db_file `character(1)` The file path to `rdxrefs.rds` file |
138 | 137 | #' generated by the `build_db_from_source` function. |
@@ -172,49 +171,3 @@ build_meta_rdxrefs_db <- |
172 | 171 |
|
173 | 172 | db[sort(names(db))] |
174 | 173 | } |
175 | | - |
176 | | -#' @rdname html-manuals |
177 | | -#' |
178 | | -#' @param package_dirs `character()` A vector of local source package |
179 | | -#' directories. |
180 | | -#' |
181 | | -#' @examples |
182 | | -#' if (interative()) { |
183 | | -#' library(BiocPkgTools) |
184 | | -#' bioc_sub <- pkgBiocDeps( |
185 | | -#' "SummarizedExperiment", pkgType = "software", |
186 | | -#' recursive = TRUE, only.bioc = TRUE |
187 | | -#' ) |
188 | | -#' bioc_sub <- unlist(bioc_sub, use.names = FALSE) |
189 | | -#' |
190 | | -#' ## generate from Bioc package source dirs |
191 | | -#' packages <- file.path(normalizePath("~/bioc"), bioc_sub) |
192 | | -#' reposRoot <- "~/minibioc/packages/3.20/bioc" |
193 | | -#' |
194 | | -#' build_html_mans(packages, reposRoot) |
195 | | -#' } |
196 | | -#' @export |
197 | | -build_html_mans <- function(package_dirs, reposRoot) { |
198 | | - packages <- basename(package_dirs) |
199 | | - man_dir <- file.path(reposRoot, "manuals") |
200 | | - if (!dir.exists(man_dir)) dir.create(man_dir, recursive = TRUE) |
201 | | - outfiles <- file.path(man_dir, packages, "man", paste0(packages, ".html")) |
202 | | - outdirs <- dirname(outfiles) |
203 | | - for (i in seq_along(package_dirs)) { |
204 | | - if (!dir.exists(outdirs[i])) |
205 | | - dir.create(outdirs[i], recursive = TRUE) |
206 | | - tools::pkg2HTML( |
207 | | - dir = package_dirs[i], |
208 | | - out = outfiles[i], |
209 | | - hooks = list( |
210 | | - pkg_href = function(pkg) { |
211 | | - sprintf( |
212 | | - "../../%s/man/%s.html", |
213 | | - pkg, pkg |
214 | | - ) |
215 | | - } |
216 | | - ) |
217 | | - ) |
218 | | - } |
219 | | - outfiles |
220 | | -} |
0 commit comments