Skip to content

Commit

Permalink
Merge pull request #410 from appliedepi/handbook_v2.5_en
Browse files Browse the repository at this point in the history
Handbook v2.5 en
  • Loading branch information
aspina7 authored Jan 24, 2025
2 parents 31aef2f + a23fe49 commit 3f213c9
Show file tree
Hide file tree
Showing 648 changed files with 198,246 additions and 185,714 deletions.
2 changes: 1 addition & 1 deletion .Rhistory
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
############
learnr, # interactive tutorials in RStudio Tutorial pane
swirl, # interactive tutorials in R console
# project and file management
Expand Down Expand Up @@ -510,3 +509,4 @@ bookdown::render_book(
output_format = 'bookdown::bs4_book',
config_file = "_bookdown.yml")
renv::status()
here("data", "linelists", "linelist_raw.xlsx")
83 changes: 50 additions & 33 deletions .github/workflows/create_pr_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ jobs:
for lang in "${LANGS[@]}"; do
TRANSLATION_BRANCH="handbook_${VERSION_SUFFIX/_en/_$lang}"
# Check if the translation branch exists
# Ensure we have all history
git fetch --all
#! Check if the translation branch exists
if git ls-remote --exit-code --heads origin "${TRANSLATION_BRANCH}"; then
echo "Branch ${TRANSLATION_BRANCH} exists. Checking out and rebasing with ${EN_BRANCH}"
git fetch --prune
Expand All @@ -55,74 +59,87 @@ jobs:
git pull origin "${EN_BRANCH#refs/heads/}"
fi
# Force push the changes to the remote repository
#! Force push the changes to the remote repository
git push origin "${TRANSLATION_BRANCH}" --force
#! Get the list of changed .qmd files: COMPARED WITH main branch
changed_files=$(git diff --name-only origin/main "${TRANSLATION_BRANCH}" | grep -E '\.qmd$' | grep -Ev '\.[a-z]{2}\.qmd$')
if [ -z "$changed_files" ]; then
echo "No .qmd file changes to include in PR for ${TRANSLATION_BRANCH}"
continue
fi
echo "Changed files: $changed_files"
# Get the date of the latest commit on the english branch
#! Get the date of the latest commit on the english branch
latest_commit_date=$(git show -s --format=%ci ${EN_BRANCH})
echo "Commits on the English branch that were made after the latest commit on the translation branch at $latest_commit_date"
latest_commit_en_branch=$(git show --format=%H -s ${EN_BRANCH})
latest_commit_info=$(git log ${EN_BRANCH} --since="$latest_commit_date" --format="%H %s" --reverse)
commit_messages=$(echo "$latest_commit_info" | cut -d' ' -f2-)
latest_commit_master=$(git show --format=%H -s origin/master)
echo $latest_commit_en_branch
echo $latest_commit_master
echo $latest_commit_info
# Check if there are new commits
if [ "$latest_commit_en_branch" == "$latest_commit_master" ]; then
#! Check if there are new commits
if [ "$latest_commit_en_branch" == "$latest_commit_main" ]; then
echo "No new commits to include in PR for ${TRANSLATION_BRANCH}"
continue
fi
# Check if a PR already exists for this branch
#! Check if a PR already exists for this branch
PR_EXISTS=$(gh pr list --head "${TRANSLATION_BRANCH}" --state open --json number --jq length)
if [ "$PR_EXISTS" -eq 0 ]; then
echo "Creating new PR for ${TRANSLATION_BRANCH}"
PR_URL=$(gh pr create --base deploy-preview --head "$TRANSLATION_BRANCH" --title "Handbook ${VERSION_SUFFIX/_en/} $lang" --body "Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}")
PR_NUMBER=$(echo "$PR_URL" | grep -oE '[0-9]+$')
else
# Get the PR number for the translation branch
#! Get the PR number for the translation branch
echo "PR already exists for ${TRANSLATION_BRANCH}"
PR_NUMBER=$(gh pr list --head "${TRANSLATION_BRANCH}" --state open --json number --jq ".[0].number")
fi
echo "Pull Request Number: $PR_NUMBER"
#! Initialize new PR body
new_pr_body="# Automated pull request for $lang handbook version ${VERSION_SUFFIX/_en/}"$'\n\n'
#! Mention a user in the PR description
case "$lang" in
"vn") new_pr_body+="@ntluong95, please review changes and check the box when you finish"$'\n' ;;
"fr") new_pr_body+="@oliviabboyd, please review changes and check the box when you finish"$'\n' ;;
"es") new_pr_body+="@amateo250, please review changes and check the box when you finish"$'\n' ;;
"jp") new_pr_body+="@hitomik723, please review changes and check the box when you finish"$'\n' ;;
"tr") new_pr_body+="@ntluong95, please review changes and check the box when you finish"$'\n' ;;
"pt") new_pr_body+="@Luccan97, please review changes and check the box when you finish"$'\n' ;;
"ru") new_pr_body+="@ntluong95, please review changes and check the box when you finish"$'\n' ;;
esac
# Add new commits as checkboxes to the PR description
#! Add new commits as checkboxes to the PR description
IFS=$'\n' # Change the Internal Field Separator to newline for correct iteration over lines
checkboxes=""
for commit in $latest_commit_en_branch; do
checkboxes="$checkboxes- [ ] [$commit_messages](https://github.com/${{ github.repository }}/commit/$commit)"
for file in $changed_files; do
#! List only new commits compared with the main branch, tail -n +2 to skip the first line of output from git log, the latest commit will not be added into the message
list_commits=$(git log origin/main..${TRANSLATION_BRANCH} --follow --pretty=format:"%H" -- $file | tail -n +2 | paste -sd, - | sed 's/,/, /g')
for commit in $latest_commit_en_branch; do
checkboxes="$checkboxes- [ ] Chapter [\`$file\`](https://github.com/${{ github.repository }}/pull/$PR_NUMBER/files?file-filters%5B%5D=.qmd&show-viewed-files=true) has changes in the following commit(s): $list_commits. "
checkboxes="$checkboxes"$'\n'"$checkbox"
done
done
# Mention a user in the PR description
if [ "$lang" = "vn" ]; then
checkboxes="$checkboxes @ntluong95, please check the box when you finish"
elif [ "$lang" = "fr" ]; then
checkboxes="$checkboxes @oliviabboyd, please check the box when you finish"
elif [ "$lang" = "es" ]; then
checkboxes="$checkboxes @amateo250, please check the box when you finish"
elif [ "$lang" = "jp" ]; then
checkboxes="$checkboxes @ntluong95, please check the box when you finish"
elif [ "$lang" = "tr" ]; then
checkboxes="$checkboxes @ntluong95, please check the box when you finish"
elif [ "$lang" = "pt" ]; then
checkboxes="$checkboxes @Luccan97, please check the box when you finish"
elif [ "$lang" = "ru" ]; then
checkboxes="$checkboxes @ntluong95, please check the box when you finish"
if [ -n "$checkboxes" ]; then
# Append the checkboxes to the new PR body
new_pr_body="$new_pr_body"$'\n'"$checkboxes"
fi
# Retrieve the current PR description
current_pr_body=$(gh pr view $PR_NUMBER --json body --jq '.body')
# Append checkboxes to the current PR description
new_pr_body=$(printf "%s\n%s" "$current_pr_body" "$checkboxes")
# gh api repos/${{ github.repository }}/issues/$PR_NUMBER --method PATCH --field body="$checkboxes"
gh api repos/${{ github.repository }}/issues/$PR_NUMBER --method PATCH --field body="$new_pr_body"
Expand Down
3 changes: 2 additions & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ book:
- icon: twitter
href: "https://twitter.com/appliedepi"
- icon: linkedin
href: "https://www.linkedin.com/company/appliedepi/"
href: "https://www.linkedin.com/company/appliedepi"
# - icon: github
# menu:
# - text: Source Code
Expand Down Expand Up @@ -206,6 +206,7 @@ book:
- new_pages/reportfactory.qmd #done
- new_pages/flexdashboard.qmd #done
- new_pages/shiny_basics.qmd #done
- new_pages/quarto.qmd #done

