Skip to content

Commit

Permalink
refactor to avoid writing to disc
Browse files Browse the repository at this point in the history
  • Loading branch information
narayanan-iyer-pfizer committed Mar 12, 2024
1 parent 9ce1535 commit 4ec3b60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/mod_code_explorer.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ mod_code_explorer_server <- function(id, selected_pkg, pkgarchive = reactiveVal(
man_page <- reactive({
if (rlang::is_empty(man_files())) return(HTML("No files to display"))
req(input$man_files)
out_dir <- tempdir()
fp <- file.path(glue::glue("{selected_pkg$name()}"), "man", input$man_files)
con <- archive::archive_read(file.path("tarballs",
glue::glue("{selected_pkg$name()}_{selected_pkg$version()}.tar.gz")),
file = fp)
Rdfile <-tools::parse_Rd(con)
close(con)
tools::Rd2HTML(Rdfile, package = c(selected_pkg$name(), selected_pkg$version()), out = file.path(out_dir, "man.html"))
includeHTML(file.path(out_dir, "man.html"))
HTML(paste0(capture.output(tools::Rd2HTML(Rdfile,
package = c(selected_pkg$name(),
selected_pkg$version()), out = "")), collapse = "\n"))
}) %>%
bindEvent(input$man_files, input$exported_function, ignoreNULL = FALSE)

Expand Down

0 comments on commit 4ec3b60

Please sign in to comment.