Avoid wrexecuting with Quarto

I run a shared server!

Jupyter causes lots of problems

What’s different about Jupyter?

  • Most computer things differentiate between the editorial and executition environment
  • Jupyter blends these two environments together
  • This is part of the appeal of Jupyter, but causes a lot of problems

Problems

  • Unrecorded user actions

  • Your code can bork your editor

  • Integrations with other computer systems

Git!

“Can I get a quick code review please?”

Git!!

It shouldn’t take 11 years to get Git to work!

Most programs use a write-execute model

flowchart LR
  A[Write code] --> B(Source Code)
  B --> C{Execute code}
  C --> D[Output]
  C --> E[Output] 
  C --> F[Output]

Many Jupyter users wreckecute

flowchart LR
  A[Write code] --> B(Code/output)
  B --> C{Run chunks}
  C --> B

Write-execute notebooks

Rmarkdown took a different approach to notebooks

flowchart LR
  A[Write .Rmd] --> B(Source document)
  B --> C{Render}
  C --> F(Pdf)
  C --> G(html)
  C --> H(Markdown)

This has a lot of advantages

  • Most things work right away
  • Git works
  • Make works
  • Composing notebooks works
  • Packaging notebooks in libraries works
  • Mixing languages works
  • Can render to many output formats

Three big problems with Rmarkdown

  1. Starts with “R”
  2. Requires an R runtime
  3. Inconsistent user interface

Quarto to the rescue

  • Fully language agnostic
  • Better branding
  • Unified, extensible interface

How does it work?

flowchart LR
  B(.qmd document)
  B --> C{Render}
  C --> F(Markdown)
  F --> G{Pandoc}
  G --> H(Output format)

Code format

Here’s a heading

You can write markdown code and include inline code like this: 2

This is some source code

Key advantages

  • Easy integrations
  • Render to dozens of output formats
  • Avoids unrecorded state
  • Composable notebooks
  • Excellent caching
  • Fixes all of Joel Grus’ problems with Jupyter

Plays nicely with Jupyter

You don’t need to abandon Jupyter to start using quarto

  • quarto render Untitled.ipynb to render a Jupyter notebook
  • quarto preview Untitled.ipynb live previews Jupyter Notebook
  • quarto convert Untitled.ipynb converts ipynb to qmd
  • quarto convert Untitled.qmd converts qmd to ipynb
  • Integrated into the nbdev suite of developer products

How to get started

  • Free at https://quarto.org/
  • Included with the latest releases of Rstudio
  • Rstudio visual editor is the best
  • VS Code extension also great

Write-execute rules

  • Code is stored as a .qmd format
  • Share .qmd + requirements.txt files with other programmers
  • Share output document with stakeholders

Questons?