# MISCELLANEOUS
- part: "Miscellaneous"
Expand Down
20 changes: 10 additions & 10 deletions banner.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<div class="alert alert-info alert-dismissible">
<!-- <a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>Need help learning R?</strong> Enroll in Applied Epi's <a href="https://www.appliedepi.org/live/"
class="alert-link">intro R course</a>, try our <a href="https://www.appliedepi.org/tutorial/"
<strong>Need help learning R?</strong> Enroll in Applied Epi's <a href="https://www.appliedepi.org/training/public-courses"
class="alert-link">intro R course</a>, try our <a href="https://www.appliedepi.org/resources/tutorials"
class="alert-link">free R tutorials</a>, post in our <a href="https://community.appliedepi.org/"
class="alert-link">Community Q&A forum</a>, or ask about our <a href="mailto:contact@appliedepi.org"
class="alert-link">R Help Desk service</a>. -->
Expand All @@ -36,14 +36,14 @@

// Translations for the content
const translations = {
en: '<strong>Need help learning R?</strong> Enroll in Applied Epi\'s <a href="https://www.appliedepi.org/live/" class="alert-link">intro R course</a>, try our <a href="https://www.appliedepi.org/tutorial/" class="alert-link">free R tutorials</a>, post in our <a href="https://community.appliedepi.org/" class="alert-link">Community Q&A forum</a>, or ask about our <a href="mailto:contact@appliedepi.org" class="alert-link">R Help Desk service</a>.',
fr: '<strong>Besoin d\'aide pour apprendre R ?</strong> Inscrivez-vous au <a href="https://www.appliedepi.org/live/" class="alert-link">cours d\'introduction à R</a> d\'Applied Epi, essayez nos <a href="https://www.appliedepi.org/tutorial/" class="alert-link">tutoriels R gratuits</a>, postez dans notre forum de <a href="https://community.appliedepi.org/" class="alert-link">questions-réponses communautaires</a>, ou demandez-nous des informations sur <a href="mailto:contact@appliedepi.org" class="alert-link"> notre service d\'assistance R</a>.',
es: '<strong>¿Necesitas ayuda para aprender R?</strong> Inscríbete en el <a href="https://www.appliedepi.org/live/" class="alert-link">Curso de introducción a R</a> de Applied Epi, prueba nuestros <a href="https://www.appliedepi.org/tutorial/" class="alert-link">Tutoriales gratuitos de R</a>, escribe en nuestro <a href="https://community.appliedepi.org/" class="alert-link">Foro de preguntas y respuestas,</a> o pregunta por nuestra <a href="mailto:contact@appliedepi.org" class="alert-link">Asistencia técnica para R</a>.',
vn: '<strong>Bạn cần giúp đỡ trong việc học R?</strong> Hãy đăng ký khóa học R cơ bản của Applied Epi tại <a href="https://www.appliedepi.org/live/" class="alert-link">đây</a>, hoặc thử các <a href="https://www.appliedepi.org/tutorial/" class="alert-link">hướng dẫn R miễn phí</a>, đăng bài trong <a href="https://community.appliedepi.org/" class="alert-link">diễn đàn cộng đồng</a>, hoặc gửi câu hỏi tới <a href="mailto:contact@appliedepi.org" class="alert-link">dịch vụ Trợ giúp R</a> của chúng tôi.',
jp: '<strong>Rの学習について助けが必要ですか?</strong>Applied Epiの<a href="https://www.appliedepi.org/live/" class="alert-link">R入門コース</a>に登録するか、<a href="https://www.appliedepi.org/tutorial/" class="alert-link">無料Rチュートリアル</a>を試すか、<a href="https://community.appliedepi.org/" class="alert-link">コミュニティQ&Aフォーラム</a>に投稿するか、<a href="mailto:contact@appliedepi.org" class="alert-link">Rヘルプデスクサービス</a>についてお問い合わせください。',
pt: '<strong>Você precisa de ajuda para aprender R??</strong> Inscreva-se no curso de <a href="https://www.appliedepi.org/live/" class="alert-link">introdução ao R da Applied Epi</a>, experimente nossos <a href="https://www.appliedepi.org/tutorial/" class="alert-link">tutoriais gratuitos sobre o R</a>, publique em nosso <a href="https://community.appliedepi.org/" class="alert-link">fórum de perguntas e respostas</a>, ou solicite nosso <a href="mailto:contact@appliedepi.org" class="alert-link">suporte ao R</a>.',
tr: '<strong>R öğrenmekte yardıma mı ihtiyacınız var?</strong> Applied Epi\'\nin <a href="https://www.appliedepi.org/live/" class="alert-link">R\'ye giriş kursuna</a> kaydolun, <a href="https://www.appliedepi.org/tutorial/" class="alert-link">ücretsiz R derslerimizi</a> deneyin, <a href="https://community.appliedepi.org/" class="alert-link">Topluluk Q&A forumunda</a> soru paylaşın, ya da <a href="mailto:contact@appliedepi.org" class="alert-link">R Yardım Masası hizmetimiz</a> hakkında sorun.',
ru: '<strong>Нужна помощь в изучении R?</strong> Запишитесь на <a href="https://www.appliedepi.org/live/" class="alert-link">вводный курс по R</a> от Applied Epi, попробуйте наши <a href="https://www.appliedepi.org/tutorial/" class="alert-link">бесплатные учебные материалы по R</a>, задайте вопрос в нашем <a href="https://community.appliedepi.org/" class="alert-link">форуме вопросов и ответов сообщества</a>, или спросите о нашей услуге <a href="mailto:contact@appliedepi.org" class="alert-link">Службы поддержки по R</a>.'
en: '<strong>Need help learning R?</strong> Enroll in Applied Epi\'s <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">intro R course</a>, try our <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">free R tutorials</a>, post in our <a href="https://community.appliedepi.org/" class="alert-link">Community Q&A forum</a>, or ask about our <a href="mailto:contact@appliedepi.org" class="alert-link">R Help Desk service</a>.',
fr: '<strong>Besoin d\'aide pour apprendre R ?</strong> Inscrivez-vous au <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">cours d\'introduction à R</a> d\'Applied Epi, essayez nos <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">tutoriels R gratuits</a>, postez dans notre forum de <a href="https://community.appliedepi.org/" class="alert-link">questions-réponses communautaires</a>, ou demandez-nous des informations sur <a href="mailto:contact@appliedepi.org" class="alert-link"> notre service d\'assistance R</a>.',
es: '<strong>¿Necesitas ayuda para aprender R?</strong> Inscríbete en el <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">Curso de introducción a R</a> de Applied Epi, prueba nuestros <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">Tutoriales gratuitos de R</a>, escribe en nuestro <a href="https://community.appliedepi.org/" class="alert-link">Foro de preguntas y respuestas,</a> o pregunta por nuestra <a href="mailto:contact@appliedepi.org" class="alert-link">Asistencia técnica para R</a>.',
vn: '<strong>Bạn cần giúp đỡ trong việc học R?</strong> Hãy đăng ký khóa học R cơ bản của Applied Epi tại <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">đây</a>, hoặc thử các <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">hướng dẫn R miễn phí</a>, đăng bài trong <a href="https://community.appliedepi.org/" class="alert-link">diễn đàn cộng đồng</a>, hoặc gửi câu hỏi tới <a href="mailto:contact@appliedepi.org" class="alert-link">dịch vụ Trợ giúp R</a> của chúng tôi.',
jp: '<strong>Rの学習について助けが必要ですか?</strong>Applied Epiの<a href="https://www.appliedepi.org/training/public-courses" class="alert-link">R入門コース</a>に登録するか、<a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">無料Rチュートリアル</a>を試すか、<a href="https://community.appliedepi.org/" class="alert-link">コミュニティQ&Aフォーラム</a>に投稿するか、<a href="mailto:contact@appliedepi.org" class="alert-link">Rヘルプデスクサービス</a>についてお問い合わせください。',
pt: '<strong>Você precisa de ajuda para aprender R??</strong> Inscreva-se no curso de <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">introdução ao R da Applied Epi</a>, experimente nossos <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">tutoriais gratuitos sobre o R</a>, publique em nosso <a href="https://community.appliedepi.org/" class="alert-link">fórum de perguntas e respostas</a>, ou solicite nosso <a href="mailto:contact@appliedepi.org" class="alert-link">suporte ao R</a>.',
tr: '<strong>R öğrenmekte yardıma mı ihtiyacınız var?</strong> Applied Epi\'\nin <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">R\'ye giriş kursuna</a> kaydolun, <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">ücretsiz R derslerimizi</a> deneyin, <a href="https://community.appliedepi.org/" class="alert-link">Topluluk Q&A forumunda</a> soru paylaşın, ya da <a href="mailto:contact@appliedepi.org" class="alert-link">R Yardım Masası hizmetimiz</a> hakkında sorun.',
ru: '<strong>Нужна помощь в изучении R?</strong> Запишитесь на <a href="https://www.appliedepi.org/training/public-courses" class="alert-link">вводный курс по R</a> от Applied Epi, попробуйте наши <a href="https://www.appliedepi.org/resources/tutorials" class="alert-link">бесплатные учебные материалы по R</a>, задайте вопрос в нашем <a href="https://community.appliedepi.org/" class="alert-link">форуме вопросов и ответов сообщества</a>, или спросите о нашей услуге <a href="mailto:contact@appliedepi.org" class="alert-link">Службы поддержки по R</a>.'
};

