Skip to content

Commit

Permalink
Add start to Coursera stuffs (#171)
Browse files Browse the repository at this point in the history
* Add start to Coursera stuffs

* Run coursera renderer!

* Re-run render coursera with correct output file names

* Make sure bookdown still renders fine

* Add diagram to getting_started.d

* Add more info to getting started

* Add info on how to stop Coursera render

* Hmm. This makes it take forever to load apparently.

* Testing

* Try without html_document() function

* Add coursera work

* Add different version

* Get rid of redundant header

* Copy over files because that's what I gotta do I guess

* So close

* commit this solution for now

* Force videos by just putting links wherever knitr::include_url is used with youtub (#175)

* Videos still broken

* It's not a great solution but it is a solution

* Get rid of stray file
  • Loading branch information
cansavvy authored Sep 2, 2021
1 parent 2cbcb49 commit a405def
Show file tree
Hide file tree
Showing 24 changed files with 750 additions and 84 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/render-bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ jobs:
jhudsl/course_template \
Rscript -e "bookdown::render_book('index.Rmd')"
##### 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
run: |
docker run \
--mount type=bind,target=/home/rstudio,source=$PWD \
jhudsl/course_template \
Rscript --vanilla "scripts/render_all_coursera.R"
##### End of Coursera rendering section ########################################

# Commit the rendered bookdown files
- name: Commit rendered bookdown files
run: |
Expand Down
1 change: 0 additions & 1 deletion 01-intro.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Course Title"
output: html_document
---


Expand Down
27 changes: 13 additions & 14 deletions 02-chapter_of_course.Rmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: "Chapter of course"
output: html_document
---


Expand Down Expand Up @@ -43,7 +42,7 @@ Here's a subheading and some text in this subsection!

### Code examples

You can demonstrate code like this:
You can demonstrate code like this:

```{r}
output_dir <- "code_output"
Expand All @@ -52,7 +51,7 @@ if (!dir.exists(output_dir)) {
}
```

And make pretty plots too:
And make pretty plots too:

```{r}
iris %>%
Expand All @@ -61,7 +60,7 @@ iris %>%
theme_bw()
```

You can also save these plots to file:
You can also save these plots to file:

```{r}
ggsave(file.path(output_dir, "test_ggplot2.png"))
Expand All @@ -70,48 +69,48 @@ ggsave(file.path(output_dir, "test_ggplot2.png"))
### Image example


How to include a Google slide. It's simplest to use the `leanbuild` package:
How to include a Google slide. It's simplest to use the `leanbuild` package:

```{r, fig.align='center', echo = FALSE, fig.alt= "Major point!! example image"}
leanbuild::include_slide("https://docs.google.com/presentation/d/1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ/edit#slide=id.gcc4fbee202_0_141")
```

But if you have the slide or some other image locally downloaded you can also use html like this:
But if you have the slide or some other image locally downloaded you can also use html like this:

<img src="resources/images/02-chapter_of_course_files/figure-html//1YmwKdIy9BeQ3EShgZhvtb3MgR8P6iDX4DfFD65W_gdQ_gcc4fbee202_0_141.png" title="Major point!! example image" alt="Major point!! example image" style="display: block; margin: auto;" />


### Video examples

You can use `knitr::include_url()` like this:
You can use `knitr::include_url()` like this:

```{r}
knitr::include_url("https://www.youtube.com/embed/VOCYL-FNbr0")
```

OR this works:
OR this works:

<iframe src="https://www.youtube.com/embed/VOCYL-FNbr0" width="672" height="400px"></iframe>

### Links to files

This works:
This works:

```{r, fig.align="center", echo=FALSE}
knitr::include_url("https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf", height = "800px")
```

Or this:
Or this:

[This works](https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf).

Or this:
Or this:

<iframe src="https://www.messiah.edu/download/downloads/id/921/Microaggressions_in_the_Classroom.pdf" width="672" height="800px"></iframe>

### Links to websites

Examples of including a website link.
Examples of including a website link.

This works:

Expand All @@ -121,9 +120,9 @@ knitr::include_url("https://yihui.org")

OR this:

![Another link](https://yihui.org)
![Another link](https://yihui.org)

OR this:
OR this:

<iframe src="https://yihui.org" width="672" height="400px"></iframe>

Expand Down
4 changes: 1 addition & 3 deletions About.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
---
title: "about"
output: html_document
title: "About"
---

# About the Authors {-}


**Author Name** is a Blank in the Blank at the Blank.

1 change: 1 addition & 0 deletions _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rmd_files: ["index.Rmd",
"02-chapter_of_course.Rmd",
"About.Rmd"]
new_session: yes
bibliography: [book.bib, packages.bib]
delete_merged_file: true
language:
ui:
Expand Down
Loading

0 comments on commit a405def

Please sign in to comment.