style-prose

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
When writing or editing text files (markdown, plain text, etc.), use Semantic Line Breaks (sembr.org).
当你编写或编辑文本文件(markdown、纯文本等)时,请使用 Semantic Line Breaks(语义换行)(sembr.org)。

Rules

规则

  • Line length: aim for 80-100 characters per line. This is the primary constraint; the rules below serve it.
  • Add a line break after each sentence (after
    .
    ,
    !
    , or
    ?
    ).
  • Break at a clause boundary when a line would otherwise exceed ~100 characters.
  • Do not micro-split: short clauses, enumerations, and closely related phrases should stay on the same line when they fit within the target length.
  • Break before enumerated or itemized lists.
  • Do not break within hyphenated words.
  • Allow longer lines for URLs, code spans, or markup.
  • 行长度:每行尽量控制在 80-100 个字符。这是首要约束,以下规则都为此服务。
  • 在每个句子末尾(
    .
    !
    ?
    之后)添加换行符。
  • 如果某行即将超过 ~100 个字符,可在分句边界处换行。
  • 不要过度拆分:短分句、枚举项以及关联紧密的短语只要符合目标长度要求,就应该放在同一行。
  • 在枚举列表或项目列表前换行。
  • 不要在带连字符的单词中间换行。
  • URL、行内代码或标记可以保留更长的行。

Why

为什么使用语义换行

Semantic line breaks make diffs cleaner: editing one clause changes only one line, not the entire paragraph. The rendered output is unaffected.
语义换行可以让 diff 更清晰:编辑某一个分句只会改动一行,而非整个段落。渲染后的输出不会受到任何影响。

Scope

适用范围

Apply to all prose in markup files (markdown, rst, adoc, plain text). Do not apply to code blocks, YAML frontmatter, or structured data inside these files.
适用于标记文件(markdown、rst、adoc、纯文本)中的所有散文类内容。不要应用于这些文件内的代码块、YAML 前言头或者结构化数据。