diff --git a/.github/workflows/check-url.yml b/.github/workflows/check-url.yml new file mode 100644 index 0000000..a437049 --- /dev/null +++ b/.github/workflows/check-url.yml @@ -0,0 +1,107 @@ +name: Periodic URL Check + +on: + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' + +jobs: + set-up: + name: Load user automation choices + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Use the yaml-env-action action. + - name: Load environment from YAML + uses: doughepi/yaml-env-action@v1.0.0 + with: + files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence. + outputs: + toggle_url_check_periodically: "${{ env.URL_CHECK_PERIODICALLY }}" + + url-check: + name: Check URLs + needs: set-up + if: ${{needs.set-up.outputs.toggle_url_check_periodically == 'yes'}} + runs-on: ubuntu-latest + container: + image: jhudsl/base_ottr:main + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Delete the branch if this has been run before + - name: Delete branch locally and remotely + run: git push origin --delete preview-spell-error || echo "No branch to delete" + + # Make the branch fresh + - name: Make the branch fresh + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + echo branch doesnt exist + git checkout -b preview-spell-error || echo branch exists + git push --set-upstream origin preview-spell-error || echo echo branch exists remotely + shell: bash + + - name: Run the check + uses: jhudsl/ottr-reports@main + id: check_results + continue-on-error: true + with: + check_type: urls + error_min: 1 + + - name: Declare file path and time + id: check-report + run: | + error_num=$(cat check_reports/url_checks.tsv | wc -l) + error_num="$((error_num-1))" + echo "error_num=$error_num" >> $GITHUB_OUTPUT + echo "error_url=https://github.com/${GITHUB_REPOSITORY}/blob/preview-spell-error/check_reports/url_checks.tsv" >> $GITHUB_OUTPUT + shell: bash + + - name: Stop if failure + if: steps.check_results.outcome == 'failure' + run: exit 1 + + - name: Print out error variables + run: | + echo ${{ steps.check-report.outputs.error_url }} + echo ${{ steps.check-report.outputs.error_num }} + + - name: Find issues + id: find-issue + env: + GH_PAT: ${{ secrets.GH_PAT }} + run: | + echo "$GITHUB_REPOSITORY" + curl -o find_issue.R https://raw.githubusercontent.com/jhudsl/ottr-reports/main/scripts/find_issue.R + issue_exists=$(Rscript --vanilla find_issue.R --repo $GITHUB_REPOSITORY --git_pat $GH_PAT) + echo URL issue exists: $issue_exists + echo "issue_existence=$issue_exists" >> $GITHUB_OUTPUT + + - name: If too many URL errors, then make an issue + if: ${{ steps.check-report.outputs.error_num >= 1 && steps.find-issue.outputs.issue_existence == 0}} + uses: JasonEtco/create-an-issue@v2 + with: + filename: .github/ISSUE_TEMPLATE/url-error.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FILE_URL: ${{ steps.check-report.outputs.error_url }} + ERROR_NUM: ${{ steps.check-report.outputs.error_num }} + + - name: If no URL errors than delete the branch we made + if: ${{ steps.check-report.outputs.error_num < 1 }} + run: | + git config --system --add safe.directory "$GITHUB_WORKSPACE" + git push origin --delete preview-spell-error || echo "No branch to delete" diff --git a/.github/workflows/delete-preview.yml b/.github/workflows/delete-preview.yml index afd658a..faa83cc 100644 --- a/.github/workflows/delete-preview.yml +++ b/.github/workflows/delete-preview.yml @@ -18,7 +18,7 @@ jobs: # Check out current repository - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index 77491cb..0000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,79 +0,0 @@ -# Candace Savonen Apr 2021 - -name: Build Docker - -on: - workflow_dispatch: - inputs: - dockerhubpush: - description: 'Push to Dockerhub?' - required: true - default: 'false' - tag: - description: 'What tag to use?' - required: true - default: 'none' -jobs: - build-docker: - name: Build Docker image - runs-on: ubuntu-latest - - steps: - - name: checkout repo - uses: actions/checkout@v3 - - - name: Login as jhudsl-robot - run: | - git config --system --add safe.directory "$GITHUB_WORKSPACE" - git config --local user.email "itcrtrainingnetwork@gmail.com" - git config --local user.name "jhudsl-robot" - - - name: Don't re-test if this is a sync branch - run: | - echo This was tested on OTTR_Template no need to re-run - - # Set up Docker build - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - # Setup layer cache - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - # Set up Docker build - - name: Set up Docker Build - if: ${{ github.head_ref != 'repo-sync/OTTR_Template/default' }} - uses: docker/setup-buildx-action@v1 - - - name: Get token - run: echo ${{ secrets.GH_PAT }} > docker/git_token.txt - - # Build docker image - - name: Build Docker image - uses: docker/build-push-action@v2 - with: - push: false - load: true - context: docker - file: docker/Dockerfile - tags: jhudsl/base_ottr - - # Login to Dockerhub - - name: Login to DockerHub - if: ${{ github.event.inputs.dockerhubpush != 'false' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # Push the Docker image if set to true from a manual trigger - - name: Push Docker image if manual trigger set to true - if: ${{ github.event.inputs.dockerhubpush != 'false' }} - run: | - docker tag jhudsl/base_ottr:latest jhudsl/base_ottr:$github.event.inputs.tag - docker push jhudsl/base_ottr:$github.event.inputs.tag diff --git a/.github/workflows/docker-test.yml b/.github/workflows/docker-test.yml deleted file mode 100644 index e1eab59..0000000 --- a/.github/workflows/docker-test.yml +++ /dev/null @@ -1,91 +0,0 @@ - -# Candace Savonen Apr 2022 - -name: Build Docker Image - -on: - workflow_dispatch: - inputs: - directory: - required: true - type: string - tag: - required: true - type: string - dockerhubpush: - description: 'Push to Dockerhub?' - required: false - default: 'false' - type: string - secrets: - GH_PAT: - required: true - DOCKERHUB_USERNAME: - required: false - DOCKERHUB_TOKEN: - required: false - -jobs: - - build-docker: - name: Build Docker image - runs-on: ubuntu-latest - - steps: - - name: checkout repo - uses: actions/checkout@v3 - - - name: Verify Dockerfiles changed? - uses: tj-actions/verify-changed-files@v8.8 - id: verify-changed-files - with: - files: | - ${{ inputs.directory }}/Dockerfile - ${{ inputs.directory }}/github_package_list.tsv - - - name: Login as jhudsl-robot - run: | - git config --system --add safe.directory "$GITHUB_WORKSPACE" - git config --local user.email "itcrtrainingnetwork@gmail.com" - git config --local user.name "jhudsl-robot" - - # Set up Docker build - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - # Setup layer cache - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Set up Docker Build - uses: docker/setup-buildx-action@v1 - - - name: Get token - run: echo ${{ secrets.GH_PAT }} > ${{ inputs.directory }}/git_token.txt - - - name: Build Docker image - uses: docker/build-push-action@v2 - with: - push: false - load: true - context: ${{ inputs.directory }} - file: ${{ inputs.directory }}/Dockerfile - tags: ${{ inputs.tag }} - - # Login to Dockerhub - - name: Login to DockerHub - if: ${{ inputs.dockerhubpush != 'false' }} - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # Push the Docker image if set to true from a manual trigger - - name: Push Docker image if manual trigger set to true - if: ${{ inputs.dockerhubpush != 'false' }} - run: docker push ${{ inputs.tag }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 2e122ba..d4d2515 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -139,11 +139,31 @@ jobs: git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} --allow-unrelated-histories shell: bash + # Make sure the link for AnVIL feedback is prepopulated for the specific course + - name: Set up feedback link + id: feedback + run: bash scripts/AnVIL_Feedback_Script.sh + # Run bookdown rendering - name: Run bookdown render id: bookdown run: Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')" + # Render a student guide if specified. This is a bit clunky because + # Bookdown does not work well if the files aren't named as such in the + # root directory + - name: Run student guide render + if: ${{needs.yaml-check.outputs.render_student_guide == 'yes'}} + id: student_guide + run: | + mkdir tmp1 + mv _bookdown.yml _output.yml tmp1 + mv student-guide/_bookdown.yml student-guide/_output.yml . + Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')" + mv _bookdown.yml _output.yml student-guide + mv tmp1/_bookdown.yml tmp1/_output.yml . + rm -r tmp1 + # Run TOC-less version # Rendered content for Leanpub and Coursera is very similar. # This job creates a shared scaffold for both. @@ -187,15 +207,14 @@ jobs: - name: Build components of the comment id: build-components run: | - course_name=$(head -n 1 _bookdown.yml | cut -d'"' -f 2| tr " " "-") + course_name=$(head -n 1 student-guide/_bookdown.yml | cut -d'"' -f 2| tr " " "-") bookdown_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/index.html") tocless_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/no_toc/index.html") - docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/docs/$course_name.docx") - zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip") + student_docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/student-guide/$course_name.docx") zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/website-preview.zip") echo "zip_link=$zip_link" >> $GITHUB_OUTPUT echo "bookdown_link=$bookdown_link" >> $GITHUB_OUTPUT echo "tocless_link=$tocless_link" >> $GITHUB_OUTPUT - echo "docx_link=$docx_link" >> $GITHUB_OUTPUT + echo "student_docx_link=$student_docx_link" >> $GITHUB_OUTPUT echo "time=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT echo "commit_id=$GITHUB_SHA" >> $GITHUB_OUTPUT echo ${{steps.commit.outputs.changes}} diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index 3de168a..8bb8ecb 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -10,6 +10,7 @@ on: paths: - '**.Rmd' - assets/* + - quizzes/* jobs: @@ -57,7 +58,7 @@ jobs: # We want a fresh run of the renders each time - name: Delete old docs/* run: rm -rf docs/* - + # Make sure the link for AnVIL feedback is prepopulated for the specific course - name: Set up feedback link id: feedback @@ -102,7 +103,7 @@ jobs: git fetch origin git add --force docs/* git commit -m 'Render bookdown' || echo "No changes to commit" - git pull --rebase --allow-unrelated-histories --strategy-option=ours + git pull --allow-unrelated-histories --strategy-option=ours git push -u origin main || echo "No changes to push" render-tocless: @@ -141,7 +142,7 @@ jobs: git fetch origin git add --force docs/no_toc* git commit -m 'Render toc-less' || echo "No changes to commit" - git pull --rebase --allow-unrelated-histories --strategy-option=ours + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours git push -u origin main || echo "No changes to push" render-leanpub: @@ -188,7 +189,7 @@ jobs: git fetch origin git add . git commit -m 'Delete manuscript folder' || echo "No changes to commit" - git pull --rebase --allow-unrelated-histories --strategy-option=ours + git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours git push -u origin main || echo "No changes to push" - name: Run ottrpal::bookdown_to_embed_leanpub @@ -218,7 +219,7 @@ jobs: git add --force resources/* git add --force docs/* git commit -m 'Render Leanpub' || echo "No changes to commit" - git pull --rebase --allow-unrelated-histories --strategy-option=ours + git pull --allow-unrelated-histories --strategy-option=ours git push --force --set-upstream origin main || echo "No changes to push" render-coursera: diff --git a/.github/workflows/transfer-rendered-files.yml b/.github/workflows/transfer-rendered-files.yml index 3c3577e..dae4141 100644 --- a/.github/workflows/transfer-rendered-files.yml +++ b/.github/workflows/transfer-rendered-files.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Use the yaml-env-action action. - name: Load environment from YAML @@ -42,21 +42,23 @@ jobs: if: ${{needs.yaml-check.outputs.toggle_coursera == 'yes' || needs.yaml-check.outputs.toggle_leanpub == 'yes'}} steps: + - name: Checkout from Bookdown Repo + uses: actions/checkout@v4 + with: + path: bookdown + token: ${{ secrets.GH_PAT }} + - name: Run git repo check id: git_repo_check env: GH_PAT: ${{ secrets.GH_PAT }} run: | - sudo apt-get install subversion - # What's the Quizzes repository's name? QUIZ_REPO=$(echo ${GITHUB_REPOSITORY} | sed "s/_Bookdown/ /g" | sed "s/_Template/ /g" | awk '{print $1"_Quizzes"}') echo $QUIZ_REPO - # Get repo check script - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/scripts/git_repo_check.R git_repo_check.R - # Run repo check script + curl -o git_repo_check.R https://raw.githubusercontent.com/jhudsl/ottr-reports/main/scripts/git_repo_check.R results=$(Rscript --vanilla git_repo_check.R --repo "$GITHUB_REPOSITORY" --git_pat "$GH_PAT") echo $QUIZ_REPO exists: $results @@ -65,8 +67,9 @@ jobs: - name: Checkout code from Leanpub repo if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: + path: quizzes repository: ${{ steps.git_repo_check.outputs.leanpub_repo }} token: ${{ secrets.GH_PAT }} @@ -76,17 +79,19 @@ jobs: env: GH_PAT: ${{ secrets.GH_PAT }} run: | - # Copy over images folder - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/resources/chapt_screen_images resources/chapt_screen_images + # Copy over images folder (from bookdown to quizzes repo) + mkdir -p quizzes/resources/chapt_screen_images + cp bookdown/resources/chapt_screen_images/* quizzes/resources/chapt_screen_images - # Copy over _bookdown.yml - svn export --force https://github.com/${GITHUB_REPOSITORY}.git/branches/${GITHUB_REF#refs/heads/}/_bookdown.yml _bookdown.yml + # Copy over _bookdown.yml (from bookdown to quizzes repo) + cp bookdown/_bookdown.yml quizzes/_bookdown.yml - name: Create PR with resources files if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }} uses: peter-evans/create-pull-request@v3 id: cpr with: + path: quizzes # Must create the PR in the Quizzes Repo token: ${{ secrets.GH_PAT }} commit-message: Copy files from Bookdown repository signoff: false diff --git a/_output.yml b/_output.yml index 7d6b017..4156fd7 100644 --- a/_output.yml +++ b/_output.yml @@ -1,16 +1,15 @@ bookdown::gitbook: # When using multiple css files, the default file path will be the first one # - css: [assets/style.css, assets/AnVIL_style/anvil.css] + css: [assets/style.css, assets/GDSCN_style/gdscn.css] includes: - in_header: GA_Script.html - before_body: assets/AnVIL_style/big-image_anvil.html - after_body: assets/AnVIL_style/footer.html + before_body: assets/GDSCN_style/big-image_gdscn.html + after_body: assets/GDSCN_style/footer.html highlight: tango config: toc: collapse: section before: | - + after: |

