aliquote.org

Publishing on Github

August 17, 2014

GitHub is not only for source code.

Publishing on GitHub

Github has long been the de facto platform to share and publish open-source code, notwithstanding the fact that it is becoming a dedicated host for reproducible research; see, e.g., The benefits of reproducible research: a public health example.

Now, there is also an increasing number of books or tutorials that are delivered through Github. For example, the source code for the beautiful Smooth CoffeeScript book is available on GitHub. The same applies for Eloquent Javascript, see the source code. Regarding the R statistical software, Hadley Wickham has long been developing and hosting his forthcoming book, Advanced R (Springer), on GitHub, and more recently he updated his Github account with a new title, Building R packages.

Gitbook

Enter Gitbook, which offers a fast and elegant way to publish version-controlled ebooks online or as PDF/ePUB. Editing is done with the lightweight Markdown markup language. There is a dedicated editor for the Desktop and a pretty Documentation Center, which is itself a Gitbook, with associated Github source repository.

On GitHub, we can find a Gitbook port of part of the LLVM Tutorial. The Pro Git book was edited using Gitbook, with translation in 10 languages (see code source).

Interestingly, there is now an R package that allows to use inline bibliographic citations (with the knitcitations package) and the R Markdown language (knitr): Gitbook with R Markdown.1 I should say that I came across this project some months ago (apparently, in April, if I refer to my Twitter feed, see below) but I hadn’t time to look at it seriously.

% grep gitbook *bag-of-tweets*
2014-04-30-bag-of-tweets-040.md:* jbryer: Some updates to Rgitbook #Rstats package adding support for knitcitations and other fixes for the update to gitbook. <http://t.co/wuHnoo61nq> (24 Apr)
2014-04-30-bag-of-tweets-040.md:* jbryer: New Rgitbook #Rstats package
available <http://t.co/xLZw5fYgwr> @GitBookIO (22 Apr)

  1. For what is worth, the current master branch will not work on OS X with the latest node.js/npm programs. This is because in checkForGitbook.R there is an instruction that reads if(system('npm', ignore.stdout=TRUE) != 0), which clearly doesn’t work with node.js > 0.10 (system() will return 1 in this case). Several patches were proposed but none have been integrated in Jason Bryer’s branch. So, I installed renkun-ken/Rgitbook version, which fixed the issue↩︎

See Also

» Markdown and slideshow » Working with tables and Pandoc » Markdown everywhere » Coffescript » Gmail seasonal cleaning