Giter VIP home page Giter VIP logo

bookdown-template's Introduction

Template

The original template was from RStudio but required some changes to make it work as html and be published through GitHub. I made this work for a repository about Professional Registration and although I attempted to replicate the changes I made there, I got muddled so starting again I have just taken all the files from my repository to make this template.

Packages required

install.packages("bookdown")
#install.packages("remotes")
remotes::install_github("rstudio/bslib")

Changes to make

In file _output.yml the following can be changed:

      before: |
        <li><a href="./">Bookdown Template</a></li>
      after: |
        <li><a href="https://github.com/rstudio/bookdown" target="blank">Published with bookdown</a></li>
    edit: https://github.com/Lextuga007/bookdown-template%s

Note that the %s is always required in this url.

Render the book

rmarkdown::render_site(encoding = 'UTF-8')

Or use the Build Book button that appears with the Build tab (where the tabs read Environment, History, Connections and maybe Git if that's connected.)

GitHub pages

To publish through GitHub go to Settings/Pages and change Source to main and /root. It will take a few minutes to load the pages.

GitHub Action

The file that creates the action can be found in the folder .github\workflows and works with a branch that is created using the script (in the Terminal):

git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m 'Initial gh-pages commit'
git push origin gh-pages
git checkout main

Source via Matt Dray's blog on GitHub Actions and packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.