Jupyter example

code
jupyter
quarto
Author

Ralph-Uwe Börner

Published

September 29, 2022

Use Jupyter notebooks as Quarto blog posts

This blog post has been entirely written within a Jupyter Notebook.

You can use existing Jupyter notebooks as blog entries with just a little modification!

Quarto can only render Jupyter notebooks properly when you add a YAML header as first cell of your notebook. Just make sure, that this cell is a raw cell.

Further, I have renamed the notebook to index.ipynb – though I’m not sure if this is really necessary. This assumption probably fits well with the conventional index.html files sitting in the other blog post folders.

The YAML front matter of this notebook looks like this:

---
title: "Jupyter example"
categories: [code, jupyter, quarto]
jupyter: "julia-1.8"
---

The remaining cells are just plain Jupyter code cells.

using Plots
theme(:vibrant)
x = range(0.0, 2π, 101)
0.0:0.06283185307179587:6.283185307179586
plot(x, sin.(x), label="sin(x)", xlabel="x", ylabel="y(x)")