TECHNOLOGY
Ledge Brings Runnable Code Blocks to Markdown Notes for Developers
A free, open-source Markdown notebook called Ledge lets developers and DevOps engineers run code directly inside their notes, with output streaming in beneath each block. It's available for Mac, Linux, Windows, and iPhone.
Image: ledge sh · Uploaded by IntraGoals — usage rights confirmed
A new tool called Ledge is drawing attention on Hacker News for a simple but useful idea: letting developers run code directly inside their notes. Described as a Markdown notebook for developers and DevOps, Ledge lets users write a note, press a keyboard shortcut on a code block, and watch the output stream in beneath it. The project is free and open source, with versions available for Mac, Linux, Windows, and iPhone.
The core feature is straightforward. Any fenced code block whose language is runnable, such as sh, python, or node, gets a Run button. Pressing Command-Return executes the block in place, and the output appears in a panel directly below it. Each note maintains its own persistent shell, so variables and directory changes set in one block carry over to the next block in the same note. A separate terminal drawer, opened with a dedicated shortcut, gives users a full shell independent of the inline one.
Ledge notes can also be configured through frontmatter to control where their shells start. Users can set a working directory and environment variables, attach a secrets profile kept outside the notes folder, or point a note at a remote host so its code runs over SSH while the note itself stays local. For those who prefer not to write frontmatter, an entire project folder can be attached as a workspace, with its Markdown files becoming notes whose shells automatically start in that project's directory.
Beyond code execution, Ledge includes features common to note-taking apps: note linking with a bracket syntax, hashtags, full-text search, backlinks, an outline view, and split-pane layouts for viewing multiple notes at once. Because notes are stored as ordinary Markdown files in ordinary folders, they remain compatible with git, command-line tools, and AI coding agents. Ledge also supports daily notes and templates, a command-line interface for opening notes from any terminal, and a note-locking feature that encrypts a note's body on disk so sync services, search, and agents cannot read it until it is unlocked.
Installation varies by platform. Mac users with Apple Silicon need macOS 13 or newer and install via a DMG file. Windows 11 users need a Linux environment through the Windows Subsystem for Linux, which Ledge relies on to run notes and code as Linux commands; the app checks for and installs its own server inside WSL on first launch. Linux users need WebKitGTK 4.1, available on recent Ubuntu, Debian, and Fedora releases, and install via an extracted installer. An iPhone or iPad version, requiring iOS 17 or newer, is available through the App Store and pairs with a separate Ledge server to read and run notes remotely.
Ledge also supports keeping notes entirely on a remote server, with the desktop or mobile app acting as a window onto that server over SSH, and running individual note blocks on a different machine while the note stays local. The app checks for updates automatically on startup and once daily, downloading new versions in the background and completing the swap after any in-progress code block finishes running, so users don't lose output mid-execution.
For troubleshooting, Ledge keeps session logs that can be attached to bug reports, and its documentation includes tutorials covering workflows such as running a project from a note, pairing with an AI agent, syncing notes, setting up a Ledge server, and backing up notes to Amazon S3.