Skip to content

Commit

Permalink
Merge branch 'main' into 189_update_falcon
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanThoma authored Oct 24, 2024
2 parents 42a4134 + 794d4c2 commit 0d2ca40
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ jobs:
riskmetric
tidyCDISC
mirai
sdtm.oak
- name: Install tinytex
run: quarto install tool tinytex
Expand Down
48 changes: 48 additions & 0 deletions inst/WORDLIST.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1160,3 +1160,51 @@ mypackage
parmsam
shinyl
zzz
BEFORE’
CDASH
CMSTRTPT
CMTRT
CRF
DM
eCRF
EDC
eDT
FLUIDS’
hardcode
hardcoded
MDPRIOR
MHOCCUR
MHPRESP
MHTERM
NonCRF
oak
Pressure
RELREC
Roadmap
SV
TEMP
VSMETHOD
VSPOS
VSTEST
VSLAT
tgt
Y
oakgarden
stringsAsFactors
Rammprasad
mmHg
MDRAW
kable
Ganapathy
FASCAT
DOSU
dat
CORTISPORIN
CMSTTPT
CMMODIFY
CMDOSU
CMDOSE
clst
br
Varialble
sdtmoak
73 changes: 73 additions & 0 deletions posts/2024-10-24_introducing.../appendix.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
suppressMessages(library(dplyr))
# markdown helpers --------------------------------------------------------

markdown_appendix <- function(name, content) {
paste(paste("##", name, "{.appendix}"), " ", content, sep = "\n")
}
markdown_link <- function(text, path) {
paste0("[", text, "](", path, ")")
}



# worker functions --------------------------------------------------------

insert_source <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "Source",
file_name) {
path <- paste(
host,
repo_spec,
"tree",
branch,
collection,
name,
file_name,
sep = "/"
)
return(markdown_link(text, path))
}

insert_timestamp <- function(tzone = Sys.timezone()) {
time <- lubridate::now(tzone = tzone)
stamp <- as.character(time, tz = tzone, usetz = TRUE)
return(stamp)
}

insert_lockfile <- function(repo_spec, name,
collection = "posts",
branch = "main",
host = "https://github.com",
text = "Session info") {
path <- path <- "https://pharmaverse.github.io/blog/session_info.html"

return(markdown_link(text, path))
}



# top level function ------------------------------------------------------

insert_appendix <- function(repo_spec, name, collection = "posts", file_name) {
appendices <- paste(
markdown_appendix(
name = "Last updated",
content = insert_timestamp()
),
" ",
markdown_appendix(
name = "Details",
content = paste(
insert_source(repo_spec, name, collection, file_name = file_name),
# get renv information,
insert_lockfile(repo_spec, name, collection),
sep = ", "
)
),
sep = "\n"
)
knitr::asis_output(appendices)
}
Loading

0 comments on commit 0d2ca40

Please sign in to comment.