From c64537ea728f85fd2313fa0336bcbd4bdc1f4447 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Fri, 9 May 2025 11:46:21 -0400 Subject: [PATCH 01/10] try without workflow yml files --- .github/workflows/test.yml | 10 ++++-- test-rmd_web/_site.yml | 18 ++++++++++ test-rmd_web/config_automation.yml | 34 +++++++++++++++++++ test-rmd_web/index.Rmd | 9 +++++ test-rmd_web/resources/dictionary.txt | 27 +++++++++++++++ test-rmd_web/resources/exclude_files.txt | 8 +++++ test-rmd_web/resources/header.html | 2 ++ test-rmd_web/resources/ignore-urls.txt | 2 ++ test-rmd_web/resources/images/favicon.ico | Bin 0 -> 15406 bytes test-rmd_web/styles.css | 39 ++++++++++++++++++++++ 10 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 test-rmd_web/_site.yml create mode 100644 test-rmd_web/config_automation.yml create mode 100644 test-rmd_web/index.Rmd create mode 100644 test-rmd_web/resources/dictionary.txt create mode 100644 test-rmd_web/resources/exclude_files.txt create mode 100644 test-rmd_web/resources/header.html create mode 100644 test-rmd_web/resources/ignore-urls.txt create mode 100755 test-rmd_web/resources/images/favicon.ico create mode 100644 test-rmd_web/styles.css diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 17fd1db..9c148b2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,13 +20,19 @@ jobs: fetch-depth: 0 - name: Run render for Rmd - uses: ottrproject/ottr-preview@cansavvy/docker-swap + uses: ottrproject/ottr-preview@main with: toggle_website: "rmd" root_path: test-rmd - name: Run render for Quarto - uses: ottrproject/ottr-preview@cansavvy/docker-swap + uses: ottrproject/ottr-preview@main with: toggle_website: "quarto" root_path: test-quarto + + - name: Run render for Rmd_web + uses: ottrproject/ottr-preview@main + with: + toggle_website: "rmd_web" + root_path: test-rmd_web diff --git a/test-rmd_web/_site.yml b/test-rmd_web/_site.yml new file mode 100644 index 0000000..b7023cb --- /dev/null +++ b/test-rmd_web/_site.yml @@ -0,0 +1,18 @@ +name: OTTR Template Website Test +output_dir: 'docs' +navbar: + title: OTTR Web Test + left: + - text: "" + href: index.html + icon: fa-home + +output: + html_document: + theme: cosmo + lib_dir: site_libs + self_contained: no + highlight: textmate + css: styles.css + includes: + in_header: resources/header.html diff --git a/test-rmd_web/config_automation.yml b/test-rmd_web/config_automation.yml new file mode 100644 index 0000000..a1a01a0 --- /dev/null +++ b/test-rmd_web/config_automation.yml @@ -0,0 +1,34 @@ + +##### Checks run at pull request ##### +# Check quiz formatting +check-quizzes: no +# Check that urls in the content are not broken +url-checker: yes +# Render preview of content with changes (Rmd's and md's are checked) +render-preview: yes +# Spell check Rmds and quizzes +spell-check: yes +# Style any R code +style-code: yes +# Would you like your markdown files to be checked for formatting +markdown-linter: yes +# Would you like a readability report on your markdowns? +readability-report: yes +# Test build the docker image if any docker-relevant files have been changed +docker-test: no +# Should URLs be tested periodically? +url-check-periodically: yes + +##### Renderings run upon merge to main branch ##### +# Rendering each platform's content +render-website: rmd_web +render-leanpub: no +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:main +rendering-docker-image: 'jhudsl/base_ottr:main' diff --git a/test-rmd_web/index.Rmd b/test-rmd_web/index.Rmd new file mode 100644 index 0000000..4d2546c --- /dev/null +++ b/test-rmd_web/index.Rmd @@ -0,0 +1,9 @@ +--- +title:"**Test Rmd Website**" +output: + html_document +--- + +### **About** + +This is a test of rendering an Rmd for a website using the ottr-preview action. diff --git a/test-rmd_web/resources/dictionary.txt b/test-rmd_web/resources/dictionary.txt new file mode 100644 index 0000000..c3bf9f5 --- /dev/null +++ b/test-rmd_web/resources/dictionary.txt @@ -0,0 +1,27 @@ +cheatsheet +css +custimization +cwrigh +Dockerfile +Dockerhub +favicon +GH +Github +GitHub +HTTPS +ITN +ITCR +lightblue +lightgreen +OTTR +Rmd +repo +subdir +th +tibble +www +automations +Bootstap +glyphicons +repo +RStudio diff --git a/test-rmd_web/resources/exclude_files.txt b/test-rmd_web/resources/exclude_files.txt new file mode 100644 index 0000000..5525a40 --- /dev/null +++ b/test-rmd_web/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/test-rmd_web/resources/header.html b/test-rmd_web/resources/header.html new file mode 100644 index 0000000..a4b1f27 --- /dev/null +++ b/test-rmd_web/resources/header.html @@ -0,0 +1,2 @@ + + diff --git a/test-rmd_web/resources/ignore-urls.txt b/test-rmd_web/resources/ignore-urls.txt new file mode 100644 index 0000000..15862b6 --- /dev/null +++ b/test-rmd_web/resources/ignore-urls.txt @@ -0,0 +1,2 @@ +username.github.io/repository_name +https://username.github.io/repository_name/ diff --git a/test-rmd_web/resources/images/favicon.ico b/test-rmd_web/resources/images/favicon.ico new file mode 100755 index 0000000000000000000000000000000000000000..36c12569e08a09b997383f34fb517582b941e3de GIT binary patch literal 15406 zcmeI31&mck7sub%k0uRLtU&Pv3dM^9?yR~|MkR+=keadJS}2)Jo!8x zPgvMrzca@7cqV(_<;d~(_Y5A-_Cy{}MsFE!6>p8d-g|F8NrFfdCQOi*FJH>mty|^T zv14-ba@ao$(uK?>V4|esdddPTC_+~rAj5`%9WFX1q(`t4jr8Gfjpq&Y15{a zO`A4pHO87fdv^KmyYKY(_3PIqY0{*QzQYUah5mEr&aLYY8N!!sQzFVkjT$x7FB$*v z`|rQ&m`vNqr+oSH>WA<}*l^Yw{kLn^&grI7rAo4S^JeFFL>`#)oH=vKmMvR^H4Wik zzW@GvDOcEmEOXQPJK9SEp`%JHd2@~pf`v2jFADnKmN%*fo2;cP8S6`_u%aJ38 z+C=)EIdi7=F>l^H*|B4X+8^vB7q+%<-@ZEj1`QfG-IXa*Mt1Jp>HLn!193vNYSpyp z*I$3F^M~#cH(=xOrPxyR3|&Y5*h1vY_!A{cB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v?1h8&IYa%D^@JM zuwO>64gc)1BOl5z7BG6`5e#BJY1{Bbo8+8e59FHo-PNmCYgdd9Tn0aF<0Z@+_6DD7 z`y|6Z`pG^CXBLo&?JuG_hF!aMDSl()WsHeE5qwN)Z%%4(Eczv%#pl9Lcx3Y*UfIZg zXAcv+&))k66G0D{Z)`s}fFbM={2Tjf-ut>oH~+{JOa338$2Ux+92Nl_~VZ?ZzM)$--LXST*?=59)-M?9Ql3o1)kz7 zH$3mfeTZcZ{$lq*Tn;|NSrzh$_Yrw(ty;Ad%j1kDxeE9O*aP?D!dPuS$VG@N(H%PnBGw}RL&jj5Zi+7ckv(}dx2?&Rp`4|@&% z2y6;0(T!OKi+}QM_6y7fCJD|FGiFT1Yy9!Wd-7@cXOF?3j{}QCF7Ex2VDay3?!g4W z5b!P%IGSSID{eqW)IfZ9K!9~C*-RGUK2k1Vw z3|(}`2+_$u*fy9hSgVcS8QIx);w11w@J%p%>=qZ8GFU!iL(kwJT#&Z8_>S(ePs3Pv z2TlhjYRYgY_Tk(#xQls@Z8`sU`~!xI?=%_6w*z>Zlv=pC^Y z7nmnRx%yr`L*KYKL&e@CcEh|Q-eWJt{N|4B!p5;rVBWKLWBBK+7w7QI1-_14z*HG; zM2Oe`TS}aOzR(}-VRPUc!asACn*AStSCuMNWa`wZe!rV~#MJBu@P7^Fow>sUHp6}1 iF(TuDN3d@6AUwT`NPD3&|DO`@9uEppNCJ_T!2ba8H*KH* literal 0 HcmV?d00001 diff --git a/test-rmd_web/styles.css b/test-rmd_web/styles.css new file mode 100644 index 0000000..1812c01 --- /dev/null +++ b/test-rmd_web/styles.css @@ -0,0 +1,39 @@ + +/* To add some space below the navigation bar */ + + body { + margin-top: 100px; +} + + +/* add some color - if you want color behind a major point on your website */ + +.banner_color { + background-color: lightblue; + font-weight:bold; + +} + +/* Style buttons - if you want some text centered and bolded */ + +.center { + font-weight:bold; + text-align: center; +} + +/* Style buttons - if you want to have a button */ +.btn { + background-color: DodgerBlue; + border: none; + color: white; + padding: 8px 20px; + cursor: pointer; + font-size: 14px; +} + +/* Darker background on mouse-over */ +.btn:hover { + background-color: RoyalBlue; +} + + From 80d56dfddc07d8363f7de0989700b352702509b2 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Fri, 9 May 2025 12:26:16 -0400 Subject: [PATCH 02/10] error in header for Rmd maybe? --- test-rmd_web/index.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-rmd_web/index.Rmd b/test-rmd_web/index.Rmd index 4d2546c..1d1f7eb 100644 --- a/test-rmd_web/index.Rmd +++ b/test-rmd_web/index.Rmd @@ -1,5 +1,5 @@ --- -title:"**Test Rmd Website**" +title: "**Test Rmd Website**" output: html_document --- From bf8fbbf8fea1e5375672f27fefcf55827fbcb79b Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Fri, 9 May 2025 12:30:03 -0400 Subject: [PATCH 03/10] remove leanpub and coursera stuff from config yml --- test-rmd_web/config_automation.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test-rmd_web/config_automation.yml b/test-rmd_web/config_automation.yml index a1a01a0..9dc0767 100644 --- a/test-rmd_web/config_automation.yml +++ b/test-rmd_web/config_automation.yml @@ -22,12 +22,6 @@ url-check-periodically: yes ##### Renderings run upon merge to main branch ##### # Rendering each platform's content render-website: rmd_web -render-leanpub: no -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:main From d816cc2c865a3643aea22f4006d36b2279f3d8f0 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:12:04 -0400 Subject: [PATCH 04/10] Update test.yml update to point to this branch --- .github/workflows/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c148b2..c54dd75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,19 +20,19 @@ jobs: fetch-depth: 0 - name: Run render for Rmd - uses: ottrproject/ottr-preview@main + uses: ottrproject/ottr-preview@testweb with: toggle_website: "rmd" root_path: test-rmd - name: Run render for Quarto - uses: ottrproject/ottr-preview@main + uses: ottrproject/ottr-preview@testweb with: toggle_website: "quarto" root_path: test-quarto - name: Run render for Rmd_web - uses: ottrproject/ottr-preview@main + uses: ottrproject/ottr-preview@testweb with: toggle_website: "rmd_web" root_path: test-rmd_web From 49d9a66045287dcb4542f2b457caac031dbff443 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Fri, 13 Jun 2025 16:15:46 -0400 Subject: [PATCH 05/10] Update action.yml bring cansavvy/no-docx changes over here --- action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 193176b..2b75466 100644 --- a/action.yml +++ b/action.yml @@ -150,9 +150,13 @@ runs: if: ${{ inputs.preview == 'true' }} id: build-components run: | - docx_file=$(ls ${{ inputs.root_path }}/docs/*.docx || echo NA) + docx_file=$(ls ./docs/*.docx 2>/dev/null | head -1 || true) + if [ -n "$docx_file" ]; then + docx_link="https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/$docx_file" + else + docx_link="NA" + fi bookdown_link=$(echo "https://htmlpreview.github.io/?https://raw.githubusercontent.com/$GITHUB_REPOSITORY/preview-${{ github.event.pull_request.number }}/${{ inputs.root_path }}/docs/index.html") - docx_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/$docx_file") zip_link=$(echo "https://github.com/$GITHUB_REPOSITORY/raw/preview-${{ github.event.pull_request.number }}/${{ inputs.root_path }}/website-preview.zip") echo "zip_link=$zip_link" >> $GITHUB_OUTPUT echo "bookdown_link=$bookdown_link" >> $GITHUB_OUTPUT From 69e7690a5840d06735beb9611e79e80e2c657486 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:02:51 -0400 Subject: [PATCH 06/10] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c54dd75..7602dae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Run render for Rmd - uses: ottrproject/ottr-preview@testweb + uses: ottrproject/ottr-preview@kweav-suppress-docx with: toggle_website: "rmd" root_path: test-rmd @@ -32,7 +32,7 @@ jobs: root_path: test-quarto - name: Run render for Rmd_web - uses: ottrproject/ottr-preview@testweb + uses: ottrproject/ottr-preview@kweav-suppress-docx with: toggle_website: "rmd_web" root_path: test-rmd_web From 3e61c5eafe0b46f4db64e3b20ce7526f54da3956 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:05:40 -0400 Subject: [PATCH 07/10] Update index.Rmd --- test-rmd_web/index.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-rmd_web/index.Rmd b/test-rmd_web/index.Rmd index 1d1f7eb..862153e 100644 --- a/test-rmd_web/index.Rmd +++ b/test-rmd_web/index.Rmd @@ -6,4 +6,4 @@ output: ### **About** -This is a test of rendering an Rmd for a website using the ottr-preview action. +This is a test of rendering an Rmd for a website using the ottr-preview action. Changes to the action may mean that there will be no docx file listed in the PR/preview comment hopefully. From d02cd432eb8625985a09e386f0a76bf4217d4b72 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:08:12 -0400 Subject: [PATCH 08/10] Update action.yml bring changes from kweav-suppress-docx branch over here --- action.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 2b75466..c121ac3 100644 --- a/action.yml +++ b/action.yml @@ -166,8 +166,8 @@ runs: echo ${{steps.commit.outputs.changes}} shell: bash - - name: Create or update comment - if: ${{ inputs.preview == 'true' }} + - name: Create or update comment (with docx file) + if: ${{ inputs.preview == 'true' && steps.build-components.outputs.docx_link != "NA" }} uses: peter-evans/create-or-update-comment@v2 with: comment-id: ${{ steps.fc.outputs.comment-id }} @@ -183,6 +183,22 @@ runs: _Updated at ${{ steps.build-components.outputs.time }} with changes from the latest commit ${{ steps.build-components.outputs.commit_id }}_ edit-mode: replace + - name: Create or update comment (without docx file) + if: ${{ inputs.preview == 'true' && steps.build-components.outputs.docx_link == "NA" }} + uses: peter-evans/create-or-update-comment@v2 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + Re-rendered previews from the latest commit: + - :eyes: Quick [preview of course website here](${{ steps.build-components.outputs.bookdown_link }}) \* + - :microscope: Comprehensive [download of the course website here](${{ steps.build-components.outputs.zip_link }}) + + \* note not all html features will be properly displayed in the "quick preview" but it will give you a rough idea. + + _Updated at ${{ steps.build-components.outputs.time }} with changes from the latest commit ${{ steps.build-components.outputs.commit_id }}_ + edit-mode: replace + - name: Comment if no changes if: ${{ inputs.preview == 'true' && steps.commit.outputs.changes == 'false' }} uses: peter-evans/create-or-update-comment@v2 From 7c94c7d100f9ecaf2fcf91b8655cecab4fe43875 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:08:36 -0400 Subject: [PATCH 09/10] Update test.yml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7602dae..c54dd75 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: fetch-depth: 0 - name: Run render for Rmd - uses: ottrproject/ottr-preview@kweav-suppress-docx + uses: ottrproject/ottr-preview@testweb with: toggle_website: "rmd" root_path: test-rmd @@ -32,7 +32,7 @@ jobs: root_path: test-quarto - name: Run render for Rmd_web - uses: ottrproject/ottr-preview@kweav-suppress-docx + uses: ottrproject/ottr-preview@testweb with: toggle_website: "rmd_web" root_path: test-rmd_web From 4779c50f974feb5deefef8a8c42fbad6db576584 Mon Sep 17 00:00:00 2001 From: Kate Isaac <41767733+kweav@users.noreply.github.com> Date: Mon, 16 Jun 2025 14:13:58 -0400 Subject: [PATCH 10/10] Update index.Rmd trigger PR stuff hopefully --- test-rmd_web/index.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-rmd_web/index.Rmd b/test-rmd_web/index.Rmd index 862153e..847f78f 100644 --- a/test-rmd_web/index.Rmd +++ b/test-rmd_web/index.Rmd @@ -6,4 +6,4 @@ output: ### **About** -This is a test of rendering an Rmd for a website using the ottr-preview action. Changes to the action may mean that there will be no docx file listed in the PR/preview comment hopefully. +This is a test of rendering an Rmd for a website using the ottr-preview action. Changes to the action may mean that there will be no docx file listed in the PR/preview comment hopefully. Should consider adding this testweb stuff for rmd_web as a clean PR possibly?