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