Native Shell
Native Shell:AI 生成的 UI,在你的應用中原生呈現,涵蓋每個平台。iOS、Android、macOS、Windows 與 Linux 上的應用、GPUI 應用與網頁在執行時載入已簽名、沙箱隔離的 TSX 模組並繪製 th
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Markdown to beautifully styled PDF: the renderer and macOS CLI behind md2pdf.me
翻譯準備中
取自儲存庫 README
正在載入完整 README。
檢視完整 README ↗Convert Markdown to beautifully styled PDFs. This is the rendering engine and macOS command-line tool behind md2pdf.me, the free online converter.
Supports GitHub-flavored Markdown: tables, task lists, footnotes, emoji shortcodes, syntax-highlighted code, raw HTML, GitHub alerts and Obsidian callouts (> [!NOTE], > [!tip] Custom title), Obsidian wikilinks and embeds ([[Note|alias]] prints as plain text, ![[image.png]] as an image, and an embedded note as a placeholder naming it), YAML front matter (left out of the PDF; its title: names the document when there is no # heading), and page breaks (<div class="page-break"></div>). Six print styles are included: github, classic, academic, modern, report and resume.
Markdown is rendered to HTML with markdown-it and printed to PDF by headless Chrome.
Requires Node.js and Google Chrome (Chromium, Edge or Brave also work).
./install.sh
This installs:
~/.local/bin/md2pdf — the command-line tool.md file in Finder → Quick Actions → Convert to PDF.md files in Finder and press itRe-run install.sh if you move this folder or remove the Node version it was installed with. ./uninstall.sh removes all of it.
To use a different shortcut, pass it when installing (@ ⌘, ~ ⌥, ^ ⌃, $ ⇧), or set it to empty to skip:
MD2PDF_SHORTCUT='@$p' ./install.sh # ⇧⌘P
MD2PDF_SHORTCUT= ./install.sh # no shortcut
You can also change it later in System Settings → Keyboard → Keyboard Shortcuts → Services → Files and Folders → Convert to PDF.
md2pdf notes.md # → notes.pdf next to notes.md
md2pdf *.md # convert several at once
md2pdf notes.md -o ~/out.pdf # choose the output path
md2pdf notes.md -p A4 # page size (default: Letter)
md2pdf notes.md --open # open the PDF when done
md2pdf notes.md -s classic # use a specific style
md2pdf notes.md --css my.css # layer extra CSS on top of the style
md2pdf notes.md --html # also write the intermediate HTML (for tweaking CSS)
From Finder, a single file opens in Preview when done; multiple files show a notification.
| Style | Look |
|---|---|
github | GitHub's Markdown rendering: sans-serif, boxed tables, GitHub syntax colors |
classic | Book-like: Iowan Old Style serif, justified text, small-caps headings, ruled tables, page numbers |
academic | Journal article: Palatino, numbered sections (1, 1.1, 1.1.1), booktabs tables, journal-style footnotes |
modern | Clean sans-serif (Avenir Next / Segoe UI), generous whitespace, one blue accent |
report | Business or technical report: title block from the first heading, running header with the title, "Page N of M" footers, gridded tables |
resume | Compact and one-page friendly: the first heading is your name, the paragraph after it your contact line, ## headings are ruled section dividers |
Switch the default style — used by the Finder Quick Action, the keyboard shortcut and the md2pdf command:
./set-style.sh # list styles (* marks the default)
./set-style.sh classic # make classic the default
The choice is saved in ~/.config/md2pdf/config.json. Use md2pdf -s <style> to override it for one conversion.
Styles are registered in the STYLES map in bin/md2pdf.js; each is a list of CSS files inlined into the page in order. Create styles/<name>.css (the content is wrapped in <article class="markdown-body">), register it in STYLES, and it's available to -s and set-style.sh. Use md2pdf --html to get the intermediate HTML for tweaking in a browser. For one-off tweaks, --css is enough.
The text of the document's first # heading (empty if there is none) is available to page margin boxes as var(--document-title), e.g. @top-left { content: var(--document-title); }, as the report style does.
The Markdown renderer and the print styles can be installed straight from GitHub:
npm install github:jbrecht/md2pdf#v1.1.0
import hljs from 'highlight.js';
import { createRenderer, buildDocument, titleOf } from 'md2pdf/render';
const md = createRenderer({ hljs });
const html = buildDocument({
bodyHtml: md.render(markdown),
title: titleOf(markdown, 'document'),
css: classicCss, // e.g. the contents of md2pdf/styles/classic.css
pageSize: 'A4',
});
| Export | What it is |
|---|---|
md2pdf/render | createRenderer({ hljs, math? }), buildDocument(...), titleOf(markdown, fallback) (the first # heading, else the front matter's title:, else the fallback), escapeHtml(s), cssString(s), headingText(html) |
md2pdf/styles/<name>.css | The classic, academic, modern, report and resume styles |
md2pdf/styles/github.css | Print adjustments for the GitHub style; use it after github-markdown-css and highlight.js's github.css theme |
createRenderer takes the highlight.js instance to use (so you can pass a smaller bundle such as highlight.js/lib/common) and, optionally, math: { texmath, katex } from markdown-it-texmath and katex to render \( \), \[ \], $ and $$ formulas.
npm install
npm test # end-to-end tests against test/fixtures
Set CHROME_PATH to use a specific browser binary.
MIT © 2026 Threepenny Labs LLC