Skip to content

Commit

Permalink
Merge pull request #303 from jhudsl/word-docs
Browse files Browse the repository at this point in the history
Add docx render option
  • Loading branch information
avahoffman authored Nov 3, 2021
2 parents 6efab4d + 92157ef commit 3933d6c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/render-bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
docker run \
--mount type=bind,target=/home/rstudio,source=$PWD \
jhudsl/course_template \
Rscript -e "bookdown::render_book('index.Rmd')"
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"
##### If you do not wish to host your course on Coursera, you can delete this section #####
# Run Coursera version
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/render-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
docker run \
--mount type=bind,target=/home/rstudio,source=$PWD \
jhudsl/course_template \
Rscript -e "bookdown::render_book('index.Rmd')"
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"
##### If you do not wish to host your course on Coursera, you can delete this section #####
# Run Coursera version
Expand Down Expand Up @@ -64,10 +64,13 @@ jobs:
- name: Build components of the comment
id: build-components
run: |
course_name=$(head -n 1 _bookdown.yml | cut -d'"' -f 2)
bookdown_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/index.html")
coursera_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/docs/coursera/index.html")
docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/docs/$course_name.docx")
echo ::set-output name=bookdown_link::$bookdown_link
echo ::set-output name=coursera_link::$coursera_link
echo ::set-output name=docx_link::$docx_link
echo ::set-output name=time::$(date +'%Y-%m-%d')
echo ::set-output name=commit_id::$GITHUB_SHA
Expand All @@ -80,6 +83,7 @@ jobs:
Re-rendered previews from the latest commit:
- See [preview of Bookdown here](${{ steps.build-components.outputs.bookdown_link }})
- See [preview of Coursera version here](${{ steps.build-components.outputs.coursera_link }})
- Download the [preview of .docx file](${{ steps.build-components.outputs.docx_link }})
_Updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_
edit-mode: replace
Binary file added docs/Course_Name.docx
Binary file not shown.
3 changes: 3 additions & 0 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ biblio-style: apalike
link-citations: yes
description: "Description about Course/Book."
favicon: assets/dasl_favicon.ico
output:
bookdown::word_document2:
toc: true
---

```{r include=FALSE}
Expand Down

0 comments on commit 3933d6c

Please sign in to comment.