Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing CREDITS #102

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions .github/workflows/quarto-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,18 @@ jobs:
env:
QUARTO_PROFILE: html
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check chromium
# hack from https://github.com/quarto-dev/quarto-actions/issues/45
run: |
echo $(which chromium-browser)
$(which chromium-browser) --headless https://www.chromestatus.com

- name: Render PDF
uses: quarto-dev/quarto-actions/render@v2
with:
to: pdf
path: .
env:
QUARTO_PROFILE: pdf
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Render PDF
# uses: quarto-dev/quarto-actions/render@v2
# with:
# to: pdf
# path: .
# env:
# QUARTO_PROFILE: pdf
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Manually Render PDF
run: quarto render --profile pdf --output-dir _book

# Debug: List files after rendering PDF
- name: List files after rendering PDF
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ dev_*
*_cache/
_site/
_book/
README_files/
capacity_files/
consumption_files/
generation_files/
prices_files/
*.html
*.aux
*.lof
*.log
*.lot
*.tex
*.toc

node_modules/

Expand Down
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
# AETR Web Book
Preliminary Alaska Electricity Trends Report as a web book.

Preliminary Alaska Electricity Trends Report as a web book.

## Preview and Render Locally

### Prepare the environment

Rendering this web-book requires R (>=4.4.0) and some R packages.

