“We argue that even though Jupyter helps users perform complex, technical work, Jupyter itself solves problems that are fundamentally human in nature. Namely, Jupyter helps humans to think and tell stories with code and data. We illustrate this by describing three dimensions of Jupyter: 1) interactive computing; 2) computational narratives; and 3) the idea that Jupyter is more than software.”
1978 | TeX | Donald Knuth |
1984 | Literate Programming | Donald Knuth |
1988 | Mathematica Notebooks | Stephen Wolfram |
2001 | IPython | Fernando Perez |
2003 | Emacs org-mode | Carsten Dominik |
2004 | Markdown | John Gruber |
2005 | Sage Notebook | William Stein |
2006 | Pandoc | John MacFarlane |
2009 | GitHub Flavored Markdown | Tom Preston-Werner |
2011 | iPython Notebook | Fernando Perez |
2012 | knitr | Yihui Xie |
2014 | Project Jupyter | Fernando Perez |
An open-source scientific and technical publishing system that builds on standard markdown with features essential for scientific communication.
Ground up re-write of a similar system (R Markdown) that was R specific.
Quarto is multi-language and designed to serve the entire scientific computing community.
Sponsored and developed primarily by Posit (RStudio / Tidyverse / Shiny)
Documents that incorporate the source code required for their production.
Reproduciblity: Integrity of output in the face of changes.
Automation: Make it easier than not to work reproducibly.
https://coko.foundation/articles/single-source-publishing.html
Write semantically and re-purpose content across many mediums
(Web, Mobile, Print, Office, CMS, etc.)
To achieve these goals we need a tool that can:
Variety of tools available: nbconvert, Jupyter Book, Myst-JS, Quarto
Compared to nbconvert, the next generation of tools focus more on production quality output, advanced features like citations and crossrefs, and complex project types like websites, blogs, and books.
https://quarto.org/docs/projects/quarto-projects.html
So far our examples have been single documents or presentations
Quarto has a project system that enables you to produce collections of documents in various formats (websites, blogs, books, etc.)
_quarto.yml
config file defines the behavior of projects
_quarto.yml
project:
type: website
resources:
- "www/*"
format:
html:
theme: cosmo
css: styles.css
toc: true
website:
title: "Practical Deep Learning for Coders"
description: "Learn Deep Learning with fastai and PyTorch, 2022"
twitter-card: true
open-graph: true
reader-mode: true
page-navigation: true
repo-branch: master
repo-url: https://github.com/fastai/course22
repo-actions: [issue]
navbar:
search: true
right:
- icon: github
href: https://github.com/fastai/course22
sidebar:
style: "floating"
metadata-files:
- sidebar.yml
_quarto.yml
project:
type: website
website:
title: "Aayush Agrawal"
description: "Aayush's personal website"
repo-url: https://github.com/aayushmnit/aayushmnit.github.io
repo-actions: [edit, issue]
repo-branch: main
open-graph: true
google-analytics: "G-7QN8N70N41"
twitter-card:
creator: "@aayushmnit"
card-style: summary_large_image
navbar:
collapse-below: lg
left:
- icon: newspaper
href: blog.qmd
text: Blog
right:
- icon: github
href: https://github.com/aayushmnit/
- icon: rss
href: blog.xml
format:
html:
theme: sandstone
mainfont: Roboto
css: styles.css
_quarto.yml
project:
type: book
book:
title: "Geocomputation with Python"
author: |
Michael Dorman, Anita Graser,
Jakub Nowosad, Robin Lovelace
description: |
An introductory resource for working with geographic
data in Python
cover-image: https://geocompx.org/static/img/book_cover_py_tmp_small.png
site-url: https://py.geocompx.org
repo-url: https://github.com/geocompx/geocompy/
repo-actions: [edit]
sharing: [twitter, facebook, linkedin]
chapters:
- index.qmd
- preface.qmd
- 02-spatial-data.qmd
- 03-attribute-operations.qmd
- 04-spatial-operations.qmd
- 05-geometry-operations.qmd
- 06-raster-vector.qmd
- 07-reproj.qmd
format:
html:
theme: flatly
template-partials: [toc.html,title-block.html]
code-overflow: wrap
https://quarto.org/docs/books/
Inherit features of Quarto websites (navigation, search, mobile, etc.)
Support cross references across chapters
Produce multiple book formats from a single source
HTML
PDF (LaTeX)
MS Word
ePub
Asciidoc
Universal document converter
Documents
Presentations
Markdown
Wikis
Other
Because Quarto and Pandoc are based on a semantic AST, we can also publish to any content management system we need to. For example:
• Hugo | (Goldmark Markdown) |
• Docusaurus | (MDX Markdown) |
• Confluence | (Confluence XML) |
• O’Reilly Atlas | (Asciidoc) |
Books can be rendered to asciidoc
, which is fully compatible with the production requirements of O’Reilly Atlas (used for Print, ePub, and Web books)
https://data.agu.org/notebooks-now/
Collaboration among participants in the open-science community, scientific publishers, and the developers of Jupyter Book, Myst-JS, and Quarto to create a standard for including notebooks in scientific publications.
Aim is to define a standard for scholarly articles that include notebooks, enabling them to be considered as part of peer review and included in archives.
Render to output formats:
# ipynb notebook
quarto render notebook.ipynb
quarto render notebook.ipynb --to docx
# plain text qmd
quarto render notebook.qmd
quarto render notebook.qmd --to pdf
Live preview server (re-render on save):
.qmd
Filespenguins.qmd
---
title: "Palmer Penguins"
author: Norah Jones
date: March 12, 2023
format: html
jupyter: python3
---
```{python}
#| echo: false
import pandas as pd
df = pd.read_csv("palmer-penguins.csv")
df = df[["species", "island", "year", \
"bill_length_mm", "bill_depth_mm"]]
```
## Exploring the Data
See @fig-bill-sizes for an exploration of bill sizes.
```{python}
#| label: fig-bill-sizes
#| fig-cap: Bill Sizes by Species
import matplotlib.pyplot as plt
import seaborn as sns
g = sns.FacetGrid(df, hue="species", height=3)
g.map(plt.scatter, "bill_length_mm", "bill_depth_mm") \
.add_legend()
```
Editable with any text editor (extensions for VS Code, Neovim, and Emacs)
Cells always run in the same order
Integrates well with version control
Cache output with Jupyter Cache or Quarto freezer
Lots of pros and cons visa-vi traditional .ipynb
format/editors, use the right tool for each job
Notebook workflow (no execution occurs by default):
Plain text workflow (.qmd
=> .ipynb
then execute cells):
https://quarto.org/docs/extensions/
Filters & Shortcodes
Custom Formats
Revealjs Plugins
Project Types
Project Templates
https://quarto.org/docs/extensions/filters.html
Filters transform the document AST before final rendering
Can be used to modify, remove, or generate content
Can include target format specific logic / output
Example: Use the panflute
library to increase the level of headings in a document.
Quarto includes dozens of filters that implement its core functionality, but the system is open so you can add whatever features you require.
Filter | Description |
---|---|
lightbox | Create lightbox treatments for images in your HTML documents. |
molstar | Shortcode to embed proteins and trajectories with Mol*. |
social-share | Add buttons to share articles on various social media platforms. |
latex-environment | Output divs as custom LaTeX environments. |
qrcode | Shortcode to embed QR codes using qrcodejs. |
code-visibility | Filter code and stream output included within a document. |
authors-block | Add author-related header block when rendering docx-documents. |
• pandocfilters | Python library from the creator of Pandoc |
• panflute | Python library with improved API and more batteries included |
• Lua Filters | Pandoc includes an embedded Lua interpreter for fast, zero-dependency filters |
• JSON Filters | Write filters in any language via JSON representation over stdin/stdout |
Interactively develop Python packages within Jupyter, including embedded tests/docs, CI, pypi and conda publishing
Version 2 of nbdev uses Quarto to produce documentation websites
Getting Started | https://quarto.org/ |
User Guide | https://quarto.org/docs/guide/ |
Extensions | https://quarto.org/docs/extensions/ |
Awesome Quarto | https://github.com/mcanouil/awesome-quarto |