top of page

Why are Jupyter Books better than Markdown?

Yes you read that right: Jupyter BOOKs, not notebooks.... I've been asked to look into Jupyter books instead of just plain markdown for some technical documentation. So I asked my Tech-Sherpa and here is what they answered. My key takeaway for you to remember that Jupyter Books produces a STATIC web site -- not an interactive notebook. This is important, and I am guessing it's the same thing as when you save a Jupyter notebook to HTML, but provides more infrastructure. In the end, it's all just rendering to html, javascript (maybe), and css. But that's what I am guessing. It gets explained better in my follow up question below, so read all the way.



Let’s take this up a level. You're comparing Jupyter Books with Markdown, which is a bit like comparing a full publishing system (Jupyter Book) to just the raw formatting language (Markdown).

They both use Markdown, but Jupyter Books offer a whole framework and toolkit on top of it—especially for technical content, documentation, tutorials, and books.


Let’s break it down clearly.

📘 What is a Jupyter Book?

Jupyter Book is a tool that lets you build beautiful, publication-quality books and documentation using:

  • Markdown

  • Jupyter Notebooks

  • Code outputs

  • Diagrams, citations, math equations, etc.

It’s built on open standards like MyST Markdown, which extends regular Markdown with powerful features for scientific and technical writing.

You write your content using:

  • .md (Markdown) files

  • .ipynb (Jupyter Notebooks)

…and then Jupyter Book compiles them into a static website, a PDF, or an EPUB.


✅ Why Jupyter Books are Better Than Just Markdown

Here’s a breakdown of where Jupyter Books really shine compared to using plain Markdown alone:

1. Combines Code + Narrative

Like Jupyter Notebooks, Jupyter Books can include:

  • Executable code blocks (e.g., Python)

  • Outputs (like plots, tables)

  • Markdown-based explanations

So you get:

📊 Live code + 📖 Clear narrative = An interactive, reproducible technical story

🆚 Plain Markdown: Static code examples only. No execution, no live output.


2. Multi-Page Structure with Navigation

Jupyter Book supports:

  • Chapters and sections

  • Sidebar navigation

  • Breadcrumbs and table of contents

  • Cross-referencing between sections

This makes it ideal for building:

  • Online courses

  • Technical books

  • Project documentation

🆚 Plain Markdown: No native support for structure. You’d need a static site generator (like MkDocs) to organize multiple files.


3. Rich Scientific Publishing Support

Jupyter Book supports:

  • LaTeX-style math (e.g., equations via MathJax)

  • Citations and bibliographies

  • Footnotes

  • Figures and captions

Perfect for research and education.

🆚 Plain Markdown: Very limited support. Requires plugins or extensions to do any of this.


4. Executable Books

You can configure Jupyter Book to:

  • Execute all Jupyter Notebooks automatically during the build

  • Include outputs (like charts, errors, results)

  • Ensure that everything is up-to-date

This makes your content reproducible.

🆚 Plain Markdown: No concept of execution. You’d have to run code elsewhere and paste the results manually.


5. Output Formats

Jupyter Book can export to:

  • A static HTML website

  • PDF (via LaTeX)

  • EPUB (for e-readers)

It’s designed to look great out of the box and be shareable in multiple formats.

🆚 Markdown: Alone, it’s just raw text. You’d need another tool (like Pandoc or a static site generator) to convert it into something else.


6. Interactivity

Jupyter Book supports:

  • Embedded interactive widgets (via ipywidgets)

  • Toggleable code cells

  • Collapsible content

  • Search, navigation, and more

🆚 Markdown: No interactivity—just text and maybe some images.


🧠 Summary: Jupyter Book vs Markdown

Feature

Jupyter Book

Plain Markdown

Supports code and outputs

❌ (code only, no output)

Math, citations, footnotes

❌ (limited)

Multi-page navigation

Executable content

Export to HTML/PDF/EPUB

❌ (needs external tools)

Rich interactivity

Lightweight / simple

❌ (more setup)


✅ When to Use Jupyter Book:

  • Teaching materials with code + visuals

  • Research documentation or scientific writing

  • Data science or machine learning tutorials

  • Creating a full technical book or multi-page site

📝 When Markdown Alone is Enough:

  • Simple documentation (e.g. README)

  • Blog posts

  • Quick notes or static writing


Part 2: In the jupyter books, is it really live code? does it compute in realtime?

Great follow-up again — you’re on a roll! 🔥

So, here's the short answer:

Yes, Jupyter Books can include code that actually computes — but only if you configure it to do so during the build process. It’s not “live” in the browser like a Jupyter Notebook, but it’s executed ahead of time, and the results are embedded into the final output.

Let’s break it down clearly:

📘 Is the Code in Jupyter Books Really "Live"?

Not Live in the Browser Like a Notebook

Unlike Jupyter Notebooks, which have a kernel running in the background that responds in real time (interactive), Jupyter Books are static websites or documents. They are meant to be published and shared, not directly executed inside the browser.

BUT...

✅ It Does Compute During the Build

Jupyter Book supports executable content, thanks to a feature called “MyST-NB” (MyST Notebooks). When building the book, you can tell Jupyter Book to:

  • Run all the notebooks from top to bottom

  • Capture the outputs (plots, tables, results)

  • Embed the outputs into the final HTML or PDF

So when someone views your published book, they're seeing real outputs — the same as if they ran the notebook themselves.

🔧 How Code Execution Works in Jupyter Book

Here’s how it works under the hood:

  1. ✅ You include .ipynb notebooks or .md files with code blocks (using MyST Markdown).

  2. ✅ You configure jupyter-book to execute notebooks during the build.

  3. ✅ It uses tools like jupyter-cache and nbclient to run the code.

  4. ✅ It stores and displays the outputs (charts, dataframes, etc.) inline.

  5. ❌ But once published, users can’t interact with the code (unless you add interactivity via external tools — more on that below).

🖼️ Example

You write this in a Markdown or notebook cell:

```python 
import matplotlib.pyplot as plt 
x = [1, 2, 3, 4] 
y = [i**2 for i in x] 

plt.plot(x, y) 
plt.title("y = x squared") 
plt.show() 
```

➡️ Jupyter Book runs that code during the build, renders the plot, and includes it in the output HTML or PDF.

So, while it's not interactive or editable like in a live notebook, the code does compute, and the outputs are real and up-to-date.

💡 Want Interactivity in Jupyter Book?

You can take it further! Here are a few options:

1. Launch Live Versions via Binder or JupyterHub

Jupyter Book supports buttons like:

🚀 Launch in Binder

This opens the notebook in a cloud-hosted Jupyter environment, where users can run and edit it live.

2. Use Thebe for In-Browser Execution

With Thebe, you can make your Jupyter Book interactive in the browser, like a real notebook.

  • Adds “Run” buttons to code cells

  • Spins up a kernel in the background (e.g., via Binder)

  • Lets users execute code on the page

It’s not automatic—you’ll need to configure it—but it’s a great way to blend static and live content.


✅ TL;DR: Does Jupyter Book Compute?

Feature

Jupyter Book

Executes code?

✅ Yes, during build

Displays real outputs?

✅ Yes

Live/interactive in browser?

❌ Not by default

Can launch in Binder for live use?

✅ Yes

Can be made interactive with Thebe?

✅ With setup

Always shows up-to-date results?

✅ If built fresh


Comments


© 2020 by Silvia Mazzoni, Silvia's Brainery, Santa Monica, CA

bottom of page