# Using GitBooks to create Open course materials

With the social restrictions put in place to combat the COVID-19 virus, many teachers are scrambling to transition their courses to online formats. One tool that can be very useful in this context, is the so-called GitBook. It is an oline “book” format, that can be hosted directly from a GitHub repository. I have some prior expertise benefiting from the advantages of using a GitBook, because I transitioned a course from proprietary software to R last year. Here is a GitBook I made about how to make a GitBook for Open Educational Materials.

## Why use a GitBook for teaching?

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 Materials

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?

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. Here is an example of such a book.

These 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 yourself

If you are convinced that this tool might benefit your teaching, I have prepared some materials to get you started. This is an educational GitBook about making an educational GitBook.. I made it as course material for the first OSCoffee session, next Friday April 3d. The OSCoffee sessions are brief educational sessions or discussions hosted by the Open Science Community Utrecht during the COVID-19 shutdown, to keep inspiring our support base throughout the Summer period!