Obsidian Markdown Notebook: code execution with outputs stored in the file
I've built Obsidian Markdown Notebook, a plugin that lets you execute code in Obsidian with both code and output stored in a single Markdown file.
It allows you to execute code directly in Obsidian, like a Jupyter Notebook, but everything, including the outputs, is stored in a single Markdown file. Supported languages are Python, JavaScript, Bash, and R.
Here's an example of plotting Fourier series components:

There are quite a few similar plugins already. However, none of them is designed to store outputs directly in the Markdown file itself. Obsidian Markdown Notebook scratches an itch I've had for a while.
By default, outputs are rendered as HTML. You can also render as an image by adding format=image to the code fence:
```python {format=image}
import matplotlib.pyplot as plt
plt.plot([1, 2, 3])
plt.show()
```
<!-- nb-output hash="209f46a0d3ce8ca2" format="image" -->

<!-- /nb-output -->
Output blocks use HTML comments, so they're invisible in PDF export and any standard Markdown renderer.
Each output block stores a hash of the cell's source code. If the code hasn't changed, the cached output is shown without re-executing. Re-running a cell updates the output in place.
You can also specify document-level defaults in frontmatter, or set project-level defaults in plugin settings.
Similar Plugins
There is a lot of prior art here, but the major gap is that none of them focuses on storing the output artifact alongside the code.
- Obsidian Execute Code Plugin is the closest relative. It does support persistent output since version 2.0.0. However, the output is plain text, and I want rich output (HTML tables, images) to be a first-class citizen from the start.
- Obsidian Code Emitter is a great plugin that supports 15 different languages without requiring any system dependencies. However, the outputs do not survive vault reload and cannot be rendered to PDF.
- JupyMD uses Jupytext to pair a Markdown file with a Jupyter notebook, but the outputs are stored in the Jupyter file. I just want something totally native where everything lives in the Markdown file.
- Jupyter Notebook was the primary inspiration. There is also a Markdown-based notebooks proposal from 2023 that stalled without consensus. This project takes a pragmatic, Obsidian-native approach rather than waiting for a standard to emerge.
The project was developed using a Research, Plan, Implement Workflow. You can see the Markdown files for each in the .claude directory.
See the project Github for more details.