generated from jhudsl/OTTR_Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit e0a5a76
Showing
61 changed files
with
3,745 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
# This code was originally written by Josh Shapiro and Candace Savonen | ||
# for the Childhood Cancer Data Lab, an initiative of Alexs Lemonade Stand Foundation. | ||
# https://github.com/AlexsLemonade/refinebio-examples/blob/33cdeff66d57f9fe8ee4fcb5156aea4ac2dce07f/.github/workflows/style-and-sp-check.yml#L1 | ||
|
||
# Adapted for this jhudsl repository by Candace Savonen Apr 2021 | ||
|
||
name: Style and spell check R markdowns | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the main branch | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "style and check" | ||
style-n-check: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: rocker/tidyverse:4.0.2 | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# What branch to commit to: the one from the pull request | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Install packages | ||
run: Rscript -e "install.packages(c('styler', 'spelling'))" | ||
|
||
- name: Run spell check | ||
id: spell_check_run | ||
run: | | ||
results=$(Rscript "scripts/spell-check.R") | ||
echo "::set-output name=sp_chk_results::$results" | ||
cat spell_check_results.tsv | ||
- name: Archive spelling errors | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: spell-check-results | ||
path: spell_check_results.tsv | ||
|
||
# If there are too many spelling errors, this will stop the workflow | ||
- name: Check spell check results - fail if too many errors | ||
if: ${{ steps.spell_check_run.outputs.sp_chk_results > 3 }} | ||
run: exit 1 | ||
|
||
- name: Run styler | ||
run: Rscript -e "styler::style_file(list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE));warnings()" | ||
|
||
- name: Commit | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git add \*.Rmd | ||
git commit -m 'Style Rmds' || echo "No changes to commit" | ||
git push origin || echo "No changes to commit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Adapted from https://github.com/marketplace/actions/url-checker by Candace Savonen | ||
|
||
# This github actions tests URLs in the Rmd files, README, and CONTRIBUTING.md | ||
name: Check URLs | ||
|
||
# This will be run upon PRs to main | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# Here's the main action of checking URLs | ||
jobs: | ||
check_urls: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
# What branch to commit to: the one from the pull request | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Get Rmd file names | ||
id: get_rmds | ||
run: | | ||
rmd_files=$(find . -type f -name '*.Rmd' -exec basename {} \;) | ||
rmd_files=$(echo "$rmd_files" | xargs | sed -e 's/ /,/g') | ||
file_list="CONTRIBUTING.md,README.md,${rmd_files[@]}" | ||
echo "::set-output name=all_files::$file_list" | ||
echo $file_list | ||
- name: Check URLs | ||
uses: paramt/url-checker@master | ||
with: | ||
files: "${{ steps.get_rmds.outputs.all_files }}" | ||
blacklist: "${{ steps.get_rmds.outputs.all_files }},01-intro.md,about.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
# ignore nonsense files | ||
.DS_Store | ||
.Rhistory | ||
.local | ||
.rstudio | ||
.bash_history | ||
|
||
spell_check_results.tsv | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: "Course Title" | ||
output: html_document | ||
--- | ||
|
||
# Introduction | ||
|
||
## Motivation | ||
This course will cover | ||
|
||
**Target Audience:** | ||
The course is intended for | ||
|
||
**Curriculum:** | ||
The curriculum will cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
title: "Chapter title" | ||
output: html_document | ||
--- | ||
|
||
## Learning Objectives | ||
|
||
This chapter will cover: | ||
|
||
- {You can use https://www.bu.edu/cme/forms/RSS_forms/tips_for_writing_objectives.pdf to define some learning objectives here} | ||
- {Another learning objective} | ||
|
||
## Libraries | ||
|
||
For this chapter, we'll need the following packages attached. | ||
|
||
```{r} | ||
library(here) | ||
library(ggplot2) | ||
library(magrittr) | ||
``` | ||
|
||
# Topic of Section | ||
|
||
Text Text | ||
|
||
## Subtopic | ||
|
||
Text Text | ||
|
||
### Code examples | ||
|
||
```{r} | ||
output_dir <- "code_output" | ||
if (!dir.exists(output_dir)) { | ||
dir.create(output_dir) | ||
} | ||
``` | ||
|
||
```{r} | ||
iris %>% | ||
ggplot(aes(Sepal.Length, Sepal.Width, color = Species)) + | ||
geom_point() + | ||
theme_bw() | ||
``` | ||
|
||
```{r} | ||
ggsave(file.path(output_dir, "test_ggplot2.png")) | ||
``` | ||
|
||
### Image examples | ||
|
||
 | ||
|
||
 | ||
|
||
### Video example | ||
|
||
 | ||
|
||
### Citation examples | ||
|
||
We can put citations at the end of a sentence like this [@bookdown2016]. | ||
|
||
In text, we can put citations like this @bookdown2016. | ||
|
||
## Print out session info | ||
|
||
```{r} | ||
devtools::session_info() | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
title: "about" | ||
output: html_document | ||
--- | ||
|
||
# About the Authors {-} | ||
|
||
|
||
**Author Name** is a Blank in the Blank at the Blank. | ||
|
Oops, something went wrong.