Skip to content

Commit

Permalink
hackday material
Browse files Browse the repository at this point in the history
  • Loading branch information
eeholmes committed Jan 7, 2025
1 parent 2467815 commit 4fada59
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ website:
href: tutorials/tutorial-5.qmd
- text: 'Advanced Reference Management with Zotero and Quarto'
href: tutorials/tutorial-6.qmd
- text: 'HackDay -- Make a book'
href: tutorials/tutorial-7.qmd
- text: <img width=100px>
- text: <img width=100px>
- text: <img src="/images/noaa_emblem_logo-2022.png" width=100px>
Expand Down
83 changes: 83 additions & 0 deletions tutorials/tutorial-7.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: HackDay -- Create a Quarto Book
---

::: {.callout-note title="Learning Objectives"}
1. Clone a Quarto book template
2. Edit the yaml to customize the book
3. Add content to your book
4. Put online via GitHub Pages
:::

## Copy the template

This part is done on GitHub.

1. Go to https://github.com/nmfs-opensci/NOAA-quarto-book
2. Follow the instructions (carefully) in the ReadMe: https://github.com/nmfs-opensci/NOAA-quarto-book/blob/main/README.md

## Clone your new GitHub repo.

This part is done on the JupyterHub or your local computer.

### JupyterHub

* https://nmfs-openscapes.2i2c.cloud/
* Use defaults (image and size of machine)

1. Authenticate to GitHub
* Open a terminal.
* Type `gh-scoped-creds`.
* Copy the code, click link and paste in.
* Click the link that appears and give the hub permission to push to your new repo (or all repos).
2. Open RStudio
* File > New Project > Version Control > Git
* Paste in `https://github.com/<your username>/<repo name>`

### On your local computer in RStudio

You must have already set up Git and GitHub Authentication to work with RStudio.

1. Open RStudio
* File > New Project > Version Control > Git
* Paste in `https://github.com/<your username>/<repo name>`

### On your local computer in GitHub Desktop

1. Open GitHub Desktop
* File > Clone repository
* Click the Git tab in the pop-up.
* Paste in `https://github.com/<your username>/<repo name>`
* Change where the directory will be made or note where it is being made.
2. Open RStudio
* File > New Project > Existing Directory
* Navigate to the directory created in step 1.

Note to push changes to GitHub you will need to either use GitHub Desktop or have set up RStudio to work with Git and GitHub.

## Edit the yaml

1. Open the new project for your book in RStudio.
2. Open `_quarto.yml`
3. Edit the meta data (title, authors, urls, etc)

## Swap in a new logo and favicon

1. Upload your image file
2. Edit the `_quarto.yml` to point to that image
3. Same for favicon

## Render your book

In RStudio.

1. Click the Build tab in the upper right panel of RStudio.
2. Click "Render Book". All formats or Html is fine.
3. Book should pop up in a new window.
* It didn't? Click on `_book`. Right click on `index.html` and select "Open in browser"






0 comments on commit 4fada59

Please sign in to comment.