OHI-Science/toolbox-training

Name: toolbox-training

Owner: Ocean Health Index - Science

Description: The Ocean Health Index Toolbox Training

Created: 2017-02-14 21:26:48.0

Updated: 2018-05-04 21:23:43.0

Pushed: 2018-05-04 21:23:42.0

Homepage: http://ohi-science.org/toolbox-training

Size: 1251

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ocean Health Index Toolbox Training materials

These materials are available as a book at http://ohi-science.org/toolbox-training.

Please clone or download https://github.com/OHI-Science/toolbox-demo to accompany this training.

To render this book: bookdown::render_book("index.Rmd", "bookdown::gitbook")

Many thanks to the creators of bookdown:

Publishing with the /docs folder

Here is how to publish this book using the docs/ folder (instead of using Travis-CI or some script to move content between branches like we did with _deploy.r).

In RStudio:

  1. In the root directory of your book, create a folder called docs (all lowercase)

  2. In _bookdown.yml, add a line that says output_dir: "docs" (no indentation)

  3. Check your .Rproj file (may have to open a separate text editor for this). Make sure that lines ~12 on say the following (replace whatever is there):

    eave: knitr
    X: pdfLaTeX
    
    AppendNewline: Yes
    pTrailingWhitespace: Yes
    
    dType: Website
    
  4. Quit RStudio. When you reopen, your “Build” tab in the top right pane should have a button that says “Build Book”

  5. Build your book by clicking the button or in the console: rmarkdown::render_site(encoding = 'UTF-8')

  6. Delete the _book folder if it exists (this is what _deploy.R used)

  7. Commit and push

On GitHub.com

  1. Go to your repo > Settings
  2. Scroll down to GitHub Pages
  3. Change “Source” to “master branch /docs folder”, click “save”
  4. Delete the “gh-pages” branch, if it exists (“Branches” is next to “commits” on the “Code” tab)

Back in RStudio

  1. Edit your book, rebuild, commit, and push and see the changes!

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.