---
name: md-typeset-yashu
description: 本技能对 Markdown 文件执行排版优化，调整标题层级、段落留白、列表结构与引用形式等排版元素。激活条件：用户消息须包含以下关键词之一:`优化排版`、`排版优化`、`美化 markdown`、`公众号排版`、`markdown 排版`。
title: md-typeset-yashu
canonical_url: https://skilld.dev/gh/steelan9199/wechat-publisher/md-typeset-yashu
last_updated: 2026-10-07T07:20:50.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/typesetting-rules.md](https://skilld.dev/api/skills-raw/steelan9199/wechat-publisher/md-typeset-yashu/references/typesetting-rules.md).
>
> If the user asked to install this Skill, run `npx skilld install steelan9199/wechat-publisher/md-typeset-yashu`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/md-typeset-yashu`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/steelan9199/wechat-publisher/md-typeset-yashu) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/md-typeset-yashu`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/md-typeset-yashu --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/md-typeset-yashu --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Md Typeset — Markdown 排版优化

## Overview

对用户提供的 Markdown 文件执行「适度型」排版优化：在正文内容基本保留的前提下，调整标题层级、段落留白、列表结构、引用形式，并合理引入 Obsidian 扩展语法（callout 提示框、`==高亮==`、`---` 分割线），使文章在公众号（支持 Obsidian 语法）发布时呈现专业、清晰、有节奏的阅读体验。

**核心原则：正文内容基本保留。** 只动结构与排版；允许的文字级操作有三项：① 删除句首 / 句中冗余的口语填充语气词（如「嗯」「啊」「哦」「哎」），不删句末承担语气功能的助词（吧、呢、吗、呀）；② 对标题进行适度精炼，使其更简洁、准确（但不改变标题所指涉的主题）；③ 标点语义修正--基于语义修复语音输入导致的标点错误并修复断句节奏。详见 `references/typesetting-rules.md` 第 11 节、第 2 节与第 12 节。

**不适用场景：**

- 用户要求改写、润色、扩写**正文**（超出语气词清理、标点修正范围）→ 拒绝并说明本技能只做排版优化、冗余语气词清理、标点语义修正与标题精炼，不做正文内容改写。
- 未提供文件绝对路径（仅有文章文本粘贴） → 仍可执行，但优先请用户提供文件路径以便生成副本。
- 用户要求引入 emoji 装饰、激进视觉改造 → 本技能为「适度型」，不主动加 emoji；如用户明确要 emoji，可在执行前确认升级为激进型，否则保持适度型默认。

## Workflow

### 步骤 1：接收与校验输入

- 确认用户提供了 Markdown 文件绝对路径。
- 用 Read 工具读取该文件全文。
- 若文件不存在或无法读取，立即向用户报错并请求正确路径，不要编造内容。

### 步骤 2：通读与结构诊断

通读全文，识别以下结构问题（**不评价内容好坏，只看排版**）：

- 标题层级混乱（多个 H1、层级跳跃、同级标题风格不一）。
- 段落留白不当（缺空行、连续多空行、标题紧贴正文）。
- 列表符号混用（`-` 与 `*` 混用、缩进不一致）。
- 引用块未充分利用（普通 `>` 可升级为 callout 的场景）。
- 缺少分隔节奏（长文无分割线、章节边界模糊）。
- 中文排版瑕疵（中英文无空格、半角全角标点混用、数字与中文粘连）。
- 标点语义错误（语音输入导致的逗号该为句号、疑问句缺问号、一逗到底、冗余停顿标点等）。
- 关键句缺少视觉强调（可考虑 `==高亮==`）。

### 步骤 3：应用排版规则

按 `references/typesetting-rules.md` 中的规则集逐项执行。核心规则摘要：

1. **标题规整**：全文最多一个 H1；H2/H3 层级递进不跳跃；同级标题风格统一。允许调整标题层级，允许对标题做轻微润色（统一中英文标点、补全序号、去冗余空格），也允许对标题文字进行适度精炼——使啰嗦的标题更简洁、使模糊的标题更准确——但不可改变标题所指涉的主题。
2. **段落留白**：段落之间空一行；标题前空一行、标题后空一行接正文；连续多个空行合并为单个空行；文末不留多余空行。
3. **列表统一**：全文统一使用 `-` 作为无序列表符号；有序列表统一用 `1.` 起始让渲染器自动编号；嵌套缩进 2 空格。
4. **引用美化**：当引用块是提示 / 注意 / 警告 / 引用金句性质时，可将其从普通 `>` 升级为 Obsidian callout（`> [!note]` / `> [!tip]` / `> [!warning]` / `> [!quote]` 等）。**纯叙述性引用保持普通 `>` 不动。**
5. **分割线**：章节之间、明显的话题转换处插入 `---` 分割线，建立阅读节奏；短文不分章节的不过度切分。
6. **高亮强调**：对文中本就关键的单句或短语，可用 `==高亮==` 强调；**不滥用**，每屏不超过 1-2 处。
7. **中文排版**：中文与英文 / 数字之间加半角空格；统一使用中文全角标点（逗号、句号、问号、感叹号、顿号、引号）；不混入半角标点。
8. **语气词清理**：删除句首 / 句中孤立的口语填充语气词（嗯、啊、哦、哎、唉等），不删句末承担语气功能的助词（吧、呢、吗、呀）。详见 `references/typesetting-rules.md` 第 11 节。
9. **标点语义修正**：基于语义修复语音输入导致的标点错误（逗号该为句号、疑问句缺问号、一逗到底、冗余停顿标点等）并修复断句节奏；适用于正文、列表项、引用块、表格单元格等全部自然语言文本，代码块 / 链接 / 图片地址不动。详见 `references/typesetting-rules.md` 第 12 节。

### 步骤 4：生成副本（不覆盖原文件）

- 在**原文件同目录**下生成副本，命名规则：去掉 `.md` 扩展名后追加 `_排版版.md`。
  - 例：`D:\articles\my-post.md` → `D:\articles\my-post_排版版.md`
- 用 Write 工具写入副本。
- **绝不覆盖原文件。** 原文是用户的资产，保留原文以备回滚。

### 步骤 5：交付与展示

- 用 present_files 工具展示生成的副本文件绝对路径，让用户可直接查看。
- 在回复中简要说明本次做了哪些排版调整（标题层级、callout 升级、留白、分割线等），不超过 6-8 行。
- 如有拿不准的排版选择（例如某段引用是否升级为 callout），在回复中标注「已按 X 处理，如需调整可告知」，便于用户迭代。

## 内容边界（红线 · 不可逾越）

以下属于「内容」，**严禁修改**：

- 正文段落中的措辞、语序等文字内容。**例外：① 句首 / 句中冗余语气词清理（见第 11 节），仅删不写；② 标点语义修正（见第 12 节），仅改标点不动文字。**
- 标题的**主题指向**（可调层级、可润色标点 / 序号 / 空格、可适度精炼文字使其更简洁准确，但不可改变标题所指涉的主题）。
- 代码块内的代码内容。
- 链接地址与链接文字。
- 图片地址与图片说明文字。
- 列表项的文字内容（仅允许标点语义修正，见第 12 节）。
- 引用块内的文字内容（可升级引用形式为 callout，文字本身不动；仅允许标点语义修正，见第 12 节）。
- 表格内的单元格文字（可调表格对齐符号，不动文字；仅允许标点语义修正，见第 12 节）。

以下属于「排版」，**允许修改**：

- 标题层级（`#` 的数量）与标题前后留白。
- 标题文字的适度精炼（删冗余词、缩短啰嗦表述、使模糊标题更准确，但不改变主题）。
- 段落间空行数量。
- 列表符号（`-`/`*` 统一）与嵌套缩进。
- 引用形式（普通 `>` ↔ callout）。
- 分割线的增删。
- 加粗 / 斜体 / 高亮 / 删除线等**装饰性标记**的增删（不改文字本身）。
- 中英文间空格、标点全半角统一（属排版规范，非内容改写）。
- **语气词清理（正式允许的文字级操作之一）**：删除句首 / 句中孤立的口语填充语气词（如「嗯，」「啊，」「哦，」「哎，」「唉，」），不删句末承担语气功能的助词（吧、呢、吗、呀等）。详见 `references/typesetting-rules.md` 第 11 节。
- **标点语义修正（正式允许的文字级操作之一）**：基于语义修复语音输入导致的标点错误（逗号该为句号、缺问号、一逗到底、冗余停顿标点等）并修复断句节奏；适用于正文、列表项、引用块、表格单元格等全部自然语言文本，代码块 / 链接 / 图片地址不动。详见 `references/typesetting-rules.md` 第 12 节。

## Obsidian 语法策略

本技能面向支持 Obsidian 语法的公众号发布软件。语法白名单与禁用清单详见 `references/typesetting-rules.md`。

**白名单（可主动使用）：**

- Callout：`> [!note]` / `> [!tip]` / `> [!warning]` / `> [!quote]` / `> [!info]` / `> [!example]` / `> [!important]` / `> [!caution]`
- 高亮：`==text==`
- 分割线：`---`
- 标准语法：标题、列表、引用、加粗 `**`、斜体 `*`、行内代码 `` ` ``、代码块、表格、链接

**禁用（不主动引入，原文已有则保留）：**

- Emoji 装饰（适度型策略，避免视觉过载）。
- 脚注 `[^1]`（除非原文已使用）。
- 数学公式 `$...$` / `$$...$$`（除非原文已使用）。
- Mermaid 图、嵌入 `![[...]]`、自定义 HTML 标签等复杂语法。

## 输出规范

- 输出文件：`<原文件名>_排版版.md`，与原文件同目录。
- 文件编码：UTF-8 无 BOM。
- 换行符：保持与原文件一致（不主动转换 LF/CRLF）。
- 完成后必须用 present_files 展示副本路径。
- 不主动删除或覆盖原文件。

## 参考资料

排版执行时加载 `references/typesetting-rules.md`，其中包含：

- 完整的中文排版规范细则（中英文空格、标点全半角、数字处理）。
- Obsidian callout 完整语法与适用场景对照表。
- 标题层级调整的决策树。
- 留白节奏的量化标准（段间空行、标题前后空行）。
- 排版前后对照示例。
