-
Notifications
You must be signed in to change notification settings - Fork 687
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
Port from bookdown to quarto #365
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
61c4b61
use yaml formatted chunk options
djnavarro 9938d31
enforce sentence-level markdown wraping locally
djnavarro 5647d99
ignore *_cache and *_files folders
djnavarro baf9684
canonicalise facets chapter markdown
djnavarro 1077075
replace _bookdown.yml and _output.yml with _quarto.yml
djnavarro ac43b71
canonicalise getting-started
djnavarro 9cced55
fixes level 1 headers in chapter files
djnavarro a371487
spurious newline diffs
djnavarro 8a2d601
canonicalise references
djnavarro fb74b02
remove yaml header and canonicalise index.Rmd
djnavarro c3a4f46
use quarto on gh actions
djnavarro c551974
use @ notation for cross-references and sec- prefix for section labels
djnavarro 78b87d6
restore references.Rmd to document structure
djnavarro 81c4ae5
tweak heading to fix inscrutable quarto bug
djnavarro 1510ad1
removes columns() function, uses quarto layout-ncols instead
djnavarro 1ab7b2a
adds status() function and set.seed() to common.R, and updates chapte…
djnavarro 795d4ea
remove refs chapter (each chapter has its own refs)
djnavarro be922ce
fix broken crossrefs
djnavarro 93b977d
adds "welcome to part" file for part 1
djnavarro 1442889
removes status note from part headers where it makes no sense to have…
djnavarro c55e81f
tentatively assign some chapters to status: polishing
djnavarro a0773bd
removes spurious heading
djnavarro 6be7625
fixes silly mistakes in the gh actions
djnavarro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
41 changes: 22 additions & 19 deletions
41
.github/workflows/bookdown.yaml → .github/workflows/build_book.yaml
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,51 +1,54 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
branches: main | ||
pull_request: | ||
branches: [main, master] | ||
branches: main | ||
# to be able to trigger a manual build | ||
workflow_dispatch: | ||
schedule: | ||
# run every day at 11 PM | ||
- cron: '0 23 * * *' | ||
|
||
name: bookdown | ||
name: Render and deploy Book to Netlify | ||
|
||
env: | ||
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }} | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
bookdown: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
isExtPR: ${{ github.event.pull_request.head.repo.fork == true }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
- name: Install Quarto | ||
uses: quarto-dev/quarto-actions/install-quarto@v1 | ||
with: | ||
# To install LaTeX to build PDF book | ||
tinytex: true | ||
# uncomment below and fill to pin a version | ||
# version: 0.9.105 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
|
||
- name: Cache bookdown results | ||
uses: actions/cache@v3 | ||
with: | ||
path: _bookdown_files | ||
key: bookdown-${{ hashFiles('**/*Rmd') }} | ||
restore-keys: bookdown- | ||
|
||
- name: Build site | ||
run: Rscript -e 'bookdown::render_book("index.Rmd", quiet = TRUE)' | ||
- name: Render book to all format | ||
# Add any command line argument needed | ||
run: | | ||
quarto render | ||
|
||
- name: Deploy to Netlify | ||
if: contains(env.isExtPR, 'false') | ||
id: netlify-deploy | ||
uses: nwtgck/[email protected] | ||
with: | ||
publish-dir: './_book' | ||
production-branch: master | ||
production-branch: main | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
deploy-message: | ||
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})' | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
project: | ||
type: book | ||
output-dir: _book | ||
|
||
book: | ||
title: "ggplot2: Elegant Graphics for Data Analysis (3e)" | ||
reader-mode: true | ||
|
||
page-footer: | ||
left: | | ||
ggplot2: Elegant Graphics for Data Analysis (3e) was written by | ||
Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen. | ||
right: | | ||
This book was built with <a href="https://quarto.org/">Quarto</a>. | ||
cover-image: cover.jpg | ||
favicon: cover.jpg | ||
site-url: https://ggplot2-book.org/ | ||
repo-url: https://github.com/hadley/ggplot2-book/ | ||
repo-branch: main | ||
repo-actions: [edit, issue] | ||
chapters: | ||
- index.Rmd | ||
|
||
- preface-3e.Rmd | ||
- preface-2e.Rmd | ||
|
||
- part: start.Rmd | ||
chapters: | ||
- introduction.Rmd | ||
- getting-started.Rmd | ||
|
||
- part: toolbox.Rmd | ||
chapters: | ||
- individual-geoms.Rmd | ||
- collective-geoms.Rmd | ||
- statistical-summaries.Rmd | ||
- maps.Rmd | ||
- networks.Rmd | ||
- annotations.Rmd | ||
- arranging-plots.Rmd | ||
|
||
- part: scales.Rmd | ||
chapters: | ||
- scales-position.Rmd | ||
- scales-colour.Rmd | ||
- scales-other.Rmd | ||
|
||
- part: mastery.Rmd | ||
chapters: | ||
- layers.Rmd | ||
- scales-guides.Rmd | ||
- coord.Rmd | ||
- facet.Rmd | ||
- themes.Rmd | ||
|
||
- part: extending.Rmd | ||
chapters: | ||
- programming.Rmd | ||
- internals.Rmd | ||
- extensions.Rmd | ||
- ext-springs.Rmd | ||
|
||
bibliography: references.bib | ||
|
||
format: | ||
html: | ||
theme: | ||
- cosmo | ||
code-link: true | ||
|
||
author-meta: "Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen" | ||
include-in-header: "ga_script.html" | ||
callout-appearance: simple | ||
|
||
editor: visual | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you deliberately drop the caching? I have no idea if it's important or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semi-deliberate. I'm not entirely sure what (if any) files need to be cached in the quarto book, and since there's no caching used in the r4ds book workflow (which I was using as a guide) I didn't try to add anything. Maybe we leave it as is and try restoring the cache later if we have build issues?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having now merged I can see why we had a cache. The actions workflow takes about 20 mins to finish and I had timeout issues the first time. I'll open an issue to restore the cache and see what needs to happen. Edit: Issue is #366