Coder Social home page Coder Social logo

andrewheiss / nonprofitf22.classes.andrewheiss.com Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 6.0 133.11 MB

🌐 πŸ§‘β€πŸ« Website for an undergraduate-level introduction to nonprofits course, build with Quarto

Home Page: https://nonprofitf22.classes.andrewheiss.com/

R 38.17% Lua 1.91% TeX 3.71% SCSS 13.39% HTML 1.03% Shell 0.22% CSS 20.48% JavaScript 21.11%
r nonprofit-organizations nonprofits quarto teaching-materials

nonprofitf22.classes.andrewheiss.com's Introduction

Introduction to Nonprofits

PMAP 3210 β€’ Fall 2022
Andrew Heiss β€’ Andrew Young School of Policy Studies β€’ Georgia State University


Quarto + {targets} + {renv} + {xaringan} = magic! πŸͺ„


How to build the site

  1. Install RStudio version 2022.07.1 or later since it has a Quarto installation embedded in it. Otherwise, download and install Quarto separately.
  2. Open nonprofitf22.Rproj to open an RStudio Project.
  3. If it’s not installed already, R should try to install the {renv} package when you open the RStudio Project for the first time. If you don’t see a message about package installation, install it yourself by running install.packages("renv") in the R console.
  4. Run renv::restore() in the R console to install all the required packages for this project.
  5. Run targets::tar_make() in the R console to build everything.
  6. πŸŽ‰ All done! πŸŽ‰ The complete website will be in a folder named _site/.

{targets} pipeline

I use the {targets} package to build this site and all its supporting files. The complete pipeline is defined in _targets.R and can be run in the R console with:

targets::tar_make()

The pipeline does several major tasks:

  • Render xaringan slides to HTML and PDF: Quarto supports HTML-based slideshows through reveal.js. However, I created all my slides using {xaringan}, which is based on remark.js and doesn’t work with Quarto. Since I don’t have time to recreate my fancy template in reveal.js right now, I want to keep using {xaringan}.

    The pipeline dynamically generates targets for all the .Rmd files in /slides/ and renders them using R Markdown rather than Quarto.

    The pipeline then uses {renderthis} to convert each set of HTML slides into PDFs.

  • Build Quarto website: This project is a Quarto website, which compiles and stitches together all the .qmd files in this project based on the settings in _quarto.yml. See the Quarto website documentation for more details.

  • Upload resulting _site/ folder to my remote server: Quarto places the compiled website in a folder named /_site/. The pipeline uses rsync to upload this folder to my personal remote server. This target will only run if the UPLOAD_WEBSITES environment variable is set to TRUE, and it will only work if you have an SSH key set up on my personal server, which only I do.

The complete pipeline looks like this:

(This uses mermaid.js syntax and should display as a graph on GitHub. You can also view it by pasting the code into https://mermaid.live.)

graph LR
  subgraph Graph
    x9c20b8c56debbe9a(["deploy_script"]):::queued --> x78f3e0b711425f1c(["deploy_site"]):::queued
    x7aa56383a054e8ba(["site"]):::queued --> x78f3e0b711425f1c(["deploy_site"]):::queued
    x4a210bdf90796bca(["xaringan_files_files"]):::queued --> xf4774655f169db90["xaringan_files"]:::queued
    x4d31f5a49d5ae49f(["schedule_ical_file"]):::queued --> x7aa56383a054e8ba(["site"]):::queued
    x063edd335cc1b36f(["schedule_page_data"]):::queued --> x7aa56383a054e8ba(["site"]):::queued
    xccbb2c85646c611a["xaringan_pdfs"]:::queued --> x7aa56383a054e8ba(["site"]):::queued
    x60c212b45249134a["xaringan_slides"]:::queued --> x7aa56383a054e8ba(["site"]):::queued
    xf38d3f5e6365ad72(["workflow_graph"]):::started --> x6e52cb0f1668cc22(["readme"]):::queued
    x0751853b619def05["xaringan_html_files"]:::queued --> xccbb2c85646c611a["xaringan_pdfs"]:::queued
    xdf832f8e1f99baf2(["schedule_file"]):::queued --> x063edd335cc1b36f(["schedule_page_data"]):::queued
    xf4774655f169db90["xaringan_files"]:::queued --> x60c212b45249134a["xaringan_slides"]:::queued
    xdf832f8e1f99baf2(["schedule_file"]):::queued --> x35552a73efe9c59f(["schedule_ical_data"]):::queued
    x7a0d40becb063bda(["xaringan_html_files_files"]):::queued --> x0751853b619def05["xaringan_html_files"]:::queued
    x35552a73efe9c59f(["schedule_ical_data"]):::queued --> x4d31f5a49d5ae49f(["schedule_ical_file"]):::queued
    x60c212b45249134a["xaringan_slides"]:::queued --> x7a0d40becb063bda(["xaringan_html_files_files"]):::queued
  end

Licenses

Text and figures: All prose and images are licensed under Creative Commons (CC-BY-NC 4.0)

Code: All code is licensed under the MIT License.

nonprofitf22.classes.andrewheiss.com's People

Contributors

andrewheiss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.