diff --git a/.Rbuildignore b/.Rbuildignore index c50c169..f7b2200 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,11 +1,23 @@ +^doc$ +^Meta$ +^CRAN-RELEASE$ ^.*\.Rproj$ ^\.Rproj\.user$ -^\.travis\.yml$ -^\.gitlab-ci\.yml$ -^LICENCE$ -^LICENSE\.R?md$ ^README\.R?md$ ^README-.*\.(png|jpg|jpeg|pdf)$ -^inst/tests/.*$ +^README_files/.*$ +^LICENCE$ +^LICENSE\.R?md$ +^\.travis\.yml$ +^\.gitlab-ci\.yml$ +^raw_data/.*$ +^prep_tools/.*$ +^cran-comments\.md$ +^\.github$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^foo/.*$ +^CRAN-SUBMISSION$ ^app\.R$ ^\.github$ diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..c9f0165 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 13c9ae6..49ba885 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,54 @@ -*.Rproj +# +# RStudio project files +# .Rproj.user/ +*.Rproj + +# +# R files +# .Rhistory .RData .Ruserdata -~*.xls* -~*.doc* -.Rproj.user +# +# R package generated files +# +inst/doc +docs/ +doc +Meta + +# +# Backup files +# +*.bak + +# +# LaTeX files +# +*.aux +*.bbl +*.glo +*.gls +*.glg +*.idx +*.ilg +*.lof +*.log +*.lot +*.toc +*.out +*.synctex.gz + +# +# Office temp files +# +~$* +*~ +*.tmp + +/foo/ +/CRAN-RELEASE +/doc/ +/Meta/ diff --git a/README.Rmd b/README.Rmd index cf4566a..5572926 100644 --- a/README.Rmd +++ b/README.Rmd @@ -20,7 +20,8 @@ gh_url <- httr::build_url(purl) [![CRAN Status Badge](https://www.r-pkg.org/badges/version-last-release/kayaExplorer)](https://cran.r-project.org/package=kayaExplorer) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/workflows/R-CMD-check/badge.svg)](https://github.com/jonathan-g/kayaExplorer/actions) +[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml) +[![pkgdown](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml) **GitLab:** [![Build Status](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/badges/main/build.svg)](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/commits/main) diff --git a/README.md b/README.md index dfce689..d75430d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Badge](https://www.r-pkg.org/badges/version-last-release/kayaExplorer)](https://cran.r-project.org/package=kayaExplorer) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/workflows/R-CMD-check/badge.svg)](https://github.com/jonathan-g/kayaExplorer/actions) +[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml) +[![pkgdown](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml) **GitLab:** [![Build Status](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/badges/main/build.svg)](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/commits/main) diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..14559d6 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,41 @@ +destination: docs +url: https://jonathan-g.github.io/kaya-explorer + +home: + title: Kaya Identity Data for Nations and Regions + description: > + A Shiny-based explorer for Kaya identity. Loads data from the kayadata + package and provides an interactive shiny app for exploring the data: + choose a country or region and examine trends in the Kaya variables + (population, gross domestic product, primary energy consumption, and + carbon dioxide emissions), compare historical trends to the implied trends + necessary to hit decarbonization policy targets (e.g., 70% reduction of + emissions by 2050). Also allows the user to explore the fuel mix that + different countries and regions use to supply their energy needs. + strip_header: false + +authors: + Jonathan Gilligan: + href: https://www.jonathangilligan.org + +development: + mode: auto + +reference: + - title: Interactive Shiny app + desc: Interactive app to explore Kaya identity data and its implications for + climate policy. + contents: + - launch_kaya_explorer + - kaya_app + - title: Utility functions + desc: Miscellaneous utility functions + contents: + - set_debug + - c_to_co2 + - co2_to_c + - title: internal + contents: + - kayaExplorer-package + +