Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔄 Synced file(s) with jhudsl/OTTR_Template #24

Closed
wants to merge 9 commits into from
Closed
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
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/course-content-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: New content idea
about: Suggest an idea for the course
title: ''
labels: ''
assignees:

---

## Describe the your scope of your content idea
<!-- What will this cover and how does it relate to the current course material? -->

## Describe the learning objectives for your content idea
<!-- What will users learn from this new content? -->

## Additional context or resources
<!-- Add any other context or related resources we should know about? -->
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/course-problem-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Course Problem Report
about: Create a report to help improve the course
title: [Problem]
labels: bug
assignees:

---

## Describe what is not working with the course
<!-- A clear and concise description of what the bug is. -->

## Steps to Reproduce
<!-- Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->

## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->

## Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

## Additional context
<!-- Add any other context about the problem here. -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/url-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Broken URLs found in the course!
labels: url-error
---
URL's in this course were just checked and some broken URLs were found.

**Number of errors:** {{ env.ERROR_NUM }}
**File where errors are:** [url checks file here]({{ env.FILE_URL }})
4 changes: 2 additions & 2 deletions .github/workflows/render-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
git push -u origin main || echo "No changes to push"

- name: Run ottrpal::bookdown_to_embed_leanpub
if: needs.yaml-check.outputs.toggle_quiz_check == 'no'
if: ${{ needs.yaml-check.outputs.toggle_quiz_check == 'no'}}
run: |
echo needs.yaml-check.outputs.toggle_make_book_txt == 'yes'
echo needs.yaml-check.outputs.toggle_make_book_txt
Expand All @@ -211,7 +211,7 @@ jobs:
quiz_dir = NULL)"

- name: Run ottrpal::bookdown_to_embed_leanpub
if: needs.yaml-check.outputs.toggle_quiz_check == 'yes'
if: ${{ needs.yaml-check.outputs.toggle_quiz_check == 'yes'}}
run: |
Rscript -e "ottrpal::bookdown_to_embed_leanpub(
render = FALSE, \
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/transfer-rendered-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This code was adapted from code written by Josh Shapiro
# for the Childhood Cancer Data Lab, an initiative of Alexs Lemonade Stand Foundation.
# https://github.com/AlexsLemonade/exercise-notebook-answers

# Adapted for this jhudsl repository by Candace Savonen Apr 2021

name: Copy over from main template to _Quizzes repo

on:
workflow_dispatch:
workflow_run:
workflows: [ "Render all output courses" ]
branches: [ main, staging ]
types:
- completed

jobs:

yaml-check:
name: Load user automation choices
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

# Use the yaml-env-action action.
- name: Load environment from YAML
uses: doughepi/[email protected]
with:
files: config_automation.yml # Pass a space-separated list of configuration files. Rightmost files take precedence.
outputs:
toggle_coursera: "${{ env.RENDER_COURSERA }}"
toggle_leanpub: "${{ env.RENDER_LEANPUB }}"


file-quizzes-pr:
name: File _Quizzes Transfer PR
runs-on: ubuntu-latest
container:
image: jhudsl/ottrpal:main
needs: [yaml-check]
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: |
# 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

# 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

echo "git_results=$results" >> $GITHUB_OUTPUT
echo "leanpub_repo=$QUIZ_REPO" >> $GITHUB_OUTPUT

- name: Checkout code from Leanpub repo
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
uses: actions/checkout@v4
with:
path: quizzes
repository: ${{ steps.git_repo_check.outputs.leanpub_repo }}
token: ${{ secrets.GH_PAT }}

- name: Get files from Bookdown repo
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
shell: bash
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
# 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 (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
branch: auto_copy_rendered_files
delete-branch: true
title: 'GHA: Automated transfer of ottrpal-needed files from Bookdown repository'
body: |
### Description:
This PR was initiated by transfer-rendered.yml in the Bookdown repository.
It copies over the ottrpal-needed folder (for the `bookdown_to_embed_leanpub(render = FALSE)` function
to run properly.
- resources/chapt_screen_images/*
- _bookdown.yml
labels: |
automated
reviewers: $GITHUB_ACTOR

# Write out PR info
- name: Check outputs
if: ${{ steps.git_repo_check.outputs.git_results == 'TRUE' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
Binary file added assets/box_images/dictionary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/box_images/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/box_images/note.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/box_images/thinking_face.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/box_images/under_construction.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/box_images/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions config_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ spell-check: yes
style-code: yes
# Test build the docker image if any docker-relevant files have been changed
docker-test: no
# Do we need to make the book txt file automatically?
make_book_txt: yes
# Should URLs be tested periodically?
url-check-periodically: yes

##### Renderings run upon merge to main branch #####
# Rendering each platform's content
render-website: quarto
render-website: rmd
render-leanpub: yes
render-coursera: no

## Automate the creation of Book.txt file? yes/no
## This is only relevant if render-leanpub is yes, otherwise it will be ignored
make-book-txt: yes

# What docker image should be used for rendering?
# The default is jhudsl/base_ottr:latest
rendering-docker-image: 'jhudsl/ottr_quarto:main'
# The default is jhudsl/base_ottr:main
rendering-docker-image: 'jhudsl/base_ottr:main'
8 changes: 8 additions & 0 deletions resources/exclude_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
About.Rmd
docs/*
style-sets/*
manuscript/*
CONTRIBUTING.md
LICENSE.md
code_of_conduct.md
README.md
18 changes: 18 additions & 0 deletions style-sets/data-trail/_output.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bookdown::gitbook:
css: assets/style_DataTrail.css
includes:
before_body: assets/big-image-DataTrail.html
after_body: assets/footer.html
highlight: tango
config:
toc:
collapse: section
before: |
<a href="https://www.datatrail.org/"><img src="assets/DataTrail_logo.jpg" style="padding-left: 0px; padding-top: 8px;"</a>
after: |
<p style="text-align:center;"> <a href="https://www.ottrproject.org/" target="blank" > This content was published with</a> <a href="https://bookdown.org/" target="blank"> bookdown using</a> </p>
<p style="text-align:center;"> <a href="https://github.com/jhudsl/OTTR_Template"> The OTTR Template by:</a></p>
<p style="text-align:center;"> <a href="http://jhudatascience.org/"> The Johns Hopkins Data Science Lab </a></p>
<a href="http://jhudatascience.org/"><img src="https://jhudatascience.org/images/dasl.png" style=" width: 80%; filter: grayscale(100%); padding-left: 40px; padding-top: 8px; vertical-align: top "</a>
<p style="text-align:center; font-size: 12px;"> <a href="https://github.com/rstudio4edu/rstudio4edu-book/"> Style adapted from: rstudio4edu-book </a> <a href ="https://creativecommons.org/licenses/by/2.0/"> (CC-BY 2.0) </a></p>
<p style="padding-left: 40px;"><div class="trapezoid" style = "padding-left: 40px;"><span> <a href="https://forms.gle/VWaJYc3zATe3qxYC9"> Click here to provide feedback</a> <img src="assets/itcr_arrow.png" style=" width: 10%" ></span></div></p>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions style-sets/data-trail/copy-to-assets/big-image-DataTrail.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<head>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
<!--script src="https://kit.fontawesome.com/6a26f47516.js"></script-->
<!--<script src="assets/hideOutput.js"></script>-->
<link href="assets/style_DataTrail.css" rel="stylesheet">
</head>



<div class="hero-image-container">
<img class= "hero-image" src="assets/DataTrail.jpg">
</div>
Loading
Loading