diff --git a/DESCRIPTION b/DESCRIPTION index ab50818..dadac8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: phstemplates Title: PHS R Templates -Version: 1.2.1 +Version: 1.2.2 Authors@R: c( person("Public Health Scotland", , , "phs.datascience@phs.scot", role = "cph"), person("Alan", "Yeung", , "alan.yeung@phs.scot", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index bfe57a6..754751d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# phstemplates 1.2.2 + +* The `compile_report()` and `phs_report_docx()` no longer need to search for the word 'Introduction' to add in the table of contents to PHS report templates. +* The PHS shiny app template now includes the name of the app entered by the user at the top of the readme. + # phstemplates 1.2.1 * Updated accredited official statistics templates to include the accredited badge. @@ -17,18 +22,18 @@ # phstemplates 1.1.0 -* Added PHS shiny app template, accessible through the RStudio menus or through phsshinyapp(). +* Added PHS shiny app template, accessible through the RStudio menus or through `phsshinyapp()`. # phstemplates 1.0.1 -* Added add_gitignore() function which allows the user to add a PHS style .gitignore file to a given directory +* Added `add_gitignore()` function which allows the user to add a PHS style `.gitignore` file to a given directory * RStudio addin for `add_gitignore()` so users can add `.gitignore` directly from RStudio. * Minor updates to template text and fixed README link # phstemplates 1.0.0 -* Added the phs_report_docx RMarkdown document type. -* Updated the PHS official and national stats report templates to use the phs_report_docx RMarkdown document type. +* Added the `phs_report_docx` RMarkdown document type. +* Updated the PHS official and national stats report templates to use the `phs_report_docx` RMarkdown document type. * Removed the ISD national stats summary and report templates. # phstemplates 0.9.6 @@ -37,7 +42,7 @@ # phstemplates 0.9.5 -* Added compile_report() function to handle creating reports. +* Added `compile_report()` function to handle creating reports. * Added a code chunk at the top of report templates to help set the working directory. # phstemplates 0.9.4 @@ -70,7 +75,7 @@ # phstemplates 0.8.2 -* Renamed project function to phsproject() in preparation for package name change. +* Renamed project function to `phsproject()` in preparation for package name change. * Better error checking of filepaths for the RStudio 1.2 HPS report template. # phstemplates 0.8.1 diff --git a/R/phsshinyapp.R b/R/phsshinyapp.R index 1d276c6..a977473 100644 --- a/R/phsshinyapp.R +++ b/R/phsshinyapp.R @@ -53,6 +53,7 @@ phsshinyapp <- function(path, author = Sys.info()[["user"]], app_name = "WRITE A # Getting shiny files from inst/ readme <- readLines(system.file(package = "phstemplates", "text", "shiny", "README.md")) + readme <- gsub("WRITE APP NAME HERE", app_name, readme) setup_code <- readLines(system.file(package = "phstemplates", "text", "shiny", "setup.R")) css_code <- readLines(system.file(package = "phstemplates", "text", "shiny", "shiny_css.css")) css_code_phs <- readLines(system.file(package = "phstemplates", "text", "phs_style.css"))