Skip to content

Commit 6aacf90

Browse files
oraNodsamccann
andauthored
Add one sentence per line to the style guide (#2470)
* issue #2463 one sentence per line style guide * Apply suggestions from code review --------- Co-authored-by: Sandra McCann <[email protected]>
1 parent da170cb commit 6aacf90

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

docs/docsite/rst/dev_guide/style_guide/basic_rules.rst

+26
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ Bad:
4141
Better:
4242
Extraction also requires large volumes of water.
4343

44+
.. _one_sentence_per_line:
45+
46+
Use one sentence per line
47+
-------------------------
48+
Consider using a technique called *one sentence per line* when composing paragraphs, or use at least one line per sentence (following https://sembr.org/).
49+
This technique allows you to format RST and Markdown source in a natural and semantic way that is easy to review and edit.
50+
51+
Lines of text that occur next to each other are rendered as a paragraph so readers do not notice the line breaks between sentences.
52+
To create a new paragraph, add an empty line between sentences.
53+
You can still soft wrap lines of text when using one sentence per line.
54+
The important thing is that each line starts at the left margin.
55+
56+
Using one sentence per line reduces cognitive load and makes life much easier for people who review changes.
57+
Diffs become much more straightforward and easier to parse.
58+
For example, when multiple sentences are wrapped at a fixed column width, a change at the start of a paragraph causes the remaining lines in the paragraph to reposition.
59+
60+
In addition to the advantages for version control, one sentence per line makes it easier to do the following:
61+
62+
- Swap sentences around.
63+
- Separate or join paragraphs.
64+
- Comment individual sentences.
65+
- Identify sentences that are too long or that vary widely in length.
66+
- Spot redundant patterns in your writing.
67+
68+
For an example of the one sentence per line in the Ansible documentation, take a look at the RST source under ``docs/docsite/rst/getting_started/``.
69+
4470
Avoid verbosity
4571
---------------
4672
Write short, succinct sentences. Avoid terms like:

docs/docsite/rst/dev_guide/style_guide/grammar_punctuation.rst

+3
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ Spacing after sentences
196196
^^^^^^^^^^^^^^^^^^^^^^^
197197
Use only a single space after a sentence.
198198

199+
.. note::
200+
One sentence per line is preferred to wrapping sentences over multiple lines. See :ref:`one_sentence_per_line`.
201+
199202
Time
200203
^^^^
201204
* Time of day is written as "4 p.m."

0 commit comments

Comments
 (0)