// Default to English if the detected language is not supported
Expand Down
4 changes: 2 additions & 2 deletions contribution_guide_05-02-2021.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ In your code, please maintain [tidyverse style](https://style.tidyverse.org/) as
* Bullets are nice and easy to read
* Explanations should not rely on websites - users may be offline; links can be included but should not be required viewing
* Prioritize using packages and functions that are *stable*, *commonly-used*, and do not require additional downloads
* Use lots of `# comments` to explain the code to a beginner - be concise and previse please!
* Use lots of `# comments` to explain the code to a beginner - be concise and precise please!
* When using a function for the first time in a page, indicate its package in the accompanying text, or in code like `dplyr::mutate()`
* Make use of magrittr pipes and dplyr verbs whenever practical
* When making assignments, use `<-`, NOT `=`
Expand Down Expand Up @@ -216,7 +216,7 @@ knitr::include_graphics(here::here("images", "Git_console.png"))
```
Please note the buttons circled as they will be referenced later (from left to right):

* Button to begin "commiting" your changes to your branch (will open a new window)
* Button to begin "committing" your changes to your branch (will open a new window)
* Arrows to PULL (update your local version of the branch with any changes to made your branch by others) and to PUSH (send any completed commits stored in your local version of the branch to the remote/Github version of your branch)
* The Git tab in RStudio
* Button to create a NEW branch of whichever version is listed to the right. **You almost always want to branch off of the master (after you PULL to update the master first)**.
Expand Down
Binary file added data/contact_tracing.rds
Binary file not shown.
Loading

0 comments on commit 3f213c9

Please sign in to comment.