Skip to content

Publishing

Brad Cannell edited this page Dec 15, 2023 · 2 revisions

Page contents

After we make changes or additions to the book’s qmd files, we need to render and publish the book again. This page contains instructions for doing so.

Rendering

We can render the files by clicking the Render button in RStudio, and this works well for previewing individual chapters. To render the entire book – especially in multiple formats (e.g., HTML and PDF) at the same time – type quarto render into the terminal.

```{bash}
quarto render
```

Top

Publishing to GitHub pages

This article gives great instructions for publishing to GitHub. Briefly, type quarto publish gh-pages in the terminal after committing and pushing to the GitHub repo.

```{bash}
quarto publish gh-pages
```

A few gotchas:

  1. Make sure you are on the main branch when committing and pushing.

  2. Remember that Quarto will locally render the file the way we saved it whether we committed and pushed the file to the GitHub repo or not. However, the gh-pages branch will not reflect the saved changes unless they’ve been committed and pushed to the GitHub repo. If the published version of the book looks or behaves differently than the local files on our computer, this is a likely cause.

Top

Broken URLs

We’d like to implement some kind of automatic checks for broken links in the book. There is an open issue requesting an automatic URL checker on Quarto’s GitHub. That GitHub thread also recommends the dead link checker website for doing manual checks. It works, but we would also like to eventually find a more automated solution. We have an issue on the R4Epi project board about this.

For now, just remember to periodically check for broken links using the dead link checker website.

Top

R4Epi hex logo

R for Epidemiology Wiki

Authoring Procedures

Wiki maintenance

Clone this wiki locally