Skip to content

Commit

Permalink
Polish Examples in Rmds (#426)
Browse files Browse the repository at this point in the history
* Echo false in examples

* Updating wiki
  • Loading branch information
cansavvy authored Feb 3, 2022
1 parent edfcce0 commit fe69ebe
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 56 deletions.
16 changes: 3 additions & 13 deletions .github/automatic-issues/git-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,9 @@ It's important that these are set up and named exactly what they are below in or

To set up these repository secrets, on your repository's main Github page, go to `Settings` and scroll down to see `Secrets` on the left side menu bar.

For each new secret, click the `New repository secret` button and set each as follows, clicking `Add secret` as you fill each in appropriately:

- [ ] Set `DOCKERHUB_USERNAME`
`Name`: `DOCKERHUB_USERNAME`
`value`: put your login username for https://hub.docker.com/

- [ ] Set `DOCKERHUB_TOKEN`
`Name`:`DOCKERHUB_TOKEN`
`value`: put a access token for Dockerhub which you can create this by following [these instructions](https://docs.docker.com/docker-hub/access-tokens/#create-an-access-token).

- [ ] Set `GIT_TOKEN`
`Name`: `GIT_TOKEN`
`value`: A personal access token [following these instructions](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token).
- [ ] Set `GH_PAT`
`Name`: `GH_PAT`
`value`: A personal access token [following these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token).
Underneath `Select scopes`, check both `repo` and `workflow`.
Then copy the PAT and save as the value.

Expand Down
30 changes: 17 additions & 13 deletions .github/automatic-issues/set-repo-settings.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@

For more information on these settings see instructions in the [getting started GitHub wiki pages](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings).

### Needed settings:
For more information on these settings see instructions in the [getting started GitHub wiki pages](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course).

- [ ] This course repository is set to `public`.
- [ ] [Add the `jhudsl-robot` as a collaborator to your repository.](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings#add-jhudsl-robot-as-a-collaborator).
- [ ] [GH_PAT has been set up as a GitHub secret](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token)

#### Turn on GitHub pages
- [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`.
- [ ] Check `Enforce HTTPS`.
- [ ] GitHub pages is turned on
- [ ] Go to `Settings` > `Pages`. Underneath `Source`, choose `main` for the branch and select the `docs` folder. Then click `Save`.
- [ ] Check `Enforce HTTPS`.

#### Set protections for main branch
\* Don't set these settings right away! Wait a few minutes after starting your repository.
- [ ] [Github secret `GH_PAT` has been set](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#6-set-up-your-github-personal-access-token)
`Name`: `GH_PAT`
`value`: A personal access token [following these instructions](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-token).
Underneath `Select scopes`, check both `repo` and `workflow`.
Then copy the PAT and save as the value.

- [ ] `main` branch has been set up:
- [ ] `Require pull request reviews before merging` box is checked.
- [ ] `Require status checks to pass before merging` box is checked.
- [ ] Underneath that `Require branches to be up to date before merging` box is checked.
- [ ] Click `Save` at the bottom of the page!
- [ ] [Set branch protections settings](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#9-set-up-branch-rules)
- [ ] `main` branch has been set up:
- [ ] `Require pull request reviews before merging` box is checked.
- [ ] `Require status checks to pass before merging` box is checked.
- [ ] Underneath that `Require branches to be up to date before merging` box is checked.
- [ ] Click `Save` at the bottom of the page!
29 changes: 15 additions & 14 deletions .github/automatic-issues/templates-to-edit.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@

[Follow the Wiki instructions here](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-files#setting-up-the-repository) for details on how to complete the items in this issue.
[Follow the Wiki instructions here](https://github.com/jhudsl/OTTR_Template/wiki/Start-editing-your-course) for details on how to complete the items in this issue.

The following files need to be edited to get this new course started!

### Picking a style

See more [about customizing style on this page in the guide](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style).
By default this course template will use the jhudsl data science lab style. However, you can customize and switch this to another style set.

#### Using a style set

[Read more about the style sets here](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style#using-a-style-set).

- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`.
- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository.
- [ ] [Create a pull request](https://github.com/jhudsl/OTTR_Template/wiki/About-pull-request-review) with these changes, and double check the rendered preview to make sure that the style is what you are looking for.

### Files that need edited upon creating a new course.

- [ ] `README.md` - Fill in all the `{ }`.
Expand All @@ -28,6 +15,20 @@ By default this course template will use the jhudsl data science lab style. Howe
- [ ] `_bookdown.yml` - The list of Rmd files that need to be rendered needs to be updated. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Publishing-with-Bookdown).
- [ ] `book.bib` - any citations need to be added. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Citations).


### Picking a style

See more [about customizing style on this page in the guide](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style).
By default this course template will use the jhudsl data science lab style. However, you can customize and switch this to another style set.

#### Using a style set

[Read more about the style sets here](https://github.com/jhudsl/OTTR_Template/wiki/Change-Title-&-Customize-style#using-a-style-set).

- [ ] On a new branch, copy the `style-sets/<set-name>/index.Rmd` and `style-sets/<set-name>/_output.yml` to the top of the repository to overwrite the default `index.Rmd` and `_output.yml`.
- [ ] Copy over all the files in the `style-sets/<set-name>/copy-to-assets` to the `assets` folder in the top of the repository.
- [ ] [Create a pull request](https://github.com/jhudsl/OTTR_Template/wiki/Start-editing-your-course#getting-started-with-the-github-workflow) with these changes, and double check the rendered preview to make sure that the style is what you are looking for.

### Files that need to be edited upon adding new packages that the book's code uses:

- `docker/Dockerfile` needs to have the new package added so it will be installed. See [instructions](https://github.com/jhudsl/OTTR_Template/wiki/Using-Docker#starting-a-new-docker-image).
Expand Down
4 changes: 2 additions & 2 deletions .github/automatic-issues/update-enrollment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ We are working on adding more features and smoothing out bugs as we go.

If you want to receive updates from the original template to your course template, you will need to enroll this repository to the template updates by adding it to the `sync.yml` file.

- [ ] [Follow these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Receiving-template-updates#how-to-enroll-a-repository-to-receive-template-updates) to enroll your course repository to receive these updates.
- [ ] [Follow these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#10-enroll-your-repository-for-ottr-updates) to enroll your course repository to receive these updates.

- [ ] [Ensure that you have followed these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Setting-up-your-repository-settings#add-jhudsl-robot-as-a-collaborator) to add the `jhudsl-robot` as a collaborator to your repository.
- [ ] [Ensure that you have followed these instructions](https://github.com/jhudsl/OTTR_Template/wiki/Start-a-new-course#5-add-jhudsl-robot-as-a-collaborator) to add the `jhudsl-robot` as a collaborator to your repository.
8 changes: 0 additions & 8 deletions .github/workflows/starting-course.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ jobs:
content-filepath: .github/automatic-issues/templates-to-edit.md
labels: automated training issue

# Issue for what github secrets that need to be set
- name: New Course - Set Github Secrets
uses: peter-evans/create-issue-from-file@v2.3.2
with:
title: New Course - Set Github Secrets
content-filepath: .github/automatic-issues/git-secrets.md
labels: automated training issue

# Issue for how to enroll repo for updates
- name: New Course - Template Update Enrollment
uses: peter-evans/create-issue-from-file@v2.3.2
Expand Down
16 changes: 10 additions & 6 deletions 02-chapter_of_course.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# A new chapter
# A new chapter

*If you haven't yet read the getting started Wiki pages; [start there](https://github.com/jhudsl/OTTR_Template/wiki/Getting-started)

Expand Down Expand Up @@ -63,7 +63,6 @@ dev.off()

### Image example


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"}
Expand All @@ -74,12 +73,17 @@ But if you have the slide or some other image locally downloaded you can also us

<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:
To show videos in your course, you can use markdown syntax like this:

```{r}
[A video we want to show](https://www.youtube.com/embed/VOCYL-FNbr0)

Alternatively, you can use `knitr::include_url()` like this:
Note that we are using `echo=FALSE` in the code chunk because we don't want the code part of this to show up.
If you are unfamiliar with [how R Markdown code chunks work, read this](https://rmarkdown.rstudio.com/lesson-3.html).

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

Expand Down Expand Up @@ -109,7 +113,7 @@ Examples of including a website link.

This works:

```{r, fig.align="center"}
```{r, fig.align="center", echo=FALSE}
knitr::include_url("https://yihui.org")
```

Expand Down

0 comments on commit fe69ebe

Please sign in to comment.