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

Port from bookdown to quarto #365

Merged
merged 23 commits into from
May 4, 2023
Merged

Port from bookdown to quarto #365

merged 23 commits into from
May 4, 2023

Conversation

djnavarro
Copy link
Collaborator

@djnavarro djnavarro commented May 2, 2023

Substantive changes

  • Converts code chunk options to yaml format
  • Fixes issues with placement of level one headers
  • Switches the github actions workflow to quarto
  • Replaces _bookdown.yml and _output.yml with _quarto.yml
  • Uses quarto layouts in place of columns() function (currently only fixes the number of columns, not the size or aspect ratio of plots)

Other changes

  • Additional canonicalisation for files that escaped the last round
  • .RProj file explicitly enforces sentence level wrapping of markdown
  • Adds a status() function to show callouts for each chapter
  • set.seed() called consistently in common.R instead of inconsistently in some chapters
  • Fixes a couple of broken cross-references

Something confusing

  • For reasons that I don't yet understand, I had to slightly change one heading in the springs chapter to prevent quarto from throwing errors. Reproducible locally and on actions, but as yet I haven't managed to isolate it as a minimal reprex: 81c4ae5

Proposed next steps

  • PR to rename .Rmd files to .qmd (and rename scripts like common.R to _common.R etc)
  • Then return to updating the actual content 😀

@djnavarro djnavarro marked this pull request as ready for review May 4, 2023 10:56
@djnavarro
Copy link
Collaborator Author

@hadley okay we have a minimum viable PR (is MVPR an accepted term?) to switch to quarto. As always there are some rough edges. The most noticeable is that the switch from the bespoke columns() function to the quarto layouts chunk option has left us with a lot of plots that need some love on the aspect ratio and size front. There's also a really fkn bizarre quarto bug(?) I had to work around (see above) to make the bloody thing build, but despite its weirdness from a quarto pov it's trivial from the ggplot2 book pov. And of course (as always) there's a lot of smoothing I want to do later but this version works pretty well and I think it's probably wise to merge the MVPR before making a start on the sweet sugary polishes 😀

@djnavarro djnavarro requested a review from hadley May 4, 2023 11:04
Copy link
Owner

@hadley hadley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this! Agree that we should get the big changes merged and then start polishing 😄

.github/workflows/build_book.yaml Outdated Show resolved Hide resolved

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2

- name: Cache bookdown results
Copy link
Owner

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.

Copy link
Collaborator Author

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?

Copy link
Collaborator Author

@djnavarro djnavarro May 4, 2023

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

.github/workflows/build_book.yaml Outdated Show resolved Hide resolved
@djnavarro djnavarro merged commit 1d3f5c5 into hadley:main May 4, 2023
@djnavarro djnavarro deleted the use-quarto branch May 4, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants