Skip to content

Commit d65da1b

Browse files
committed
Update docs, redocument
1 parent e38a940 commit d65da1b

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(convert_md_to_html)
4+
export(fetch_strategy_description)
35
export(plot_rates)
46
export(run_app)
57
importFrom(rlang,.data)

R/utils_description.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#' Fetch Strategy Text from NHP Inputs
22
#' @param strategy Character. The variable name for a strategy, e.g.
33
#' `"discharged_no_treatment_adult_ambulance"`.
4+
#' @param descriptions_lookup Character. The names of the available Markdown
5+
#' description files.
46
#' @details Markdown files containing strategy descriptions are read from
57
#' [NHP Inputs](https://github.com/The-Strategy-Unit/nhp_inputs/).
68
#' @return Character.
79
#' @export
810
fetch_strategy_description <- function(strategy, descriptions_lookup) {
9-
strategy_text <- descriptions_lookup[stringr::str_detect(
10-
strategy,
11-
descriptions_lookup
12-
)]
11+
is_stub <- stringr::str_detect(strategy, descriptions_lookup)
12+
strategy_stub <- descriptions_lookup[is_stub]
1313

1414
withr::with_tempfile("temp", {
1515
# nolint start object_usage_linter.
1616
utils::download.file(
1717
glue::glue(
1818
"https://raw.githubusercontent.com/The-Strategy-Unit/nhp_inputs/",
19-
"refs/heads/main/inst/app/strategy_text/{strategy_text}.md"
19+
"refs/heads/main/inst/app/strategy_text/{strategy_stub}.md"
2020
),
2121
temp
2222
)

man/convert_md_to_html.Rd

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fetch_strategy_description.Rd

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)