A GitBook Example for Teaching
2020-04-21
Chapter 1 About GitBooks
A GitBook is a useful tool for creating (open?) educational resources. It is an online “book” format, that can be hosted directly from a GitHub repository. You are currently reading a GitBook designed to help you get started creating your own educational GitBooks for your courses (how meta!). It does this in two ways: By explaining how to create GitBooks, and by serving as a template that you can copy and edit, instead of having to start from scratch. This template GitBook has all the settings that I consider to be useful for educational GitBooks, but you can always customize it.
I will focus specifically on GitBooks that are made in Rstudio, using the rmarkdown
markup language, rendered using the bookdown
package, and hosted on GitHub. If you want to get started, skip ahead to Chapter 2; if you need more convincing, keep reading below.
1.1 Why use a GitBook for teaching?
To spead the workload
My challenge was that I had to translate all tutorial instructions from proprietary software to R, and there was not enough time to complete this task before the course commenced. By making the tutorial instructions available in this GitBook, I was able to continue translating tutorial instructions while the semester was ongoing, and push updates to GitHub in time for each session, which were immediately available to all students. The parallel with the current situation is that some courses are now forced to start teaching in an online format, without having enough time to completely prepare. By using a GitBook, you can spread out the workload of preparing your materials across the semester. This is the finished GitBook
To contribute or use existing Open Educational Resources
Another key advantage of using a GitBook is, that you can easily make your course materials available for others to use under an open access license, or perhaps you can use an existing GitBook from the internet and adapt it for your own uses. GitBooks can be easily duplicated and adapted, just like any other project hosted on GitHub. Contributing Open Educational Materials can help reduce the workload on teachers around the world, and can improve the quality of the materials used thanks to online collaborating and feedback.
To benefit from formatting advantages
GitBooks also have two formatting advantages over classic PDF or Word files. First, they are Rmarkdown files, and can thus include blocks of R (or Python) code that can be evaluated, and whose results are rendered to the file. Second, they are interactive web pages, and as such, can have dynamic features (such as answers to assignments that can be hidden, or boxes where students can fill out an answer to be checked). Additionally, other web pages or interactive apps can be embedded within the page. So whereas a traditional document is static, GitBooks can be interactive.
How do GitBooks work?
GitBooks consist of an Rstudio project, with several Rmarkdown files containing the chapters of the book. Inside Rstudio, users can press a “Build Book” button, which renders all of these chapters to a nicely formatted HTML book (and a PDF file for users to download). Users can push the finished book to a GitHub repository, and indicate on GitHub that the book should be hosted on GitHub pages. Voilà!
Getting started
If you are convinced that this tool might benefit your teaching, your first point of action is to prepare your system for creating GitBooks (Chapter 2). After that, you can get a copy of this GitBook as a template (Chapter 3). Then, you can start tweaking it for your own course!