Show HN:Ledge.sh——可运行的 Markdown 笔记
Show HN: Ledge.sh – Runnable Markdown Notes

原始链接: https://ledge.sh

Ledge 是一款 Markdown 笔记应用,可将文件夹转换为支持代码和实时运行的工作区。Python、Node、Ruby 和 PHP 可直接使用,TypeScript 通过内置的 Bun 运行,Redis 和 SQL 代码块则可使用环境 URL 连接;还可以在“设置”中添加更多解释器。 每日笔记基于普通 Markdown 模板创建,并通过日期和提示词区块快速生成晨间简报。你可以附加项目文件夹,而无需移动或修改其中的文件;还可以切换最多九个工作区,每个工作区都有独立的布局。 编辑功能包括语法感知的实时预览、从网页和文档导入内容时的富文本粘贴转换、图片处理,以及锁定笔记的可选加密。双向链接、全文搜索、反向链接、大纲、标签和收藏功能让笔记易于浏览和查找。 `ledge` CLI 可在任何终端中列出、读取、搜索、创建和追加笔记,输出清晰,并支持 JSON 格式输出。应用会随 CLI 的更改实时同步更新。删除的笔记会移至废纸篓,并在其中保留 30 天;永久删除时需要确认。

Ledge.sh 是一款免费、开源的 Markdown 笔记本,可直接在笔记中运行 Shell 命令、代码、SQL 和其他可执行块。它使用真正的交互式 Shell,支持本地执行或通过 SSH 在远程主机上执行,并可在 macOS、Linux、通过 WSL 运行的 Windows、iOS 和 Android 上使用,其中 Android 目前处于测试阶段。该项目使用 Bun 和 Electrobun 构建。 HN 社区的讨论将 Ledge 与 Org-mode/Babel、Jupyter、RMarkdown、Quarto、Runme、Atuin Desktop、Xiki 以及其他 literate programming 工具进行了比较。支持者看中了 Ledge 易于使用的 Markdown 格式、移动端支持,以及将现有 README 和运维笔记转换为可运行工作流的能力。 建议改进的方面包括:让执行过程感知依赖关系、支持条件工作流、使用环境变量进行参数化、从命令行运行单个代码块、编辑器自动补全、为智能体驱动的任务列表提供钩子,以及探索与 Obsidian 集成的可能性。 批评者提醒,可执行文档容易变得过时、依赖特定平台且难以维护,尤其是在团队规模扩大时。对于关键自动化任务,传统脚本和构建系统可能更加可靠。创建者还收到了反馈,建议弱化项目的“笔记本”品牌定位,并进一步说明它与 Jupyter 的区别。
相关文章

原文

Your languages

Python, Node, Ruby, and PHP run out of the box. A redis block feeds redis-cli, pointed at staging or prod by the note's REDIS_URL. TypeScript uses the Bun runtime bundled with the app, so ts blocks run with nothing installed. Adding an interpreter is one line in Settings.

"sql": "psql \"$DATABASE_URL\" -f"

Daily notes and templates

⌘J opens today's note, stamped from your daily template. Templates are ordinary notes with {{date}} and {{yesterday}} tokens, and one carrying a prompt block gives every morning a one-keystroke briefing.

promptSummarize [[{{yesterday}}]]

A workspace is a folder

Attach a project folder and its Markdown files become notes where they are, running their blocks in the project. ⌘1 to ⌘9 switch workspaces, and each keeps its own pane layout. Removing an attached folder from Ledge touches no files.

Attach Folder as Workspace…

Live preview

Syntax hides away from the caret: **bold** shows bold, links show their label, tables and images render in place, and a checkbox is clickable. Move the caret in and the exact characters come back. One setting shows every character all the time.

"editor.livePreview": false

Paste anything

Copy part of a web page, a Slack thread, or a Google Doc, and ⌘V pastes it as Markdown: headings, lists, checkboxes, links, and tables included. ⇧⌘V pastes the plain text. An image on the pasteboard lands in the workspace as a file, rendering in place; pasted into a locked note, it is encrypted from the first byte.

![](.ledge-assets/pasted-2026-07-31.png)

Find your way back

⌘P opens a note by title; type # for full-text search. Wikilinks address titles, so a retitle never leaves a stale link. Backlinks and outline each get a panel.

[[Oncall handbook#Paging]]

Tags and favorites

Tag a note with inline #hashtags or a frontmatter tags: line, and ⌥⌘T lists every tag with its count. Press f on a note's row, or click its star, and it sits in a Favorites section at the top of the sidebar, however deep in a folder it lives. Both are frontmatter, so they travel with the file.

favorite: true

Deleting is undoable

⌫ moves a note to the workspace trash and shows an Undo strip. The Trash section in the sidebar holds it for 30 days, where r restores it and permanent deletion asks first.

"trash.ttlDays": 30

The ledge CLI

Lists, reads, searches, creates, and appends from any terminal, and the app follows along live. Results go to stdout, everything conversational to stderr, so pipes stay clean, and --json switches any verb to machine-readable output.

git log --oneline -5 | ledge append "Release notes"

联系我们 contact @ memedata.com