# Run markdown code blocks as shell commands (Ledge)

**URL:** <https://discourse.joplinapp.org/t/run-markdown-code-blocks-as-shell-commands-ledge/51125>\
**Category:** Features\
**Created:** [1 October 2026 12:54 UTC](https://discourse.joplinapp.org/t/run-markdown-code-blocks-as-shell-commands-ledge/51125 "2026-10-01T12:54:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![philip-n](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/philip-n/32/4619_2.png) [@philip-n](https://discourse.joplinapp.org/u/philip-n)\
**Post date:** [1 October 2026 12:54 UTC](https://discourse.joplinapp.org/t/run-markdown-code-blocks-as-shell-commands-ledge/51125/1 "2026-10-01T12:54:49Z")

</div>

I stumbled upon **Ledge** today. It brands itself as "runnable markdown notes", basically adding a "run" button to code blocks and displaying their result below the block. Looks like there's a couple of clever ideas behind it (all executions within one note share the same shell etc).

For more details, see [ledge.sh](https://ledge.sh/) and the [HN discussion thread](https://news.ycombinator.com/item?id=49902382).

I often use notes to store some commands that I want to remember later, together with some description of the situation I used them in. So I'd totally like to try what Ledge offers!

My first idea was to simply install Ledge and see if I could just tell Joplin to use it as an external editor. But unfortunately my Ubuntu 22.04 is a bit dated, and Ledge was compiled against a newer glibc. Anybody else who is also interested and wants to give this a try? Or are there plugins that I missed that already offer this?

_[Posting in features since that seems like the logical place to me, feel free to move!]_

---

<div class="post-metadata">

**Author:** ![pmslava](https://yyz2.discourse-cdn.com/flex028/user_avatar/discourse.joplinapp.org/pmslava/32/30042_2.png) [@pmslava](https://discourse.joplinapp.org/u/pmslava)\
**Post date:** [1 October 2026 13:47 UTC](https://discourse.joplinapp.org/t/run-markdown-code-blocks-as-shell-commands-ledge/51125/2 "2026-10-01T13:47:58Z")

</div>

Neat idea, and I keep commands in my notes the same way, so I looked into it.

On your question about existing plugins: as far as I can tell, nothing in the catalogue runs shell blocks. The closest is [Jopyter Notebook](https://joplinapp.org/plugins/plugin/tech.willenglish.jopyter/), which runs Python blocks only through a Jupyter kernel. Codeblock Utils and the copy-button plugins don't execute anything.

I also thought about how hard it would be to build as a plugin. A basic version (run the block under the cursor, show the output below it) looks doable on desktop. But three things make a proper Ledge-like experience difficult:

1. **Mobile.** Plugins on mobile run in a sandbox and can't start processes, so the feature would be desktop-only. Ledge gets around this with its own server that the phone connects to, which is a different kind of project than a plugin.
2. **A real terminal.** Anything interactive (a `sudo` password prompt, `htop`, progress bars) needs a pseudo-terminal. The usual library for that is a native module, which has to match Joplin's Electron build on every platform, so it is hard to ship reliably inside a plugin. Without it you only get plain line-by-line output.
3. **Harmful commands.** Notes arrive from many places: sync, shared notebooks, the web clipper, imports, AI tools. Any of them could carry a block that is one keypress away from running on your machine. A plugin like this would need to never auto-run, ask for confirmation, and still relies on the user reading every block before running it.

A very nice idea, but more than a weekend plugin once you go past the basic case.