This content was published with bookdown by:

The Fred Hutch Data Science Lab

diff --git a/assets/style.css b/assets/style.css index 1648b46..748acad 100755 --- a/assets/style.css +++ b/assets/style.css @@ -313,7 +313,6 @@ div.wip{ background-image: url("../assets/box_images/under_construction.png"); } - /* .book .book-body .page-wrapper .page-inner section.normal is needed to override the styles produced by gitbook, which are ridiculously overspecified. Goal of the selectors is to ensure internal "margins" diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 1c0c6e0..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -FROM rocker/tidyverse:4.0.2 -LABEL maintainer="cansav09@gmail.com" -WORKDIR /rocker-build/ - -COPY install_github.R . - -# Install apt-getable packages to start -RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog -RUN apt-get install -y --no-install-recommends \ - libxt6 \ - libpoppler-cpp-dev \ - vim \ - libglpk40 \ - curl \ - gpg - -# Install gh -RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg; -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null; -RUN apt update && apt install -y gh; - -# Remove old symlinks to old pandoc -RUN unlink /usr/lib/rstudio-server/bin/pandoc/pandoc - -# Uninstall old version of pandoc -RUN sudo apt-get purge pandoc pandoc-citeproc pandoc-data \ - && sudo apt-get autoremove --purge - -# Install pandoc -RUN wget https://github.com/jgm/pandoc/releases/download/2.14.1/pandoc-2.14.1-1-amd64.deb \ - && sudo apt-get install ./pandoc-2.14.1-1-amd64.deb - -# Create new symlinks -RUN ln -s /usr/bin/pandoc /usr/lib/rstudio-server/bin/pandoc/pandoc - -# Add curl, bzip2 -RUN apt-get update -qq && apt-get -y --no-install-recommends install \ - bzip2 \ - curl - -# Install pip3 and installation tools -RUN apt-get -y --no-install-recommends install \ - python3-pip python3-dev - -# Commonly used R packages -RUN Rscript -e "options(warn = 2);install.packages( \ - c('bookdown', \ - 'here', \ - 'leanpubr', \ - 'optparse', \ - 'oro.nifti', \ - 'qpdf', \ - 'R.utils', \ - 'rprojroot', \ - 'rgoogleslides', \ - 'servr', \ - 'spelling', \ - 'styler', \ - 'reticulate'), \ - repos = 'https://cloud.r-project.org/')" - -# cow needs this dependency: -RUN Rscript -e "devtools::install_version('gitcreds', version = '0.1.1', repos = 'http://cran.us.r-project.org')" - -# Didactr needs this dependency: -RUN Rscript -e "devtools::install_version('lifecycle', version = '1.0.0', repos = 'http://cran.us.r-project.org')" - -# Copy over git token and package list -COPY git_token.txt . -COPY github_package_list.tsv . - -# Install packages from github -RUN Rscript install_github.R \ - --packages github_package_list.tsv \ - --token git_token.txt - -# Set final workdir for commands -WORKDIR /home/rstudio diff --git a/docker/Dockerfile_ottrpal b/docker/Dockerfile_ottrpal deleted file mode 100644 index 692e5b7..0000000 --- a/docker/Dockerfile_ottrpal +++ /dev/null @@ -1,29 +0,0 @@ -FROM jhudsl/course_template:main -LABEL maintainer="cansav09@gmail.com" - -# Install apt-getable packages to start -RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog - -RUN apt-get install -y --no-install-recommends \ - libxt6 \ - libpoppler-cpp-dev \ - vim \ - libglpk40 \ - curl \ - gpg - -# Install R -RUN apt-get update && apt-get install -y r-base curl - -# Install R packages -RUN Rscript -e "install.packages('curl')" - -# Install phantomjs -RUN apt-get update && apt-get install build-essential chrpath libssl-dev libxft-dev -y \ - && apt-get install libfontconfig1 libfontconfig1-dev -y \ - && cd ~ && export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64" \ - && wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2 \ - && sudo tar xvjf $PHANTOM_JS.tar.bz2 \ - && sudo mv $PHANTOM_JS /usr/local/share \ - && sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin \ - && phantomjs --version diff --git a/docker/github_package_list.tsv b/docker/github_package_list.tsv deleted file mode 100644 index e587cda..0000000 --- a/docker/github_package_list.tsv +++ /dev/null @@ -1,10 +0,0 @@ -rstudio/rmarkdown 02d3c2512686fda9c14c2a0e300aa02525f16ca5 -yihui/xfun 74c2a6605d8f0fb19314da542baeead6dc8697d9 -yihui/knitr a1052d12e0ff8f4ead365b4c85ef5835faa1c492 -r-lib/rlang f0c9be5c5806b4e4b120b7516f286fef3c66bda5 -jhudsl/didactr cde4598c10f2b5e2e31b47fe94ca1b02db420e10 -jhudsl/ottrpal HEAD -tidyverse/rvest 4fe39fb5089512d77b6a9cc026e5c895258ff6ce -R-lib/testthat e99155af85261e065192feb946dcfa6679cffae4 -rstudio/bookdown 88bc4ead8562ea281838041c795b38fc4a6a7165 -jhudsl/cow HEAD \ No newline at end of file diff --git a/docker/install_github.R b/docker/install_github.R deleted file mode 100644 index fb532ec..0000000 --- a/docker/install_github.R +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env Rscript - -if (!"optparse" %in% installed.packages()) { - install.packages("optparse") -} - -library(optparse) - -################################ Set up options ################################ -# Set up optparse options -option_list <- list( - make_option( - opt_str = c("-p", "--packages"), type = "character", - default = "github_package_list.tsv" , - help = "Path to a TSV with a list of packages to be installed through Github, - where file where the first column is the github package name e.g. - jhudsl/ottrpal and the second column is the commit ID to be installed - (to be supplied to the ref argument). - ", - metavar = "character" - ), - make_option( - opt_str = c("--token"), type = "character", - default = NULL, - help = "GITHUB PAT file", - metavar = "character" - ) -) - -# Parse options -opt <- parse_args(OptionParser(option_list = option_list)) - -# Read in the token -token <- as.character(readLines(opt$token)[1]) - -# Reset GITHUB PAT to be token -Sys.unsetenv("GITHUB_PAT") -Sys.setenv(GITHUB_PAT = token) - -# set up list of packages to install -packages <- readr::read_tsv(opt$packages, - col_names = c("package_name", "ref")) - -purrr::pmap( - packages, - ~remotes::install_github(..1, - auth_token = token, - ref = ..2) - ) - -# Remove the file after we are done -file.remove(opt$token) diff --git a/index.Rmd b/index.Rmd index 651d7c3..609285e 100644 --- a/index.Rmd +++ b/index.Rmd @@ -17,7 +17,7 @@ This is a companion training guide for BioDIGS, a GDSCN project that brings a re The GDSCN (Genomics Data Science Community Network) is a consortium of educators who aim to create a world where researchers, educators, and students from diverse backgrounds are able to fully participate in genomic data science research. You can find more information about its mission and initiatives [here](https://www.gdscn.org/home). -![BioDIGS logo](https://raw.githubusercontent.com/fhdsl/AnVIL_BioDIGS_Book/main/assets/GDSCN_style/logo_BioDIGS_final.png){width=300px} +![BioDIGS logo](https://raw.githubusercontent.com/fhdsl/GDSCN_BioDIGS_Book/main/assets/GDSCN_style/logo_BioDIGS_final.png){width=300px} ## Target Audience diff --git a/resources/exclude_files.txt b/resources/exclude_files.txt new file mode 100644 index 0000000..5525a40 --- /dev/null +++ b/resources/exclude_files.txt @@ -0,0 +1,8 @@ +About.Rmd +docs/* +style-sets/* +manuscript/* +CONTRIBUTING.md +LICENSE.md +code_of_conduct.md +README.md diff --git a/style-sets/AnVIL/_output.yml b/style-sets/AnVIL/_output.yml new file mode 100644 index 0000000..7d6b017 --- /dev/null +++ b/style-sets/AnVIL/_output.yml @@ -0,0 +1,21 @@ +bookdown::gitbook: + # When using multiple css files, the default file path will be the first one # + css: [assets/style.css, assets/AnVIL_style/anvil.css] + includes: + in_header: GA_Script.html + before_body: assets/AnVIL_style/big-image_anvil.html + after_body: assets/AnVIL_style/footer.html + highlight: tango + config: + toc: + collapse: section + before: | + + after: | +

This content was published with bookdown by:

+

The Fred Hutch Data Science Lab

+ +

Style adapted from: rstudio4edu-book (CC-BY 2.0)

+

Click here to provide feedback

+ +# Note: Do not edit the feedback link in this file. This is automatically edited through the render-preview and render-bookdown workflows. \ No newline at end of file diff --git a/style-sets/AnVIL/index.Rmd b/style-sets/AnVIL/index.Rmd new file mode 100644 index 0000000..0ae4626 --- /dev/null +++ b/style-sets/AnVIL/index.Rmd @@ -0,0 +1,40 @@ +--- +title: "AnVIL Book Name" +date: "`r format(Sys.time(), '%B %d, %Y')`" +site: bookdown::bookdown_site +documentclass: book +bibliography: book.bib +biblio-style: apalike +link-citations: yes +description: Description about Course/Book. +favicon: assets/AnVIL_style/anvil_favicon.ico +--- + + +# About this Book {-} + +This book is part of a series of books for the Genomic Data Science Analysis, Visualization, and Informatics Lab-space (AnVIL) of the National Human Genome Research Institute (NHGRI). Learn more about AnVIL by visiting https://anvilproject.org or reading the [article in Cell Genomics](https://www.sciencedirect.com/science/article/pii/S2666979X21001063). + +## Skills Level {-} + +::: {.notice} +_Genetics_ + + +_Programming skills_ + +::: + +## AnVIL Collection {-} + +Please check out our full collection of AnVIL and related resources: https://hutchdatascience.org/AnVIL_Collection/ + +# Learning Objectives {-} + + + + + + + + diff --git a/style-sets/fhdasl/_output.yml b/style-sets/fhdasl/_output.yml index d00716f..0a86496 100644 --- a/style-sets/fhdasl/_output.yml +++ b/style-sets/fhdasl/_output.yml @@ -11,7 +11,8 @@ bookdown::gitbook: before: | after: | -

This content was published with bookdown by:

+

This content was published with bookdown using

+

The OTTR Template by:

The Fred Hutch Data Science Lab

Style adapted from: rstudio4edu-book (CC-BY 2.0)

Click here to provide feedback