swcarpentry / DEPRECATED-bc

DEPRECATED: This repository is now frozen - please see individual lesson repositories.
Other
299 stars 382 forks source link

Makefile for rendering R lessons from R Markdown #598

Closed jdblischak closed 10 years ago

jdblischak commented 10 years ago

To fix #524.

This is the start to automating the process of knitting R Markdown files and rendering them to html. It preserves the original YAML header contained in the R Markdown file so that it can subsequently be built with Jekyll.

Currently only the first two novice R lessons (00 and 01) are updated in this PR because a bug in lesson 02 prevents it from knitting. I'll continue updating once this approach is approved. To preview the result, run make site and open _site/novice/r/00-first-timers.html and/or _site/novice/r/00-starting-with-data.html.

Lastly, I also centralized the knitr options by creating one file that all the lessons source. This makes it easier for an instructor to make a global change to all the lessons.

cboettig commented 10 years ago

Hmm... this workflow still seems a little more opaque then it need be. Just added a comment on #524

What's the relationship between the gh-pages branch and the master branch for the repo? (e.g. in a typical jekyll setup I'd expect to see only a gh-pages branch, or to see the jekyll sources on master and the html output on gh-pages, for instance, if using plugins/custom markdown parsers that mean Github cannot build the site automagically. Here you seem to have the extra step of processing the ipython-notebook / Rmd files before Jekyll cranks on them, but I'm not quite sure when that happens. There's a lot of common files across the two branches, but the branches seem rather diverged which suggests that gh-pages one is just being used for hosting web files and isn't supposed to ever be merged against other branches...)

jdblischak commented 10 years ago

My understanding is that the master and gh-pages branch are meant to be quite similar. The master branch contains all the latest development. The gh-pages branch in the bc repo doesn't get updated as frequently because it is not really needed anymore. This is because the material is served from the SWC Lessons page instead of through GitHub. When one runs a bootcamp, you create a new repo, and then pull the contents of the master branch of the bc repo into the gh-pages of your bootcamp specific repo. This then allows you to serve the lessons through GitHub to the bootcamp attendees. Hopefully that makes some sense. It is explained in more detail in the README of the bc repo.

Someone please correct me if my understanding of the different branches is misinformed.

gvwilson commented 10 years ago

We've been treating gh-pages as the "release" branch, and "master" as the "next release" - we merge PRs into master, and every couple or three months we merge master into gh-pages. People who are creating bootcamps use the gh-pages (stable) branch as their starting point. We're stuck with the gh-pages name, but yeah, we should have renamed 'master' to 'development' or something like that.

cboettig commented 10 years ago

Ah that makes perfect sense, thanks. (I misread the readme and thought it said to clone the gh-pages branch of the bc repo: since the clone call doesn't explicitly say "master" and you are cloning into a gh-pages branch I mistakenly thought that meant git would clone from the gh-pages branch, silly me.)

Thanks for pointing out that the lessons live elsewhere. If nothing meaningful is being hosted off of http://swcarpentry.github.io/bc/ , is there any reason to keep the gh-pages branch around on this repo? Oh nevermind, I see Greg has just answered that question. That makes perfect sense.

On Tue, Jul 22, 2014 at 1:50 PM, John Blischak notifications@github.com wrote:

My understanding is that the master and gh-pages branch are meant to be quite similar. The master branch contains all the latest development. The gh-pages branch in the bc repo doesn't get updated as frequently because it is not really needed anymore. This is because the material is served from the SWC Lessons page http://software-carpentry.org/lessons.html instead of through GitHub. When one runs a bootcamp, you create a new repo, and then pull the contents of the master branch of the bc repo into the gh-pages of your bootcamp specific repo. This then allows you to serve the lessons through GitHub to the bootcamp attendees. Hopefully that makes some sense. It is explained in more detail in the README of the bc repo.

Someone please correct me if my understanding of the different branches is misinformed.

— Reply to this email directly or view it on GitHub https://github.com/swcarpentry/bc/pull/598#issuecomment-49798841.

Carl Boettiger UC Santa Cruz http://carlboettiger.info/