-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Trying to add button to PDF * fix 2 PDF bugs and add default profile for local rendering * redo changes with small fixes to PDF and README * Manually render PDF * applying Jesse's changes fixing Barlow font * big reorg of credits, citations, and roles
- Loading branch information
Showing
9 changed files
with
103 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:[email protected]) 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters