Skip to content

Commit

Permalink
resource naming and referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-navarro committed Mar 13, 2024
1 parent 3b6f796 commit 626d155
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion R/launch_app.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ launch_app <- function(
browser = getOption("shiny.launch.browser", interactive())) {
shiny::addResourcePath(
"resources",
system.file("app_resources", package = "calmr.app")
system.file("resources", package = "calmr.app")
)
ui <- calmr_ui(
analytics_file = NULL
Expand Down
4 changes: 2 additions & 2 deletions R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Default is NULL, in which case, no analytics are pushed.
#' @export
calmr_ui <- function(
analytics_file = "inst/app_resources/google_analytics.html") {
analytics_file = "inst/resources/google_analytics.html") {
if (!is.null(analytics_file)) {
analytics <- htmltools::includeHTML(analytics_file)
} else {
Expand Down Expand Up @@ -207,7 +207,7 @@ calmr_ui <- function(
tabName = "about",
shiny::fluidPage(
htmltools::HTML(
'<center><img src="logo.png" width="20%"></center>'
'<center><img src="resources/logo.png" width="20%"></center>'
),
htmltools::br(), htmltools::br(),
htmltools::HTML('Canonical Associative Learning Models
Expand Down
File renamed without changes.
File renamed without changes
5 changes: 3 additions & 2 deletions inst/test_deployment.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ devtools::install_github("victor-navarro/calmr", force = TRUE)
tmp <- tempdir()
file.copy("R/server.R", file.path(tmp, "server.R"))
file.copy("R/ui.R", file.path(tmp, "ui.R"))
file.copy("inst/app_resources", tmp, recursive = TRUE)
file.copy("inst/resources", tmp, recursive = TRUE)

shiny::addResourcePath(
"resources",
system.file("app_resources", package = "calmr.app")
system.file("resources", package = "calmr.app")
)

rsconnect::deployApp(tmp,
appName = "calmr_app_test",
forceUpdate = TRUE
)
2 changes: 1 addition & 1 deletion man/calmr_ui.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 626d155

Please sign in to comment.