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

Try out screenshot creator as a part of the new Leanpub set up #422

Merged
merged 55 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f787e87
Try out screenshot creator
cansavvy Jan 27, 2022
410751c
Fix spacing
cansavvy Jan 27, 2022
7e73ff4
Get rid of typo
cansavvy Jan 27, 2022
9136c51
fix argument spec
cansavvy Jan 27, 2022
f3391de
Fix git pat handling
cansavvy Jan 27, 2022
66c6b1e
Add copy over assets step
cansavvy Jan 27, 2022
c459c71
Try this
cansavvy Jan 27, 2022
96c74ed
Try installing just the packages we need
cansavvy Jan 27, 2022
bab1902
Add install of remotes
cansavvy Jan 27, 2022
9a45d8a
Try using devtools instead
cansavvy Jan 27, 2022
68000c7
try set environ
cansavvy Jan 27, 2022
b22f651
Try to install R first
cansavvy Jan 27, 2022
1e58a0a
Add prereqs
cansavvy Jan 27, 2022
9d69d48
Try rocker r-base
cansavvy Jan 28, 2022
dcf52a4
Put installations in script
cansavvy Jan 28, 2022
efc3bd5
Try different strategy
cansavvy Jan 28, 2022
2dfe364
Switch to tidyverse
cansavvy Jan 28, 2022
6437664
Make directory in bash
cansavvy Jan 28, 2022
18640f6
I guess I'm making this its own docker image
cansavvy Jan 28, 2022
917798d
This isn't working but I want it in case I come back to it
cansavvy Jan 28, 2022
fbaa199
Switch to wkhtmltopdf
cansavvy Jan 28, 2022
86e8a7e
Lets' try it
cansavvy Jan 28, 2022
46977ff
Trying leanbuild steps on their own dockerfile
cansavvy Jan 28, 2022
a1560df
Test build of leanbuild docker image
cansavvy Jan 28, 2022
2d7fda2
Try out webshot r package
cansavvy Jan 28, 2022
093cfd5
fix file path to script
cansavvy Jan 28, 2022
93e5da8
Oh. Actually fix it
cansavvy Jan 28, 2022
c68199a
Try installing webshot::install_phantomjs
cansavvy Jan 28, 2022
7c72880
Try installing phantomjs on its own first
cansavvy Jan 28, 2022
53d14f0
Set this up
cansavvy Jan 28, 2022
c4f0fb7
Build from jhudsl/course_template
cansavvy Feb 2, 2022
6ab69d4
Switch back to main dockerfile
cansavvy Feb 2, 2022
2aada9b
assets problem
cansavvy Feb 2, 2022
69c79c6
Merge remote-tracking branch 'origin/main' into cansavvy/leanbuild-if…
cansavvy Feb 3, 2022
b87cff2
It works!
cansavvy Feb 3, 2022
b67cf3d
Revert "assets problem"
cansavvy Feb 2, 2022
84964a1
Merge branch 'main' into cansavvy/leanbuild-iframes
cansavvy Feb 3, 2022
685619d
Merge branch 'main' into cansavvy/leanbuild-iframes
cansavvy Feb 4, 2022
9f2c8f6
Add markdown maker basics
cansavvy Feb 4, 2022
3d63182
Push this version before I delete things
cansavvy Feb 4, 2022
f75ecc1
Clean up
cansavvy Feb 4, 2022
44938fe
Delete the pdfs
cansavvy Feb 4, 2022
a64cdca
Reconfig with latest ottr package changes
cansavvy Feb 4, 2022
2c70c15
Turn on render again
cansavvy Feb 4, 2022
209c5be
Add PR instead
cansavvy Feb 4, 2022
ca570a6
Move copying step
cansavvy Feb 4, 2022
ddc2b49
Add an :: that was missing
cansavvy Feb 4, 2022
edc99fa
Fix arguments for getting pages url
cansavvy Feb 4, 2022
abbd023
misplaced quotes
cansavvy Feb 4, 2022
05e9bd7
Add make_book_txt = TRUE
cansavvy Feb 4, 2022
92e5081
It's working! Undo the commenting part
cansavvy Feb 4, 2022
7443fd4
Set base to main
cansavvy Feb 4, 2022
e118436
Revert "It's working! Undo the commenting part"
cansavvy Feb 4, 2022
854422b
rm manuscript folder
cansavvy Feb 4, 2022
30869a8
Just commit to main
cansavvy Feb 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .github/workflows/render-bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ jobs:
jhudsl/course_template \
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"

# We want a fresh run of the renders each time
- name: Copy over assets
run: cp -r assets/ docs/assets/

##### If you do not wish to host your course on Coursera, you can delete this section #####
# Run Coursera version
- name: Run Coursera version of render
Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/render-leanpub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ name: Render and publish Leanpub
on:
workflow_dispatch:
### UNCOMMENT THIS SECTION IF YOU WISH PREPARE YOUR COURSE FOR LEANPUB AUTOMATICALLY
# pull_request:
# branches: [ main ]
# types: [closed]
# paths:
# - '**.Rmd'
# - docker/*
# - assets/*
# - quizzes/*
# pull_request:
# branches: [ main ]
# type: [closed]
# paths:
# - '**.Rmd'
# - docker/*
# - assets/*
# - quizzes/*
######### END OF SECTION #########

jobs:
Expand All @@ -37,13 +37,17 @@ jobs:
# Run leanpub rendering
- name: Run the screenshot creation
run: |
chapt_urls=$(Rscript --vanilla scripts/get_chapter_urls.R \
chapt_urls=$(Rscript --vanilla scripts/make_screenshots.R \
--git_pat ${{ secrets.GH_PAT }} \
--repo $GITHUB_REPOSITORY)

# Run leanpub rendering
- name: Run ottr::bookdown_to_leanpub
run: Rscript -e "ottr::bookdown_to_leanpub(make_book_txt = TRUE)"
# Run Leanpub rendering
- name: Run ottr::bookdown_to_embed_leanpub
run: |
rm -r manuscript
Rscript -e "ottr::bookdown_to_embed_leanpub( \
chapt_img_key = 'resources/chapt_screen_images/chapter_urls.tsv', \
make_book_txt = TRUE)"

# Convert quizzes to Coursera format
- name: Convert quizzes to coursera
Expand All @@ -56,5 +60,5 @@ jobs:
git config --local user.name "GitHub Actions"
git add -A
git add --force manuscript/*
git commit -m 'Render leanpub' || echo "No changes to commit"
git commit -m 'Render Leanpub' || echo "No changes to commit"
git push origin main || echo "No changes to push"
Empty file modified assets/big-image.html
100644 → 100755
Empty file.
Empty file modified assets/dasl_main_image.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/dasl_main_image_short.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/dasl_thin_main_image.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/footer.html
100644 → 100755
Empty file.
Empty file modified assets/hideOutput.js
100644 → 100755
Empty file.
Empty file modified assets/itcr_arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/style.css
100644 → 100755
Empty file.
Empty file modified assets/style_coursera.css
100644 → 100755
Empty file.
Empty file modified assets/thin_main_image_stripe.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified assets/toc_close.css
100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ RUN Rscript -e "install.packages( \
'styler', \
'reticulate'))"

# Copy over git token and package list
COPY git_token.txt .
COPY github_package_list.tsv .

# 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 \
Expand Down
29 changes: 29 additions & 0 deletions docker/Dockerfile_ottr
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM jhudsl/course_template
LABEL maintainer="[email protected]"

# 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
17 changes: 0 additions & 17 deletions manuscript/01-intro.md

This file was deleted.

Loading