Dear all,

This week we’ll lear how to let GitHub render your html files, how to host a free, easily maintainable personal web page and how to deploy ‘simple’ webapps.

Best,

Gerko


1 GitHub Pages with Jekyll

GitHub Pages is a facility to host websites directly from your GitHub repositories. The content can be served amongst other formats as standard html or as markdown and GitHub Pages will take care of rendering the content to the device. This makes it very straightforward for developers to publish and maintain personal websites or project websites directly from the GitHub repository. Moreover, when GitHub project repositories contain html files, by default, these files will be shown as raw user content. When a repository is published as a GitHub Page, the html or markdown content is automatically rendered and served as a compiled document - please note that rmarkdown specific facilities, such as rendering R-code, can only be compiled from within R-studio.

The GitHub Pages site walks you through creating personal and project sites from scratch. The back-end of GitHub Pages is Jekyll, an open-source static site generator. Jekyll allows for advanced customization and styling through themes. The standard Jekyll functionality and theming that is offered by GitHub will serve most users fine. However, Jekyll is written in Ruby and customizing your websites beyond the standard functionality offerd by GitHub requires some effort in coding Ruby. Both GitHub and Jekyll walk you through many of these codes executions in step-by-step instructions. Have a look at this link to view some examples of great GitHub pages.

To learn about using GitHub Pages, I suggest you take the following steps

  1. Go through this link to create a personal website (a username.github.io page)
  2. Then create a project website - you can use the same link
  3. Use the theme chooser to customize your page’s appearence

For more advanced customizibility, have a look at the following links


2 Alternative to Jekyll

I personally prefer hugo over Jekyll for personal webpages. hugo is even more minimalistic to maintain as it is fully markdown and yaml (e.g. rmarkdown’s header is yaml) based. Best of all, hugo integrates seamlessly into the git workflow. Use the hugo quickstart to set up your first hugo page locally.


3 Shiny web apps

Shiny is an R package that makes it easy to build interactive web apps straight from R. You can host standalone apps on a webpage or embed them in rmarkdown documents and dashboards. If you like to browse around in the wonderful world that is Shiny, this link provides you with a great overview.

To publish your Shiny app in a simple manner, there are two classes of options: one class that requires the user to have Shiny installed on their machine (e.g. on GitHub) and one class that does not require the user to have Shiny installed (e.g. shinyapps.io). Of course, there are more options to deploy Shiny web apps, but they require you to host your own Shiny server on your personal domain.

To create a Shiny app from R, you need to provide two documents: a user-interface (ui) component and a server instruction set. With the Shiny package in R, the ui and server components are combined and the corresponding html code is generated and compiled for you. Normally, this would require you to have advanced knowledge and skills about servers, interfaces and html, but with Shiny this process is extremely simplified into an R programming scenario.

To learn about using Shiny to create web-apps, I suggest you take the following steps

  1. RStudio offers a quiz that tests your R proficiency yo see whether you are ready for Shiny. I suggest you take it and, if you do not know all the answers, use that knowledge later on to debug problems with Shiny.
  2. Go through this \(2 \frac{1}{2}\) hour tutorial. If you prefer a written tutorial, I suggest you take this one. However, the written tutorial is less comprehensive than the video tutorial. For the most comprehensive overview, see this book under development.
  3. Create a shinyapps.io account - a free one will do
  4. Follow the steps given by shinyapps.io to connect your RStudio installation to shinyapps throught the rsconnect package in R
  5. Create a Shiny app and publish it to shinyapps.io

4 Exercise

Do the following before January 14, 2019:

  1. Create a personal Page on GitHub that showcases you. Pay attention to e.g.
  • who are you
  • what do you do (e.g. expertise, service, product)
  • where people may find you (GitHub, Company page, facebook, G+, twitter, etc.)
  • accomplishments/publications/qualifications/skills etc.
  • a detailed curriculum vitae
  1. Publish a Shiny app. If your app is subject to sensitive data or non-disclosure, I suggest you use a private GitHub repo to host your app. Otherwise, use shinyapps.io.

I’ve set the deadline to January 15th to allow you to work towards the final deliveries for this course such that you can avoid duplicate work. Do not hesitate to ask for help.

All the best,

Gerko