What is inside Quarto in more detail

Session - What’s inside?

Zoë Turner

How does Quarto work?

  • 🤷
  • I press Render, a document appears, and I believe that anything happening in between could be actual magic!
  • knitr executes the code and converts .qmd to .md; Pandoc renders the .md file to the output format you want
  • What do you think?

Answers?

  1. 🤷 ✔️
  2. “I press knit, a document appears, and I believe that anything happening in between could be actual magic.” 🧙‍♂️)
  3. knitr executes the code and converts .Rmd to .md; Pandoc renders the .md file to the output format you want. ✔️

Metadata - YAML

“YAML Ain’t Markup Language”

It’s a language that isn’t R or markdown!

---
key: value
---

Drawn picture of the back of a conductor

Save output options in your YAML

Basic YAML that is generated from a template

---
title: "Report"
author: "Zoë Turner"
date: "01/08/2023"
format: html
---

Can be extended for certain options

---
title: "Report"
author: "Zoë Turner"
date: "01/08/2023"
format: 
  html:
    toc: true
---

Your turn

In covid-analysis.qmd do the following:

  • Add a table of contents (toc)
  • Move it from the default right to the left
  • Embed the source code (known as code tools in Quarto)

See Quarto online documentation for help

03:00

Answers

---
title: "Untitled"
format: 
  html:
    toc: true
    toc-location: left
    code-tools: true
---

Embed resources (or self-contained)

  • Adding embed-resources: true to the YAML removes a generated folder of the file name that includes supporting files.
  • This makes it easier to share with others as only the html needs to be sent.
  • Self contained from RMarkdown also works - Quarto is backwards compatible.

Date formats in the YAML

Date formats in Quarto:

date: today
date-format: "D MMMM YYYY"

Dark theme

Adding a dark theme to a report is possible with the following YAML:

format:
  html:
    theme:
      light: default
      dark: darkly  

Time for a break! ⏱

10:00

Next Section