11.. highlightlang :: rest
22
3- Style Guide
3+ Style guide
44===========
55
66The Python documentation should follow the `Apple Publications Style Guide `_
77wherever possible. This particular style guide was selected mostly because it
88seems reasonable and is easy to get online.
99
10- Topics which are not covered in Apple's style guide will be discussed in
11- this document.
10+ Topics which are either not covered in Apple's style guide or treated
11+ differently in Python documentation will be discussed in this
12+ document.
13+
14+ Use of whitespace
15+ -----------------
1216
1317All reST files use an indentation of 3 spaces. The maximum line length is 80
1418characters for normal text, but tables, deeply indented code samples and long
@@ -21,6 +25,9 @@ A sentence-ending period may be followed by one or two spaces; while reST
2125ignores the second space, it is customarily put in by some users, for example
2226to aid Emacs' auto-fill mode.
2327
28+ Footnotes
29+ ---------
30+
2431Footnotes are generally discouraged, though they may be used when they are the
2532best way to present specific information. When a footnote reference is added at
2633the end of the sentence, it should follow the sentence-ending punctuation. The
@@ -34,6 +41,36 @@ the footnote reference.
3441
3542Footnotes may appear in the middle of sentences where appropriate.
3643
44+ Capitalization
45+ --------------
46+
47+ .. sidebar :: Sentence case
48+
49+ Sentence case is a set of capitalization rules used in English
50+ sentences: the first word is always capitalized and other words are
51+ only capitalized if there is a specific rule requiring it.
52+
53+ Apple style guide recommends the use of title case in section titles.
54+ However, rules for which words should be capitalized in title case
55+ vary greaty between publications.
56+
57+ In Python documentation, use of sentence case in section titles is
58+ preferable, but consistency within a unit is more important than
59+ following this rule. If you add a section to the chapter where most
60+ sections are in title case you can either convert all titles to
61+ sentence case or use the dominant style in the new section title.
62+
63+ Sentences that start with a word for which specific rules require
64+ starting it with a lower case letter should be avoided in titles and
65+ elsewhere.
66+
67+ .. note ::
68+
69+ Sections that describe a library module often have titles in the
70+ form of "modulename --- Short description of the module." In this
71+ case, the description should be capitalized as a stand-alone
72+ sentence.
73+
3774Many special names are used in the Python documentation, including the names of
3875operating systems, programming languages, standards bodies, and the like. Most
3976of these entities are not assigned any special markup, but the preferred
@@ -44,26 +81,32 @@ Other terms and words deserve special mention as well; these conventions should
4481be used to ensure consistency throughout the documentation:
4582
4683CPU
47- For "central processing unit." Many style guides say this should be spelled
48- out on the first use (and if you must use it, do so!). For the Python
49- documentation, this abbreviation should be avoided since there's no
50- reasonable way to predict which occurrence will be the first seen by the
51- reader. It is better to use the word "processor" instead.
84+ For "central processing unit." Many style guides say this should be
85+ spelled out on the first use (and if you must use it, do so!). For
86+ the Python documentation, this abbreviation should be avoided since
87+ there's no reasonable way to predict which occurrence will be the
88+ first seen by the reader. It is better to use the word "processor"
89+ instead.
5290
5391POSIX
54- The name assigned to a particular group of standards. This is always
55- uppercase.
92+ The name assigned to a particular group of standards. This is always
93+ uppercase.
5694
5795Python
58- The name of our favorite programming language is always capitalized.
96+ The name of our favorite programming language is always capitalized.
97+
98+ reST
99+ For "reStructuredText," an easy to read, plaintext markup syntax
100+ used to produce Python documentation. When spelled out, it is
101+ always one word and both forms start with a lower case 'r'.
59102
60103Unicode
61- The name of a character set and matching encoding . This is always written
62- capitalized.
104+ The name of a character coding system . This is always written
105+ capitalized.
63106
64107Unix
65- The name of the operating system developed at AT&T Bell Labs in the early
66- 1970s.
108+ The name of the operating system developed at AT&T Bell Labs in the early
109+ 1970s.
67110
68111
69112.. _Apple Publications Style Guide : http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2009.pdf
0 commit comments