From 2e8e81597ad1970412b69ec37dc968ba9f1e8695 Mon Sep 17 00:00:00 2001 From: Ines Gimeno Date: Fri, 15 Nov 2024 17:55:18 +0100 Subject: [PATCH] re design site --- .github/workflows/coverage.yml | 69 ---------------------------- R/ActivityTable.R | 2 +- R/ChangelogTable.R | 4 +- R/ReplaceOutputs.R | 2 +- R/SignaturesTable.R | 4 +- R/TitlePage.R | 2 +- R/utils.R | 25 ++++++++++ R/utils_checks.R | 6 +++ README.Rmd | 2 + README.md | 2 + _pkgdown.yml | 4 +- man/ActivityTable.Rd | 2 +- man/ChangelogTable.Rd | 2 +- man/ChangelogTableRow.Rd | 2 +- man/ReplaceOutputs.Rd | 2 +- man/SignaturesTable.Rd | 2 +- man/SignaturesTableRow.Rd | 2 +- man/TitlePage.Rd | 2 +- man/change_figure.Rd | 1 + man/change_table.Rd | 1 + man/check_name.Rd | 1 + man/check_null_or_flextable.Rd | 1 + man/check_string_is_date.Rd | 1 + man/create_yml.Rd | 1 + man/cursor_reach_list.Rd | 1 + man/escape_caption.Rd | 1 + man/extract_figure_table_captions.Rd | 1 + man/find_and_delete_output.Rd | 1 + man/remove_fig_table_part.Rd | 1 + man/replace_text.Rd | 1 + man/save_updated_document.Rd | 1 + man/search_for_duplicates.Rd | 1 + man/table_styling.Rd | 1 + man/version_number.Rd | 1 + 34 files changed, 67 insertions(+), 85 deletions(-) delete mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 5c6ff43..0000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,69 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# From {cards} actions -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - - -name: Test coverage - -permissions: read-all - -jobs: - coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::covr, any::pkgdown, local::. - needs: coverage, check, website - - - name: Test coverage - run: | - cov <- covr::package_coverage( - quiet = FALSE, - clean = FALSE, - install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") - ) - covr::to_cobertura(cov) - shell: Rscript {0} - - - uses: codecov/codecov-action@v4 - with: - fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} - file: ./cobertura.xml - plugin: noop - disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package \ No newline at end of file diff --git a/R/ActivityTable.R b/R/ActivityTable.R index c4d304b..fe8b2c6 100644 --- a/R/ActivityTable.R +++ b/R/ActivityTable.R @@ -24,7 +24,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -#' @title Activity Table class definition +#' @title Class that defines the Activity Table in the Generic Report #' #' @description This R6 class relates to the activity table in the generic report #' that documents the person who perfomed the activity and the person who validated diff --git a/R/ChangelogTable.R b/R/ChangelogTable.R index d99946c..978baaa 100644 --- a/R/ChangelogTable.R +++ b/R/ChangelogTable.R @@ -24,7 +24,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -#' @title Changelog Table Row class definition +#' @title Class that defines the Changelog Table Row Table in the Generic Report #' #' @description This R6 class controls one row of the Changelog table that documents #' the date, version, reason and what changed in the update on the document. @@ -121,7 +121,7 @@ ChangelogTableRow <- R6::R6Class( ) ) -#' @title Changelog Table class definition +#' @title Class that defines the Changelog Table in the Generic Report #' #' @description This R6 class controls one row of the Changelog table that documents #' the date, version, reason and what changed in the update on the document. diff --git a/R/ReplaceOutputs.R b/R/ReplaceOutputs.R index e2cf2fd..e6c15e1 100644 --- a/R/ReplaceOutputs.R +++ b/R/ReplaceOutputs.R @@ -24,7 +24,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -#' @title Replace Outputs in a word document +#' @title Class that defines the Replace Outputs #' #' @description This R6 class allows to, given a template word document and a list #' of outputs, to add them at the given location in the text. It automates the diff --git a/R/SignaturesTable.R b/R/SignaturesTable.R index 66d2033..9ef8732 100644 --- a/R/SignaturesTable.R +++ b/R/SignaturesTable.R @@ -24,7 +24,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -#' @title Signatures Table Row class definition +#' @title Class that defines the Signatures Table Row in the Generic Report #' #' @description This R6 class controls one row of the Signatures table that documents #' the date, version, reason and what changed in the update on the document. @@ -95,7 +95,7 @@ SignaturesTableRow <- R6::R6Class( ) ) -#' @title Signatures Table class definition +#' @title Class that defines the Signatures Table in the Generic Report #' #' @description This R6 class controls one row of the Signatures table that documents #' the date, version, reason and what changed in the update on the document. diff --git a/R/TitlePage.R b/R/TitlePage.R index dfc4155..cd7bdf3 100644 --- a/R/TitlePage.R +++ b/R/TitlePage.R @@ -24,7 +24,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -#' @title Title page class definition +#' @title Class that defines the Title Page in the Generic Report #' #' @description This R6 class relates to the Title Page in a report that adds all #' the required fields of the Generic Report Title Page diff --git a/R/utils.R b/R/utils.R index 9499459..6c6e0ab 100644 --- a/R/utils.R +++ b/R/utils.R @@ -36,6 +36,8 @@ #' #' @import officer #' @importFrom magrittr `%>%` +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -68,6 +70,8 @@ replace_text <- function(doc, old_value, new_value) { #' @import checkmate #' @import officer #' @importFrom magrittr `%>%` +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -130,6 +134,8 @@ find_and_delete_output = function(template_docx, #' #' @import flextable #' @importFrom magrittr `%>%` +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -189,6 +195,8 @@ table_styling <- function(flex_table, #' character to ensure proper escaping. #' #' @return escaped caption +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -213,6 +221,8 @@ escape_caption <- function(caption) { #' @import utils #' @import stats #' @importFrom magrittr `%>%` +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -254,6 +264,8 @@ change_table <- function(template_doc, #' @import tools #' @import magick #' @importFrom magrittr `%>%` +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -298,6 +310,8 @@ change_figure <- function(template_doc, #' @param doc_final_path Location to save #' #' @import officer +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -316,6 +330,8 @@ save_updated_document <- function(document, #' @return formatted version "_v00", "_v02", _v13" #' #' @import checkmate +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -345,6 +361,8 @@ version_number <- function(version) { #' path could be and its associated source path text #' #' @import xml2 +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -404,6 +422,8 @@ cursor_reach_list <- function(x, keyword) { #' #' @param yaml_file List. Already read yaml file to be checked for duplicates #' @import dplyr +#' +#' @keywords internal #' search_for_duplicates = function(yaml_file) { @@ -456,6 +476,8 @@ search_for_duplicates = function(yaml_file) { #' #' @return List figure_table_captions_sources contaning the figure_table_captions #' and its corresponding sources paths +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -513,6 +535,7 @@ extract_figure_table_captions = function(doc_path) { #' #' @return updated caption without Figure or Table number #' +#' @keywords internal #' @examples #' \dontrun{ #' example_caption <- @@ -579,6 +602,8 @@ remove_fig_table_part = function(caption) { #' #' @import yaml #' @import stringr +#' +#' @keywords internal #' #' @examples #' \dontrun{ diff --git a/R/utils_checks.R b/R/utils_checks.R index 78567ca..5a767c4 100644 --- a/R/utils_checks.R +++ b/R/utils_checks.R @@ -31,6 +31,8 @@ #' @param date_format String. Expected date format. Default is dd-Mmm-yyyy. #' #' @return the original date str if matches conditions, FALSE if not +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -54,6 +56,8 @@ check_string_is_date <- function(date_str, date_format = "%d-%b-%Y") { #' #' @return the original date str if matches conditions, FALSE if not #' @import checkmate +#' +#' @keywords internal #' #' @examples #' \dontrun{ @@ -72,6 +76,8 @@ check_name <- function(name_str){ #' @param variable object to check #' #' @return the variable if matches conditions, error if not +#' +#' @keywords internal #' #' @examples #' \dontrun{ diff --git a/README.Rmd b/README.Rmd index fa02143..3df9ed9 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,6 +15,8 @@ knitr::opts_chunk$set( # rdocx +# rdocx rdocx website + [![R-CMD-check.yaml](https://github.com/Novartis/rdocx/actions/workflows/check_package.yml/badge.svg)](https://github.com/Novartis/rdocx/actions/workflows/check_package.yml) [![pkgdown](https://github.com/Novartis/rdocx/actions/workflows/pkgdown.yml/badge.svg)](https://github.com/Novartis/rdocx/actions/workflows/pkgdown.yml) diff --git a/README.md b/README.md index d906776..b2f657c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ # rdocx +# rdocx rdocx website + [![R-CMD-check](https://github.com/Novartis/rdocx/actions/workflows/check_package.yml/badge.svg)](https://github.com/Novartis/rdocx/actions/workflows/check_package.yml) [![pkgdown](https://github.com/Novartis/rdocx/actions/workflows/pkgdown.yml/badge.svg)](https://github.com/Novartis/rdocx/actions/workflows/pkgdown.yml) diff --git a/_pkgdown.yml b/_pkgdown.yml index f16b95f..df826cc 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,9 +1,8 @@ url: https://opensource.nibr.com/rdocx/ template: + bootstrap: 5 bootswatch: minty light-switch: true - theme: gruvbox-light - theme-dark: gruvbox-dark development: mode: auto @@ -22,6 +21,7 @@ reference: - SignaturesTableRow - TitlePage - rmd_render + - generic_report_template - title: Automated Reporting diff --git a/man/ActivityTable.Rd b/man/ActivityTable.Rd index 8d1426e..e6a5322 100644 --- a/man/ActivityTable.Rd +++ b/man/ActivityTable.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/ActivityTable.R \name{ActivityTable} \alias{ActivityTable} -\title{Activity Table class definition} +\title{Class that defines the Activity Table in the Generic Report} \description{ This R6 class relates to the activity table in the generic report that documents the person who perfomed the activity and the person who validated diff --git a/man/ChangelogTable.Rd b/man/ChangelogTable.Rd index 3d65668..41eded7 100644 --- a/man/ChangelogTable.Rd +++ b/man/ChangelogTable.Rd @@ -3,7 +3,7 @@ \docType{methods} \name{ChangelogTable} \alias{ChangelogTable} -\title{Changelog Table class definition} +\title{Class that defines the Changelog Table in the Generic Report} \description{ This R6 class controls one row of the Changelog table that documents the date, version, reason and what changed in the update on the document. diff --git a/man/ChangelogTableRow.Rd b/man/ChangelogTableRow.Rd index 4481b77..6a0c2c1 100644 --- a/man/ChangelogTableRow.Rd +++ b/man/ChangelogTableRow.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/ChangelogTable.R \name{ChangelogTableRow} \alias{ChangelogTableRow} -\title{Changelog Table Row class definition} +\title{Class that defines the Changelog Table Row Table in the Generic Report} \description{ This R6 class controls one row of the Changelog table that documents the date, version, reason and what changed in the update on the document. diff --git a/man/ReplaceOutputs.Rd b/man/ReplaceOutputs.Rd index 3a551fd..504d85f 100644 --- a/man/ReplaceOutputs.Rd +++ b/man/ReplaceOutputs.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/ReplaceOutputs.R \name{ReplaceOutputs} \alias{ReplaceOutputs} -\title{Replace Outputs in a word document} +\title{Class that defines the Replace Outputs} \description{ This R6 class allows to, given a template word document and a list of outputs, to add them at the given location in the text. It automates the diff --git a/man/SignaturesTable.Rd b/man/SignaturesTable.Rd index 2a311a3..67c336a 100644 --- a/man/SignaturesTable.Rd +++ b/man/SignaturesTable.Rd @@ -3,7 +3,7 @@ \docType{methods} \name{SignaturesTable} \alias{SignaturesTable} -\title{Signatures Table class definition} +\title{Class that defines the Signatures Table in the Generic Report} \description{ This R6 class controls one row of the Signatures table that documents the date, version, reason and what changed in the update on the document. diff --git a/man/SignaturesTableRow.Rd b/man/SignaturesTableRow.Rd index c05c73a..33f4dd6 100644 --- a/man/SignaturesTableRow.Rd +++ b/man/SignaturesTableRow.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/SignaturesTable.R \name{SignaturesTableRow} \alias{SignaturesTableRow} -\title{Signatures Table Row class definition} +\title{Class that defines the Signatures Table Row in the Generic Report} \description{ This R6 class controls one row of the Signatures table that documents the date, version, reason and what changed in the update on the document. diff --git a/man/TitlePage.Rd b/man/TitlePage.Rd index 47e7db4..14c6fff 100644 --- a/man/TitlePage.Rd +++ b/man/TitlePage.Rd @@ -3,7 +3,7 @@ \name{TitlePage} \alias{TitlePage} \alias{get_title_page} -\title{Title page class definition} +\title{Class that defines the Title Page in the Generic Report} \description{ This R6 class relates to the Title Page in a report that adds all the required fields of the Generic Report Title Page diff --git a/man/change_figure.Rd b/man/change_figure.Rd index 1fccfd3..1cb418c 100644 --- a/man/change_figure.Rd +++ b/man/change_figure.Rd @@ -24,3 +24,4 @@ Change figure in a docx change_figure(doc, "/path/to/output", "output.png") } } +\keyword{internal} diff --git a/man/change_table.Rd b/man/change_table.Rd index 3ba9bd8..cfd2141 100644 --- a/man/change_table.Rd +++ b/man/change_table.Rd @@ -26,3 +26,4 @@ Change table in a docx change_table(doc, "data.csv", widths = NA) } } +\keyword{internal} diff --git a/man/check_name.Rd b/man/check_name.Rd index 2b8fc9f..871552b 100644 --- a/man/check_name.Rd +++ b/man/check_name.Rd @@ -21,3 +21,4 @@ error to guide users check_name("Harry Styles") } } +\keyword{internal} diff --git a/man/check_null_or_flextable.Rd b/man/check_null_or_flextable.Rd index 581aa52..5ca3d5e 100644 --- a/man/check_null_or_flextable.Rd +++ b/man/check_null_or_flextable.Rd @@ -21,3 +21,4 @@ ft <- flextable::flextable(head(mtcars)) check_null_or_flextable(ft) } } +\keyword{internal} diff --git a/man/check_string_is_date.Rd b/man/check_string_is_date.Rd index 8dfd76e..6a44f09 100644 --- a/man/check_string_is_date.Rd +++ b/man/check_string_is_date.Rd @@ -22,3 +22,4 @@ Check to see if a string is a date format check_string_is_date("01-Oct-2023") } } +\keyword{internal} diff --git a/man/create_yml.Rd b/man/create_yml.Rd index b72cdbc..c0ada32 100644 --- a/man/create_yml.Rd +++ b/man/create_yml.Rd @@ -46,3 +46,4 @@ captions <- extract_figure_table_captions(system.file("use_cases/02_automated_re create_yml(captions, "./example_yml.docx") } } +\keyword{internal} diff --git a/man/cursor_reach_list.Rd b/man/cursor_reach_list.Rd index bb9d734..42e1d78 100644 --- a/man/cursor_reach_list.Rd +++ b/man/cursor_reach_list.Rd @@ -26,3 +26,4 @@ search, and also possible sources path underneath the placeholder figure/tables cursor_reach_list(doc, "example caption") } } +\keyword{internal} diff --git a/man/escape_caption.Rd b/man/escape_caption.Rd index 011b04d..a07c351 100644 --- a/man/escape_caption.Rd +++ b/man/escape_caption.Rd @@ -31,3 +31,4 @@ caption <- "This is a figure title (an a parenthesis use!)" escape_caption(caption) } } +\keyword{internal} diff --git a/man/extract_figure_table_captions.Rd b/man/extract_figure_table_captions.Rd index dbff597..96855f5 100644 --- a/man/extract_figure_table_captions.Rd +++ b/man/extract_figure_table_captions.Rd @@ -32,3 +32,4 @@ extract_figure_table_captions(system.file("use_cases/02_automated_reporting", package="rdocx")) } } +\keyword{internal} diff --git a/man/find_and_delete_output.Rd b/man/find_and_delete_output.Rd index 521c093..c923abf 100644 --- a/man/find_and_delete_output.Rd +++ b/man/find_and_delete_output.Rd @@ -32,3 +32,4 @@ find_and_delete_output(doc, 1) } } +\keyword{internal} diff --git a/man/remove_fig_table_part.Rd b/man/remove_fig_table_part.Rd index 019b6e7..ddbfc2a 100644 --- a/man/remove_fig_table_part.Rd +++ b/man/remove_fig_table_part.Rd @@ -26,3 +26,4 @@ updated_example_caption <- remove_fig_table_part(example_caption) expected_output <- "Summary of Sample Statistics" } } +\keyword{internal} diff --git a/man/replace_text.Rd b/man/replace_text.Rd index 7199d21..c7e342e 100644 --- a/man/replace_text.Rd +++ b/man/replace_text.Rd @@ -21,3 +21,4 @@ Search for a value in a document and replicate it with the new one replace_text("dummy_doc.docx", "title", "new title") } } +\keyword{internal} diff --git a/man/save_updated_document.Rd b/man/save_updated_document.Rd index 652d47c..d8127f4 100644 --- a/man/save_updated_document.Rd +++ b/man/save_updated_document.Rd @@ -19,3 +19,4 @@ Save updated document save_updated_document(doc, "./new_doc.docx") } } +\keyword{internal} diff --git a/man/search_for_duplicates.Rd b/man/search_for_duplicates.Rd index 366ab34..e95411f 100644 --- a/man/search_for_duplicates.Rd +++ b/man/search_for_duplicates.Rd @@ -13,3 +13,4 @@ search_for_duplicates(yaml_file) Look for duplicates in captions titles and raise a warning if the occurrence parameter is not defined. } +\keyword{internal} diff --git a/man/table_styling.Rd b/man/table_styling.Rd index a4d957d..c53d7dd 100644 --- a/man/table_styling.Rd +++ b/man/table_styling.Rd @@ -22,3 +22,4 @@ Add Generic Report Style to a flextable table_styling(table, widths = NA) } } +\keyword{internal} diff --git a/man/version_number.Rd b/man/version_number.Rd index f819eaa..58fd362 100644 --- a/man/version_number.Rd +++ b/man/version_number.Rd @@ -20,3 +20,4 @@ Version number version_number(5) } } +\keyword{internal}