Best practices for static HTMLs in Shiny packages

Hi RStudio Community,

I am trying to deploy my Shiny app in a package and have trouble with some of the static HTML elements that are included in the app. In my app, I have a "Documentation" tab that displays a static HTML file using includeHTML(file.path). This runs just fine locally, but when I deploy to github I don't know where a stable place is to put these HTML files, or whether there's another way I should code it. I have been using {golem} to package everything up.

The files are currently stored in R/Documentation/ but I know this is weird. There are three HTML files, one in each of three languages. The server switches which HTML file to display based on the language the user has chosen. I get an error when I try to run_app() after loading the library about the Documentation/ directory. Is there a better place to put these files? I can't find any best practices online about where static HTML files should be stored when deploying Shiny apps in packages.

I don't have a reprex (sorry! but this is like a complicated installation thing that I don't think I can encapsulate in a reprex!) but here is the link to my package in progress.

Thanks in advance for your help.

I am a fool! There is a standard place where HTML files should go in packages containing Shiny apps. They should be contained in

nameofpackage/inst/nameoffile.html

and referenced in the app.R file using app_sys("nameoffile.html"). Hopefully this will help other folks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.