Markdown 公众号排版:从写作到一键发布
在公众号后台一段段调字体、调颜色、调间距,是很多运营人的噩梦。用 Markdown 写、再一键转成公众号样式,能把排版时间从一小时压到十分钟。
Markdown 公眾號排版:從寫作到一鍵發布
在公眾號後台一段段調字型、調顏色、調間距,是很多營運人的噩夢。用 Markdown 寫、再一鍵轉成公眾號樣式,能把排版時間從一小時壓到十分鐘。
Markdown for WeChat Official Account layout: from writing to one-click publish
Tweaking fonts, colors, and spacing line by line in the Official Account backend is a nightmare for many operators. Write in Markdown, then convert to the account style in one click—and you cut layout time from an hour to ten minutes.
一、为什么用 Markdown 排公众号
公众号后台是“富文本”编辑器,所有样式都得手动点。而 Markdown 让你只管写、不管样式:标题、加粗、列表、引用、代码用符号标好,转换工具再统一套上你选的主题。
- 一次写好,处处可用:同一份
.md既能发公众号,也能发博客、知乎、个人站。 - 样式稳定:不用每次重新调字号行距,主题一键套用。
- 专注内容:写作时不打断思路去点按钮。
二、公众号排版的几个限制
动手前先知道边界,能少踩很多坑:
1. 不支持原生 Markdown
公众号后台不认 Markdown 语法,必须先把 .md 转成带内联样式的 HTML,再粘贴进去。
2. 外链会被过滤
公众号正文里的外部链接基本会被去掉,只能把链接放“阅读原文”或引导读者私信。所以排版时别依赖正文超链接。
3. 图片要走微信图床
粘贴进来的图片会被微信自动上传到它的图床并重新生成地址;自己搭的图床链接在公众号里常常失效。建议用工具自带的上传,或先传素材库。
4. 代码块样式有限
微信对代码的展示不友好,长代码建议转成图片或截图,或靠转换工具的高亮主题兜底。
三、主流转换工具怎么选
| 工具 | 特点 | 适合 |
|---|---|---|
| mdnice | 在线、主题丰富、支持公众号/知乎,可自定义 CSS | 想精致样式、可微调的人 |
| Markdown 公众号编辑器(MP) | 开源、本地可用、轻量 | 怕数据上传、求简单的人 |
| 秀米 / 135 编辑器 | 模板多、偏“花哨风” | 做活动推文、重设计的人 |
| Typora + 复制 | 本地写作顺手,复制即带样式 | 已用 Typora 的人 |
小技巧:无论用哪个工具,建议先在 365Lab 在线编辑器 把内容写顺、检查标题层级,再粘到转换工具,能避免大部分“粘贴后格式乱掉”的问题。
四、一步步把 md 发到公众号
以通用流程为例(具体按钮名字各工具略有差异):
- 写稿:在编辑器里用 Markdown 写完,确认标题层级清晰(
#到###够用)。 - 粘贴:把
.md内容粘进转换工具,选一个主题(建议先固定一款,形成账号风格)。 - 预览与微调:看右栏效果,调整强调色、引用框、分隔线。
- 复制:点“复制”或“复制到公众号”,回到公众号后台新建图文,直接 Ctrl/Cmd+V。
- 补素材:封面和文中大图在后台单独传;文末引导关注可用工具自带的“引导图”。
图片处理细节可看 Markdown 插入图片;想做成可分享的长图版,参考 Markdown 转图片/长图。
五、样式与配色技巧
固定一套视觉
账号长期用同一套主题(同款强调色、同款引用框),读者一眼就能认出是你。别每篇换风格。
强调色别超过一种
选一个品牌色(如蓝、橙、绿)用于小标题下划线、重点词和引用框,满屏花花绿绿反而廉价。
留白与行距
公众号在手机上阅读,段落间、列表项间多留白,行距 1.6–1.8 最舒服。标题别用太浅的灰。
代码与公式
技术类文章用带底色的代码块;数学公式写法见 Markdown 写数学公式,但公众号里公式常需转图片才稳。
六、常见问题
Q:粘贴到公众号后样式乱了怎么办?
A:多半是用了“保留源格式粘贴”或浏览器拦截了样式。用转换工具的“一键复制”按钮,并在公众号后台用纯粘贴(Ctrl/Cmd+Shift+V 无效时改用工具提供的复制)。
Q:图片在公众号里不显示?
A:微信会重新上传图片到自家图床,外链图床容易被拦。建议在转换时让工具上传图片,或先把图存进公众号素材库再引用。
Q:能不能直接发布,不用手动复制?
A:部分工具(如 mdnice 的某些版本)支持授权后直接推送草稿,但多数仍建议复制粘贴核对一遍,避免排版事故。
Q:手机端看着和电脑预览不一样?
A:很正常,公众号会再缩放。发布前务必用手机扫码预览,重点检查标题层级、代码块和图片宽度。
建立稳定的写作习惯比工具更重要,参见 Markdown 写作工作流;新手从 Markdown 入门 起步,再回来排公众号最顺。
一、為什麼用 Markdown 排公眾號
公眾號後台是「富文字」編輯器,所有樣式都得手動點。而 Markdown 讓你只管寫、不管樣式:標題、加粗、清單、引用、程式碼用符號標好,轉換工具再統一套上你選的主題。
- 一次寫好,處處可用:同一份
.md既能發公眾號,也能發部落格、知乎、個人站。 - 樣式穩定:不用每次重新調字號行距,主題一鍵套用。
- 專注內容:寫作時不打斷思路去點按鈕。
二、公眾號排版的幾個限制
動手前先知道邊界,能少踩很多坑:
1. 不支援原生 Markdown
公眾號後台不認 Markdown 語法,必須先把 .md 轉成帶內聯樣式的 HTML,再貼進去。
2. 外連會被過濾
公眾號正文裡的外部連結基本會被去掉,只能把連結放「閱讀原文」或引導讀者私訊。所以排版時別依賴正文超連結。
3. 圖片要走微信圖床
貼進來的圖片會被微信自動上傳到它的圖床並重新生成地址;自己搭的圖床連結在公眾號裡常常失效。建議用工具自帶的上傳,或先傳素材庫。
4. 程式碼區塊樣式有限
微信對程式碼的展示不友好,長程式碼建議轉成圖片或截圖,或靠轉換工具的高亮主題兜底。
三、主流轉換工具怎麼選
| 工具 | 特點 | 適合 |
|---|---|---|
| mdnice | 線上、主題豐富、支援公眾號/知乎,可自訂 CSS | 想精緻樣式、可微調的人 |
| Markdown 公眾號編輯器(MP) | 開源、本地可用、輕量 | 怕資料上傳、求簡單的人 |
| 秀米 / 135 編輯器 | 模板多、偏「花哨風」 | 做活動推文、重設計的人 |
| Typora + 複製 | 本地寫作順手,複製即帶樣式 | 已用 Typora 的人 |
小技巧:無論用哪個工具,建議先在 365Lab 線上編輯器 把內容寫順、檢查標題層級,再貼到轉換工具,能避免大部分「貼上後格式亂掉」的問題。
四、一步步把 md 發到公眾號
以通用流程為例(具體按鈕名字各工具略有差異):
- 寫稿:在編輯器裡用 Markdown 寫完,確認標題層級清晰(
#到###夠用)。 - 貼上:把
.md內容貼進轉換工具,選一個主題(建議先固定一款,形成帳號風格)。 - 預覽與微調:看右欄效果,調整強調色、引用框、分隔線。
- 複製:點「複製」或「複製到公眾號」,回到公眾號後台新建圖文,直接 Ctrl/Cmd+V。
- 補素材:封面和文中大圖在後台單獨傳;文末引導關注可用工具自帶的「引導圖」。
圖片處理細節可看 Markdown 插入圖片;想做成可分享的長圖版,參考 Markdown 轉圖片/長圖。
五、樣式與配色技巧
固定一套視覺
帳號長期用同一套主題(同款強調色、同款引用框),讀者一眼就能認出是你。別每篇換風格。
強調色別超過一種
選一個品牌色(如藍、橘、綠)用於小標題底線、重點詞和引用框,滿屏花花綠綠反而廉價。
留白與行距
公眾號在手機上閱讀,段落間、清單項間多留白,行距 1.6–1.8 最舒服。標題別用太淺的灰。
程式碼與公式
技術類文章用帶底色的程式碼區塊;數學公式寫法見 Markdown 寫數學公式,但公眾號裡公式常需轉圖才穩。
六、常見問題
Q:貼上到公眾號後樣式亂了怎麼辦?
A:多半是用了「保留來源格式貼上」或瀏覽器攔截了樣式。用轉換工具的「一鍵複製」按鈕,並在公眾號後台用純貼上(Ctrl/Cmd+Shift+V 無效時改用工具提供的複製)。
Q:圖片在公眾號裡不顯示?
A:微信會重新上傳圖片到自家圖床,外連圖床容易被攔。建議在轉換時讓工具上傳圖片,或先把圖存進公眾號素材庫再引用。
Q:能不能直接發布,不用手動複製?
A:部分工具(如 mdnice 的某些版本)支援授權後直接推送草稿,但多數仍建議複製貼上核對一遍,避免排版事故。
Q:手機端看著和電腦預覽不一樣?
A:很正常,公眾號會再縮放。發布前務必用手機掃碼預覽,重點檢查標題層級、程式碼區塊和圖片寬度。
建立穩定的寫作習慣比工具更重要,參見 Markdown 寫作工作流;新手從 Markdown 入門 起步,再回來排公眾號最順。
1. Why lay out accounts in Markdown
The Official Account backend is a "rich text" editor where every style is clicked by hand. Markdown lets you write only, style never: mark headings, bold, lists, quotes, and code with symbols, then the converter applies your chosen theme uniformly.
- Write once, use anywhere: the same
.mdcan go to the account, a blog, Zhihu, or your personal site. - Stable styling: no re-tuning font size and line spacing each time—apply a theme with one click.
- Focus on content: writing isn't interrupted by clicking buttons for formatting.
2. A few limits of account layout
Know the boundaries before you start, and you'll avoid many pitfalls:
1. No native Markdown support
The backend doesn't understand Markdown syntax—you must first turn .md into inline-styled HTML, then paste it in.
2. External links get filtered
External links in the body are basically stripped; you can only put them in "Read original" or ask readers to message you. So don't rely on in-body hyperlinks when laying out.
3. Images must use WeChat's image host
Pasted images are auto-uploaded by WeChat to its own host with a regenerated URL; your self-hosted image links often break in the account. Use the tool's built-in upload, or upload to the material library first.
4. Limited code-block styling
WeChat renders code poorly—long code is better as an image or screenshot, or lean on the converter's highlight theme as a fallback.
3. How to choose a converter
| Tool | Feature | Best for |
|---|---|---|
| mdnice | Online, rich themes, supports account/Zhihu, customizable CSS | Those wanting polished, tweakable styles |
| Markdown Account Editor (MP) | Open source, runs locally, lightweight | Those wary of uploads, wanting simplicity |
| XIUMI / 135 Editor | Many templates, leans "flashy" | Promotional posts, design-heavy users |
| Typora + copy | Smooth local writing, copy carries styles | People already using Typora |
Tip: Whichever tool you use, write and preview in the 365Lab online editor first, checking heading levels, then paste into the converter—this avoids most "format broke after pasting" issues.
4. Publish md to the account, step by step
Using the common flow (button names vary slightly by tool):
- Draft: finish writing in Markdown, with clear heading levels (
#to###is enough). - Paste: paste the
.mdinto the converter and pick a theme (fix one early to build your account's style). - Preview & tweak: check the right pane; adjust accent color, quote boxes, dividers.
- Copy: click "Copy" or "Copy to account," go back to the backend, create a new article, and paste with Ctrl/Cmd+V.
- Add media: upload the cover and in-body images separately in the backend; end-of-article follow prompts can use the tool's built-in "guide image."
For image details see How to insert images in Markdown; for a shareable long-image version, see Markdown to image / long image.
5. Style & color tips
Stick to one visual system
Use the same theme long-term (same accent color, same quote box) so readers recognize you at a glance. Don't switch styles every post.
One accent color at most
Pick a brand color (blue, orange, green) for subheading underlines, keywords, and quote boxes—a screen full of clashing colors looks cheap.
Whitespace & line spacing
Accounts are read on phones; add whitespace between paragraphs and list items, with line spacing 1.6–1.8 being most comfortable. Don't use too-light gray for headings.
Code & formulas
For technical articles use tinted code blocks; for math see Markdown math formulas, but in the account formulas often need to be images to be stable.
6. FAQ
Q: Styles broke after pasting into the account?
A: Usually it's "paste with source formatting" or the browser blocking styles. Use the converter's "one-click copy" button, and in the account backend use a plain paste (if Ctrl/Cmd+Shift+V fails, use the copy the tool provides).
Q: Images don't show in the account?
A: WeChat re-uploads images to its own image host, and external image hosts are often blocked. Let the tool upload images during conversion, or save them to the account's material library first and reference them.
Q: Can I publish directly without manual copy?
A: Some tools (certain mdnice versions) can push drafts after authorization, but most still recommend copying and pasting to double-check and avoid layout accidents.
Q: Mobile looks different from the desktop preview?
A: That's normal—the account rescales it. Before publishing, always scan the QR code on your phone to preview; check heading levels, code blocks, and image width.
A stable writing habit matters more than the tool—see building a Markdown writing workflow; beginners should start from Markdown basics, then come back to lay out the account.