compact-markdown
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMarkdown Compactor
Markdown压缩工具
Reduce token count while preserving every detail. No information loss — only waste removed.
在保留所有细节的同时减少Token数量。无信息丢失——仅移除冗余内容。
Output
输出
Infer preference from context (uploaded file → file output; pasted text → inline), or ask.
File output path: .
/mnt/user-data/outputs/<original-name>.min.mdAfter compacting, report:
Original: ~N tokens (~N lines)
Compacted: ~N tokens (~N lines)
Reduction: N%Estimate tokens as .
words × 1.3根据上下文推断输出偏好(上传文件→文件输出;粘贴文本→内联输出),或询问用户。
文件输出路径:.
/mnt/user-data/outputs/<original-name>.min.md压缩完成后,输出报告:
Original: ~N tokens (~N lines)
Compacted: ~N tokens (~N lines)
Reduction: N%Token估算公式为。
单词数 × 1.3Compaction passes (apply in order)
压缩步骤(按顺序执行)
- 1. Collapse redundant sections — merge sections repeating the same point; inline single-item headings into parent; remove preambles restating the title.
- 2. Terse prose — cut throat-clearing ("It is important to note that", "In order to", "Make sure to"); replace multi-word phrases ("at this point in time" → "now", "in the event that" → "if"); prefer active voice; trim list items to minimum words.
- 3. Trim examples — cut examples that merely restate their rule; keep one (most concrete) when multiples illustrate the same point; replace long inline code with a reference or single representative snippet.
file:line - 4. Symbols — only where unambiguous: (leads to/then),
→/e.g.,i.e.,vs.(bullets only). Never invent domain-specific abbreviations.w/ - 5. Formatting — remove decorative bold/italic (keep for terms, warnings, key concepts); flatten lists >2 levels deep; remove blank lines between tight list items.
- 1. 合并冗余章节 —— 合并重复表述同一观点的章节;将仅含单个内容的标题并入父标题;移除重复标题的前置说明。
- 2. 精简措辞 —— 删除冗余铺垫语(如“It is important to note that”、“In order to”、“Make sure to”);用简洁表达替换多词短语(如“at this point in time”→“now”,“in the event that”→“if”);优先使用主动语态;将列表项精简至最少字数。
- 3. 精简示例 —— 删除仅重复规则的示例;当多个示例说明同一观点时,保留一个最具体的;将长行内代码替换为引用或单个代表性代码片段。
file:line - 4. 使用符号 —— 仅在含义明确的情况下使用:(表示“导致/然后”)、
→/e.g.、i.e.、vs.(仅用于列表项)。禁止自创领域特定缩写。w/ - 5. 调整格式 —— 移除装饰性粗体/斜体(保留术语、警告、关键概念的粗体/斜体);将超过2级的列表扁平化;移除紧凑列表项之间的空白行。
Hard rules
硬性规则
- No information loss. Every fact, instruction, and constraint must survive.
- Preserve code blocks exactly. No changes to code, commands, or paths.
- Keep headings unless section is fully absorbed into another.
- Keep YAML frontmatter intact.
- No summarization. Compaction ≠ summarization — shorter, not lossy.
- 无信息丢失:所有事实、指令和约束必须完整保留。
- 完全保留代码块:不得修改代码、命令或路径。
- 保留标题:除非章节完全并入其他章节,否则不得删除标题。
- 完整保留YAML前置元数据:不得修改YAML frontmatter内容。
- 禁止总结:压缩≠总结——仅缩短篇幅,不丢失信息。