1. Install R from [The Comprehensive R Archive Network](https://cran.r-project.org) using the correct method for your operating system.

2. Install OpenSSL, which is required for one of the packages.

3. The [Barlow font (Regular and Bold)](https://github.com/google/fonts/blob/main/ofl/barlow/) must be installed on your machine. This will be different for different operating systems.

1. For Macs, follow the instructions for [installing fonts via Font Book](https://support.apple.com/guide/font-book/install-and-validate-fonts-fntbk1000/mac)

2. For Linux, manually perform the commands listed in this project's [GitHub Workflow](https://github.com/eldobbins/aetr-web-book-2024/blob/b3c9762e4528243bef33a7e09d1e52dabc206602/.github/workflows/quarto-publish.yml#L51)

4. Issue these commands on your command line (or however you access R) to prepare your R environment using `renv`:

``` bash
% cd aetr-web-book-2024/
% R # at the command line to start R
> renv::restore()
```

### Previewing Locally

[Web book Previewing](https://quarto.org/docs/websites/#website-preview) describes viewing the website locally by using `quarto preview` on the command line to generate HTML from the `qmd` files. The generated HTML code goes in the `_book/` directory. It should also automatically open a browser window. See `quarto preview help` for hints.

However, we use [Profiles](https://github.com/acep-uaf/aetr-web-book-2024/wiki/Quarto-Profiles) in this repository with three different configuration files which complicates local previewing somewhat.

[Website Previewing](https://quarto.org/docs/websites/#website-preview) allows viewing of the completed website by generating HTML from the `qmd` files. VSCode and RStidio both render and preview pages automatically using a `Render` button.
1. `_quarto.yml` = the main configuration file that triggers the other two
2. `_quarto-html.yml` = configures the web book
3. `_quarto-pdf.yml` = configures the PDF report

To preview the website using commands in the terminal:
``` bash
# preview the website in the current directory
quarto preview
```
It should automatically open a browser window. See `quarto preview help` for hints
If the default profile is not set in `_quarto.yml`, the `quarto preview` renders both, one after the other; however the second render clobbers the first so you can only view HTML or PDF depending on the order of the profile group. So in our case, it is better to specify which format you want to render with `quarto preview --profile html` or `quarto preview --profile pdf`, or to toggle `default` between the two by editing `_quarto.yml`.

You can also render the website without displaying it. The generated code goes in the `_site` directory (which should be listed in .gitignore)
``` bash
# render the website in the current directory
quarto render
```
VSCode and RStudio both render and preview pages automatically using a `Preview` button. In VSCode, open a `.qmd` page in the editor such as `index.qmd`, and hit shift-command-K to preview the page.

## Publishing via GitHub

Set things up (or is that the cc business)
This project includes a [GitHub Workflow](https://github.com/eldobbins/aetr-web-book-2024/blob/b3c9762e4528243bef33a7e09d1e52dabc206602/.github/workflows/quarto-publish.yml) that renders the Markdown as HTML and PDF and posts those to the `gh-pages` branch to create a website. You can see in that workflow that the two profiles are rendered sequentially with the PDF subsequently copied into the `gh-pages` branch to avoid the clobbering issue noted locally.

Note that rendered files and directories containing rendered files should be listed in `.gitignore` so they don't get copied into the GitHub repo. The presence of those files causes GitHub Actions to choke which breaks the generation and posting of the web book.

## Credits

Website format is based on the [Quarto Website Tutorial](https://openscapes.github.io/quarto-website-tutorial/) developed by [Openscapes](https://openscapes.org/). Code is avalable in the [tutorial GitHub repo](https://github.com/Openscapes/quarto-website-tutorial/tree/main).

This project was created using the [cookiecutter-quarto-website](https://github.com/eldobbins/cookiecutter-quarto-website) template that utilizes the [Cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) project
This project was created using the [cookiecutter-quarto-website](https://github.com/eldobbins/cookiecutter-quarto-website) template that utilizes the [Cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) project, but has many extensions not included in that template.
2 changes: 2 additions & 0 deletions _quarto-html.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ book:
text: Alaska Energy Statistics Workbooks (2011-2021)
icon: bi-file-spreadsheet
repo-actions: [issue]
downloads: pdf

chapters:
- index.qmd
Expand Down Expand Up @@ -51,6 +52,7 @@ format:
code-copy: true
code-overflow: wrap
css: styles.css
email-obfuscation: javascript
# fig-align: center Tried this but it overridden by Observable defaults (bootstrap?)
number-depth: 2
theme:
Expand Down
1 change: 1 addition & 0 deletions _quarto-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ format:
fig-height: 3.25

fontsize: 11pt
mainfont: Barlow

toc: true
toc-depth: 3
Expand Down
1 change: 1 addition & 0 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ warning: false
cap-location: top

profile:
default: html # toggle this to choose which profile to render if neither is specified
group:
- [pdf, html]
4 changes: 2 additions & 2 deletions consumption.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ print(customers_pdf)

`r space()`

`r if (knitr::is_html_output())"@fig-sales_per_capita-html" else if (knitr::is_latex_output()) "@fig-sales_per_capita-pdf"` <!--orig: The following table--> shows the average annual electricity consumption for each of the regions. The Coastal region led the state in consumption per capita, with an average of `r regional_consumption_per_capita("Coastal","Residential")` kWh per customer per year. This was followed by the Railbelt region with `r regional_consumption_per_capita("Railbelt","Residential")` kWh per capita and the Rural Remote region with `r regional_consumption_per_capita("Rural Remote","Residential")` kWh per capita. Overall, each region has seen reductions in consumption per capita, which may reflect improvements in energy efficient technologies and energy efficiency/conservation behaviors.
`r if (knitr::is_html_output())"@fig-sales_per_capita-html" else if (knitr::is_latex_output()) "@fig-sales-per-capita-pdf"` <!--orig: The following table--> shows the average annual electricity consumption for each of the regions. The Coastal region led the state in consumption per capita, with an average of `r regional_consumption_per_capita("Coastal","Residential")` kWh per customer per year. This was followed by the Railbelt region with `r regional_consumption_per_capita("Railbelt","Residential")` kWh per capita and the Rural Remote region with `r regional_consumption_per_capita("Rural Remote","Residential")` kWh per capita. Overall, each region has seen reductions in consumption per capita, which may reflect improvements in energy efficient technologies and energy efficiency/conservation behaviors.

`r space()`

Expand Down Expand Up @@ -317,7 +317,7 @@ girafe(code = print(sales_per_capita_html))
```

```{r, eval=knitr::is_latex_output(), fig.pos = "H"}
#| label: fig-sales_per_capita-pdf
#| label: fig-sales-per-capita-pdf
#| fig-cap: "Average Residential Sales per Customer"

sales_per_capita_pdf <-
Expand Down
65 changes: 20 additions & 45 deletions credits.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,75 +37,50 @@ Data used in the energy workbooks comes from a variety of sources and partners,

## Credits and Roles {#sec-contacts}

```{r}
#| echo: false
# Hack to reuse footnotes from https://stackoverflow.com/questions/74632879/use-footnote-multiple-times-in-html-quarto

gen_fn <- function(n, id) {
# n is number of footnote
# id is a unique id for that footnote
paste0('<a href="#',id, '" class="footnote-ref" role="doc-noteref" aria-expanded="false"><sup>', n, '</sup></a>')
}
```

The Alaska Electrical Trends report has been produced by the Alaska Center for Energy and Power ([ACEP](https://www.uaf.edu/acep/)) at the University of Alaska Fairbanks ([UAF](https://www.uaf.edu/uaf/index.php)). It is a collaboration between data scientists, researchers, and policy experts. Roles here are described by [Contributor Roles Taxonomy (CRediT)](https://credit.niso.org/).

### Authors

* [Jesse Kaczmarski](https://www.uaf.edu/acep/about/our-team/jesse-kaczmarski.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Jesse Kaczmarski](https://www.uaf.edu/acep/about/our-team/jesse-kaczmarski.php)`r "^1^"`
* Roles: data curation, formal analysis, project administration, software, validation, visualization, writing – original draft

* [Ian MacDougall](https://www.uaf.edu/acep/about/our-team/ian-macdougall.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Ian MacDougall](https://www.uaf.edu/acep/about/our-team/ian-macdougall.php)`r "^1^"`
* Roles: data curation, formal analysis, software, validation, visualization, writing – original draft

* [Steve Colt](https://www.uaf.edu/acep/about/our-team/steve-colt.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Steve Colt](https://www.uaf.edu/acep/about/our-team/steve-colt.php)`r "^1^"`
* Roles: data curation, formal analysis, investigation, validation, writing – review & editing

* [Elizabeth (Liz) Dobbins](https://www.uaf.edu/acep/about/our-team/elizabeth-dobbins.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Elizabeth (Liz) Dobbins](https://www.uaf.edu/acep/about/our-team/elizabeth-dobbins.php)`r "^1^"`
* Roles: software, project administration, resources, supervision, writing – review & editing

* Neil McMahon`r if (knitr::is_html_output()) gen_fn(3, "fn3") else "^3^"`
* Neil McMahon`r "^2^"`
* Roles: data curation, investigation, validation

* [Sara Fisher-Goad](https://www.uaf.edu/research/contact-us/index.php)`r if (knitr::is_html_output()) gen_fn(2, "fn2") else "^2^"`
* [Sara Fisher-Goad](https://www.uaf.edu/research/contact-us/index.php)`r "^3^"`
* Roles: conceptualization, validation, writing – review & editing

* [Brittany Smart](https://www.uaf.edu/acep/about/our-team/brittany-smart.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Brittany Smart](https://www.uaf.edu/acep/about/our-team/brittany-smart.php)`r "^3^"`
* Roles: project administration, writing – review & editing

* [Dayne Broderson](https://www.uaf.edu/acep/about/our-team/dayne-broderson.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
### Acknowledgements

* [Dayne Broderson](https://www.uaf.edu/acep/about/our-team/dayne-broderson.php)`r "^1^"`
* Roles: conceptualization, funding acquisition

* [Gwen Holdmann](https://www.uaf.edu/acep/about/our-team/gwen-holdmann.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Gwen Holdmann](https://www.uaf.edu/acep/about/our-team/gwen-holdmann.php)`r "^1^"`
* Roles: conceptualization, funding acquisition

* [Shivani Mathur](https://www.uaf.edu/acep/about/our-team/shivani-mathur.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Emily Richmond](https://www.uaf.edu/acep/about/our-team/emily-richmond.php)`r "^1^"`
* Roles: software, visualization

* [Shivani Mathur](https://www.uaf.edu/acep/about/our-team/shivani-mathur.php)`r "^1^"`
* Roles: validation, writing – review & editing

* [Erika Boice](https://www.uaf.edu/acep/about/our-team/erika-boice.php)`r if (knitr::is_html_output()) gen_fn(1, "fn1") else "^1^"`
* [Erika Boice](https://www.uaf.edu/acep/about/our-team/erika-boice.php)`r "^1^"`
* Roles: writing – review & editing

### Affiliations

```{=html}
<footer>
<ol style="padding-left: 1rem;">
<li id="fn1"><p>Alaska Center for Energy and Power</p></li>
<li id="fn3"><p>Office of the Vice Chancellor for Research, UAF</p></li>
<li id="fn3"><p>Project Manager, <a href="https://www.dowl.com/">DOWL</a></p></li>
</ol>
</footer>
```

::: {.content-visible when-format="pdf"}

**^1^ [Alaska Center for Energy and Power](https://www.uaf.edu/acep/)</span>**

\vspace{1em}

**^2^ [Office of the Vice Chancellor for Research, UAF](https://www.uaf.edu/research/)**

\vspace{1em}

**^3^ [DOWL](https://www.dowl.com)**

:::
1. Alaska Center for Energy and Power ([ACEP](https://www.uaf.edu/acep/)), University of Alaska Fairbanks ([UAF](https://www.uaf.edu/uaf/index.php))
2. Project Manager, [DOWL](https://www.dowl.com/)
3. [Office of the Vice Chancellor for Research](https://www.uaf.edu/research/), University of Alaska Fairbanks ([UAF](https://www.uaf.edu/uaf/index.php))
48 changes: 15 additions & 33 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,19 @@ source("scripts/R/space.R")

`r space(br="", vspace="-3em")`

::: {.content-visible when-format="html"}

## Welcome {#welcome .unnumbered}

This report summarizes electricity data gathered from federal, state, and utility sources. It provides an overview of electricity capacity, generation, consumption, and price trends from 2011 to 2021. A comprehensive report highlighting these trends has not been produced for the state of Alaska since 2013's _Alaska Energy Statistics Report_.
This report summarizes electricity data gathered from federal, state, and utility sources. It provides an overview of electricity capacity, generation, consumption, and price trends from 2011 to 2021. A comprehensive report highlighting these trends has not been produced for the state of Alaska since 2013's _Alaska Energy Statistics Report_. It is available in two formats: as a PDF and as a digital "web book".

::: {.content-visible when-format="html"}
This web book is designed as 'best available' document for the 2011-2021 energy trends data and reports. This website will be updated when updates to the underlying 2011-2021 data or fixes become available. Future year trends reports will be tackled in a different context and reporting structure.
The web book is designed as 'best available' document for the 2011-2021 energy trends data and reports. This website will be updated when updates to the underlying 2011-2021 data or fixes become available. Future year trends reports will be tackled in a different context and reporting structure.

Please explore the data using the chapter navigation links in the left sidebar and the section navigation links in the right sidebar.
:::

## How to Cite
::: {.content-visible when-format="html"}

Alaska Center for Energy and Power. "2024 Alaska Energy Trends Report Web Book." Accessed `{ojs} currentDate`. https://acep-uaf.github.io/aetr-web-book-2024
Kaczmarski, J., I. Yeager, S. Colt, E. L. Dobbins, N. McMahon, S. Fisher-Goad, and B. Smart. "2024 Alaska Energy Trends Report Web Book." Accessed `{ojs} currentDate`. https://acep-uaf.github.io/aetr-web-book-2024

```{ojs}
//| echo: false
Expand Down Expand Up @@ -55,7 +54,7 @@ citation_button = (blob, filename = 'test.bib', displayname) => {
// BibLaTeX content
biblatexContent =
`@online{aetr_web_book_2024,
author = {{Alaska Center for Energy and Power}},
author = {Jesse Kaczmarski and Ian Yeager and Steve Colt and Elizabeth L. Dobbins and Neil McMahon and Sara Fisher-Goad and Brittany Smart},
title = {{2024 Alaska Electricity Trends Report}},
year = 2024,
url = {https://acep-uaf.github.io/aetr-web-book-2024/},
Expand All @@ -64,7 +63,13 @@ biblatexContent =

risContent =
`TY - ELEC
AU - Alaska Center for Energy and Power
AU - Kaczmarski,Jesse
AU - Yeager,Ian
AU - Colt,Steve
AU - Dobbins,Elizabeth L.
AU - McMahon,Neil
AU - Fisher-Goad,Sara
AU - Smart,Brittany
TI - 2024 Alaska Electricity Trends Report
PY - 2024
DA - {${year}-${month_2digit}-${day_2digit}}
Expand All @@ -84,33 +89,10 @@ citation_button(ris_blob, 'aetr_web_book_2024.ris', 'RIS');

:::


::: {.content-visible when-format="pdf"}

##### APA:
Alaska Center for Energy and Power. (2024). Alaska Energy Trends Report. Retrieved `r format(Sys.Date(), "%B %d, %Y")`, from https://acep-uaf.github.io/aetr-web-book-2024/report2024.pdf

###### BibLaTeX:
```{r, eval=FALSE, echo=TRUE}
@online{aetr_web_book_2024,
author = {{Alaska Center for Energy and Power}},
title = {{2024 Alaska Electricity Trends Report}},
year = 2024,
url = {https://acep-uaf.github.io/aetr-web-book-2024/},
urldate = {2024-08-01}
}
```

:::

## Executive Summary {.unnumbered}
## Executive Summary

{{< include _executive_summary.qmd >}}


## Key Takeaways {.unnumbered}
## Key Takeaways

{{< include _key_takeaways.qmd >}}



2 changes: 1 addition & 1 deletion methods.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ Please visit the Alaska Energy Authority [PCE webpage](https://www.akenergyauth

## Feedback Regarding Potential Errors

Since these data come from multiple sources, there is potential for errors in its compilation. An integral part of this effort is the creation of a high quality dataset that can constructively contribute to future work. Therefore, any discrepancies or noted errors should be reported using email or GitHub issues via the links in the right hand navigation menu of every page. Alternatively, direct contact information for members of the DCM team is listed in @sec-contacts.
Since these data come from multiple sources, there is potential for errors in its compilation. An integral part of this effort is the creation of a high quality dataset that can constructively contribute to future work. Therefore, any discrepancies or noted errors should be reported by emailing [support](mailto:uaf-acep-dcm-support@alaska.edu) or submitting a GitHub issue via the links in the right hand navigation menu of every page of the web book. Alternatively, direct contact information for members of the DCM team is listed in @sec-contacts.
Loading