/Doc/documenting/style.rst

http://unladen-swallow.googlecode.com/ · ReStructuredText · 70 lines · 50 code · 20 blank · 0 comment · 0 complexity · 29f384595ab805d2c72765f594fa4f75 MD5 · raw file

  1. .. highlightlang:: rest
  2. Style Guide
  3. ===========
  4. The Python documentation should follow the `Apple Publications Style Guide`_
  5. wherever possible. This particular style guide was selected mostly because it
  6. seems reasonable and is easy to get online.
  7. Topics which are not covered in the Apple's style guide will be discussed in
  8. this document.
  9. All reST files use an indentation of 3 spaces. The maximum line length is 80
  10. characters for normal text, but tables, deeply indented code samples and long
  11. links may extend beyond that.
  12. Make generous use of blank lines where applicable; they help grouping things
  13. together.
  14. A sentence-ending period may be followed by one or two spaces; while reST
  15. ignores the second space, it is customarily put in by some users, for example
  16. to aid Emacs' auto-fill mode.
  17. Footnotes are generally discouraged, though they may be used when they are the
  18. best way to present specific information. When a footnote reference is added at
  19. the end of the sentence, it should follow the sentence-ending punctuation. The
  20. reST markup should appear something like this::
  21. This sentence has a footnote reference. [#]_ This is the next sentence.
  22. Footnotes should be gathered at the end of a file, or if the file is very long,
  23. at the end of a section. The docutils will automatically create backlinks to
  24. the footnote reference.
  25. Footnotes may appear in the middle of sentences where appropriate.
  26. Many special names are used in the Python documentation, including the names of
  27. operating systems, programming languages, standards bodies, and the like. Most
  28. of these entities are not assigned any special markup, but the preferred
  29. spellings are given here to aid authors in maintaining the consistency of
  30. presentation in the Python documentation.
  31. Other terms and words deserve special mention as well; these conventions should
  32. be used to ensure consistency throughout the documentation:
  33. CPU
  34. For "central processing unit." Many style guides say this should be spelled
  35. out on the first use (and if you must use it, do so!). For the Python
  36. documentation, this abbreviation should be avoided since there's no
  37. reasonable way to predict which occurrence will be the first seen by the
  38. reader. It is better to use the word "processor" instead.
  39. POSIX
  40. The name assigned to a particular group of standards. This is always
  41. uppercase.
  42. Python
  43. The name of our favorite programming language is always capitalized.
  44. Unicode
  45. The name of a character set and matching encoding. This is always written
  46. capitalized.
  47. Unix
  48. The name of the operating system developed at AT&T Bell Labs in the early
  49. 1970s.
  50. .. _Apple Publications Style Guide: http://developer.apple.com/documentation/UserExperience/Conceptual/APStyleGuide/APSG_2008.pdf