Search code examples
githubgithub-pagesbookdown

How to use bookdown.org with github?


I am trying to create a book on Github and honestly I don't have the time to learn how to code and dig into all the new terminology/technology and learn the in and outs of Github as it's really not user-friendly.

All the tutorials are too dense and not suited for beginners. I just want to generate content for my book. How can I do this? I'm pretty good at just taking a template and adapting it to my needs, but I can't even get a template to work.

  • I've installed the bookdown package in R and have opened up the sample book in R. How do I get this sample book onto Github website? I just uploaded all the files and when I go to my website, it just takes me to README.md
  • I am using Github through my browser and don't plan on installing whatever Github software there is and all that kind of stuff. I really don't have time to dig into how to use Github. So any tutorial will require me using Github through the browser.
  • When writing content for my book, is there a way to do it on the Github, or is doing it in Rstudio the easiest way?
  • I don't have much desire to upload my book to bookdown.org. Can I still build my website on github?
  • Do I need to convert Rmd files to md files? How do I do that?

There are plenty of books out there on Github (bookdown.org show cases many). I believe you are able to view the files/code and what not on Github, so it may be pretty easy to just grab a couple necessary files there. I don't know which ones are important, and even if I did, I don't know how to get it to work with my Github.


Solution

  • You can fork the rstudio/bookdown-demo and make it your own GitHub repository.

    From there, follow yihui/bookdown/get-started.html, with, at a minimum:

    1. Download the GitHub repository https://github.com/rstudio/bookdown-demo as a Zip file, then unzip it locally.
      So no need for "Git/GitHub software" there.
    2. Install the RStudio IDE. Note that you need a version higher than 1.0.0. Please download the latest version if your RStudio version is lower than 1.0.0.
    3. Install the R package bookdown:
       # stable version on CRAN
       install.packages('bookdown')
       # or development version on GitHub
       # devtools::install_github('rstudio/bookdown')
      
    4. Open the bookdown-demo repository you downloaded in RStudio by clicking bookdown-demo.Rproj.
    5. Open the R Markdown file index.Rmd and click the button Build Book on the Build tab of RStudio.

    Try that with a minimal example like yihui/bookdown-minimal