Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/check_post_tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ on:
jobs:
Check-post-tags:
runs-on: ubuntu-latest
container:
image: "rocker/tidyverse:4.2.1"
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::rmarkdown
any::cli
- name: Run check_post_tags
run: source("R/check_post_tags.R")
shell: Rscript {0}
10 changes: 4 additions & 6 deletions .github/workflows/link_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up R # Install R from CRAN
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.3' # You can specify a different R version if needed

- name: Install R packages
run: |
Rscript -e 'install.packages("fs")'
shell: bash
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: any::fs

- name: Switch .qmd to .md
run: Rscript R/switch.R
Expand Down
27 changes: 5 additions & 22 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,20 @@ jobs:
build-preview:
name: Build & Deploy PR Preview
runs-on: ubuntu-latest
container:
image: "ghcr.io/pharmaverse/docker_pharmaverse:4.5.1"
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Configure Git safe directory
run: git config --global --add safe.directory /__w/blog/blog

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.9.12

- name: Install R Packages
run: |
R -e "install.packages(c(
'admiral',
'diffdf',
'patchwork',
'here',
'filters',
'janitor',
'link',
'sessioninfo',
'renv',
'riskmetric',
'sdtm.oak',
'mirai',
'dverse',
'autoslider.core'))"
- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Setup R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2

- name: Install tinytex
run: quarto install tool tinytex
Expand Down
30 changes: 5 additions & 25 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,26 @@ on:
jobs:
build-deploy:
runs-on: ubuntu-latest
container:
image: "ghcr.io/pharmaverse/docker_pharmaverse:4.5.1"
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Configure Git safe directory
run: git config --global --add safe.directory /__w/blog/blog

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.9.12

- name: Install R Packages
run: |
R -e "install.packages(c(
'admiral',
'diffdf',
'patchwork',
'here',
'filters',
'janitor',
'link',
'sessioninfo',
'renv',
'riskmetric',
'sdtm.oak',
'mirai',
'dverse',
'autoslider.core'))"
- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Setup R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2

- name: Install tinytex
run: quarto install tool tinytex

- name: Mark repo directory as safe
run: git config --global --add safe.directory /__w/blog/blog

- name: Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ on:
jobs:
Spelling:
runs-on: ubuntu-latest
container:
image: "rocker/tidyverse:4.3.1"
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Install packages
run: |
if (!require("roxygen2")) install.packages("roxygen2")
if (!require("spelling")) install.packages("spelling")
if (!require("testthat")) install.packages("testthat")
shell: Rscript {0}
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::spelling
any::testthat
any::readr

- name: Remove links from .qmd files (Bash)
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/style_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ on:
jobs:
Style:
runs-on: ubuntu-latest
container: {image: "rocker/tidyverse:4.2.1"}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
- name: Install styler
run: install.packages("styler")
shell: Rscript {0}
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: any::styler
- name: styler version
run: packageVersion("styler")
shell: Rscript {0}
Expand Down
70 changes: 70 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
Package: pharmaverse.blog
Type: Book
Title: Pharmaverse Blog
Version: 0.1
Authors@R:
person("pharmaverse", "Blog Team", role = c("aut", "cre"))
Description: This is not a package, but we use this file to declare
the dependencies of the blog site.
URL: https://github.com/pharmaverse/blog
Imports:
admiral,
admiraldev,
admiralmetabolic,
admiralneuro,
admiralonco,
admiralophtha,
admiralpeds,
admiralvaccine,
autoslider.core,
dataviewR,
diffdf,
dplyr,
dverse,
DT,
filters,
forcats,
haven,
here,
janitor,
jsonlite,
knitr,
link,
lubridate,
logrx,
magrittr,
metacore,
metatools,
mirai,
nestcolor,
patchwork,
pharmaverseadam,
pharmaverseraw,
pharmaversesdtm,
reactable,
readr,
readxl,
riskmetric,
rlistings,
rtables,
sdtm.oak,
sessioninfo,
sparkline,
spelling,
stringr,
teal,
teal.data,
teal.modules.clinical,
teal.modules.general,
tern,
tibble,
tidyverse,
xportr,
yaml
Suggests:
rmarkdown,
roxygen2,
styler,
testthat
Encoding: UTF-8
Language: en-US
4 changes: 4 additions & 0 deletions R/create_blogpost.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# You can easily create a new blog post skeleton using the create_post() function.
# First, we load the helping function and the allowed post tags:

# If you have not already installed the blog's dependencies, you can do so using pak:
# install.packages("pak")
# pak::pak() # installs all packages listed in the DESCRIPTION file

source("R/help_create_blogpost.R")
source("R/allowed_tags.R")

Expand Down
53 changes: 11 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,49 +86,18 @@ Most importantly:

## Tips and Tricks

* You can use this code snippet to install all packages needed for the blog site or use the docker image cited below.
```
install.packages(
c(
"jsonlite",
"tidyverse",
"spelling",
"janitor",
"diffdf",
"admiral",
"patchwork",
"here",
"reactable",
"pharmaversesdtm",
"metacore",
"metatools",
"xportr",
"pharmaverseadam",
"link",
"sessioninfo",
"rtables",
"teal",
"riskmetric",
"tidyCDISC",
"mirai",
"dverse",
"DT",
"xportr",
"sdtm.oak",
"teal",
"riskmetric",
"tidyCDISC",
"admiralonco",
"admiralophtha",
"admiralpeds",
"admiralvaccine",
"admiralmetabolic",
"autoslider.core",
"filters"
"logrx"
)
)
* All packages needed for the blog site are declared in the [`DESCRIPTION`](DESCRIPTION) file at the root of the repository. You can install them all at once using `pak` (recommended for speed, as it uses binary packages and caching):

```r
# Install pak if you don't have it
install.packages("pak")

# Install all blog dependencies from the DESCRIPTION file
pak::pak()
```

Alternatively, you can use the Docker image described below.

## How to Use the `blog` Docker Image for Local Development

Contributors can benefit from using the [`blog` Docker image](https://github.com/pharmaverse/blog/pkgs/container/blog) when creating their blog posts.
Expand Down
Loading