Skip to content

Commit

Permalink
Add rdocx package
Browse files Browse the repository at this point in the history
  • Loading branch information
ines-gimeno-molina committed Nov 8, 2024
1 parent fc32321 commit 7da19db
Show file tree
Hide file tree
Showing 80 changed files with 5,840 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
^rdocx\.Rproj$
^\.Rproj\.user$
^README\.Rmd$
^LICENSE\.md$
.gitlab-ci.yml
_pkgdown.yml
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
52 changes: 52 additions & 0 deletions .github/workflows/check_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# 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
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
80 changes: 80 additions & 0 deletions .github/workflows/coverage_and_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# 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]
workflow_dispatch:

name: Test and build pages

permissions: read-all

jobs:
coverage_and_build:
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
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
58 changes: 58 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Package: rdocx
Title: rdocx
Description: The `rdocx` package streamlines clinical trial reporting
by enabling R-driven, end-to-end workflows that produce reports in
Microsoft Word format for interdisciplinary collaboration. Built with
an object-oriented design, `rdocx` provides classes for creating
structured report items (tables, figures, etc.) with a comprehensive
suite of tests for quality assurance. The package allows rendering
reports in a customizable Word template, promoting seamless
integration into GxP-compliant environments. Two main use cases are
supported, a generic RMarkdown report template for standardized
document creation, and an automated reporting tool for selective
updates to tables and figures in existing Word files.
Version: 1.0.0
Authors@R: c(
person("Janina", "Linnik", email = "[email protected]", role = c("aut", "cre")),
person("Orla", "Doyle", email = "[email protected]", role = c("aut")),
person("Ines", "Gimeno Molina", email = "[email protected]", role = c("aut")),
person("Jack", "Talboys", email = "[email protected]", role = c("ctb")))
Maintainer: Janina Linnik <[email protected]>, Orla Doyle <[email protected]>, Ines Gimeno Molina <[email protected]>
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Imports:
rmarkdown,
dplyr,
flextable,
knitr,
lgr,
officer,
R6,
checkmate,
jpeg,
magick,
magrittr,
png,
stats,
stringr,
tools,
utils,
xml2,
yaml,
cowplot,
ggplot2,
kableExtra,
testthat
VignetteBuilder: knitr
Collate:
'ActivityTable.R'
'ChangelogTable.R'
'ReplaceOutputs.R'
'SignaturesTable.R'
'TitlePage.R'
'rdocx_global.R'
'rmd_render.R'
'utils.R'
'utils_checks.R'
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License
# MIT License

Copyright (c) 2024 Novartis
Copyright (c) 2023-2024 Novartis, rdocx authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 22 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# MIT License

Copyright (c) 2023-2024 Novartis, rdocx authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

28 changes: 28 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by roxygen2: do not edit by hand

export(ActivityTable)
export(ChangelogTable)
export(ChangelogTableRow)
export(ReplaceOutputs)
export(SignaturesTable)
export(SignaturesTableRow)
export(TitlePage)
export(generic_report_template)
export(rmd_render)
import(R6)
import(checkmate)
import(dplyr)
import(flextable)
import(jpeg)
import(lgr)
import(magick)
import(officer)
import(png)
import(rmarkdown)
import(stats)
import(stringr)
import(tools)
import(utils)
import(xml2)
import(yaml)
importFrom(magrittr,`%>%`)
Loading

0 comments on commit 7da19db

Please sign in to comment.