From 7c542e420cb3e303fb8aae085267c0d7ccf9f2ff Mon Sep 17 00:00:00 2001 From: Gregor Sturm Date: Mon, 20 Jan 2025 11:48:51 +0100 Subject: [PATCH] Docs website with pkgdown (#28) * Setup pkgdown * pre-commit autofixes * Split function reference * pre-commit autofixes * trigger-ci * Update pkgdown.yaml --- .Rbuildignore | 3 ++ .github/.gitignore | 1 + .github/workflows/pkgdown.yaml | 52 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + .pre-commit-config.yaml | 2 +- DESCRIPTION | 12 ++++---- _pkgdown.yml | 36 +++++++++++++++++++++++ 7 files changed, 100 insertions(+), 7 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/pkgdown.yaml create mode 100644 .gitignore create mode 100644 _pkgdown.yml diff --git a/.Rbuildignore b/.Rbuildignore index 0f3723a..4e42195 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -4,3 +4,6 @@ ^\.github$ ^CHANGELOG\.md$ ^LICENSE\.md$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..9607fd6 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,52 @@ +name: "Build docs using pkgdown" +on: + push: + branches: + - main + pull_request: + # also run on 'closed' to clean up the github pages dir + types: + - opened + - reopened + - synchronize + - closed + +concurrency: preview-${{ github.ref }} + +jobs: + docs: + name: "Build Docs" + runs-on: ubuntu-20.04 + + 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::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy preview + if: github.event_name == 'pull_request' + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: docs + + - name: Deploy docs + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: docs + branch: gh-pages + clean-exclude: pr-preview/ + force: false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8f8d46 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 17c8897..b6aafdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: args: [--allow_private_imports] - id: roxygenize # workaround https://github.com/lorenzwalthert/precommit/issues/609 - additional_dependencies: ["rstudioapi"] + additional_dependencies: ["rstudioapi", "rlang", "methods", "stringr", "here", "glue", "yaml"] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/DESCRIPTION b/DESCRIPTION index e79ca50..09a5835 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,12 +2,12 @@ Package: dso Type: Package Title: dso R companion package Version: 0.7 -Author: Daniel Schreyer, - Gregor Sturm, - Thomas Schwarzl -Maintainer: Daniel Schreyer, - Gregor Sturm, - Thomas Schwarzl +Authors@R: c( + person("Daniel", "Schreyer", email = "daniel.schreyer.ext@boehringer-ingelheim.com", role = c("aut", "cre")), + person("Gregor", "Sturm", email = "gregor.sturm@boehringer-ingelheim.com", role = "aut"), + person("Thomas", "Schwarzl", email = "thomas.schwarzl@boehringer-ingelheim.com", role = "aut"), + person("Alexander", "Peltzer", email = "alexander.peltzer@boehringer-ingelheim.com", role = "aut") + ) Description: Collection of functions used with the DevOps dso application. License: LGPL (>= 3) Encoding: UTF-8 diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..24ffa6a --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,36 @@ +url: ~ +template: + bootstrap: 5 +reference: + - title: Work with DSO stages + desc: Functions to load stage params and manipulate paths + contents: + - read_params + - set_stage + - stage_here + - reload + + - title: dsoParams class reference + desc: Reference of the dsoParams class produced by read_params + contents: + - dsoParams + - as.list,dsoParams-method + - $.dsoParams + - dsoParams-class + - print.dsoParams + - show,dsoParams-method + - "[[.dsoParams" + + - title: R interface to DSO CLI + desc: wrapper around the DSO command line interface + contents: + - create_stage + - compile_config + - init + - repro + + - title: Rstudio addin + desc: functions related to the DSO rstudio addin + contents: + - dso_repro_stage_addin + - dso_repro_stage_w_dependencies_addin