github.com/rentongzhang/docker@v1.8.2-rc1/docs/project/doc-style.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Style guide for Docker documentation"
     4  description = "Style guide for Docker documentation describing standards and conventions for contributors"
     5  keywords = ["style, guide, docker,  documentation"]
     6  [menu.main]
     7  parent = "mn_opensource"
     8  weight=100
     9  +++
    10  <![end-metadata]-->
    11  
    12  # Docker documentation: style & grammar conventions
    13  
    14  ## Style standards
    15  
    16  Over time, different publishing communities have written standards for the style
    17  and grammar they prefer in their publications. These standards are called
    18  [style guides](http://en.wikipedia.org/wiki/Style_guide). Generally, Docker’s
    19  documentation uses the standards described in the
    20  [Associated Press's (AP) style guide](http://en.wikipedia.org/wiki/AP_Stylebook). 
    21  If a question about syntactical, grammatical, or lexical practice comes up,
    22  refer to the AP guide first. If you don’t have a copy of (or online subscription
    23  to) the AP guide, you can almost always find an answer to a specific question by
    24  searching the web. If you can’t find an answer, please ask a
    25  [maintainer](https://github.com/docker/docker/blob/master/docs/MAINTAINERS) and
    26  we will find the answer.
    27  
    28  That said, please don't get too hung up on using correct style. We'd rather have
    29  you submit good information that doesn't conform to the guide than no
    30  information at all. Docker's tech writers are always happy to help you with the
    31  prose, and we promise not to judge or use a red pen!
    32  
    33  > **Note:**
    34  > The documentation is written with paragraphs wrapped at 80 column lines to
    35  > make it easier for terminal use. You can probably set up your favorite text
    36  > editor to do this automatically for you.
    37  
    38  ### Prose style
    39  
    40  In general, try to write simple, declarative prose. We prefer short,
    41  single-clause sentences and brief three-to-five sentence paragraphs. Try to
    42  choose vocabulary that is straightforward and precise. Avoid creating new terms,
    43  using obscure terms or, in particular, using a lot of jargon. For example, use
    44  "use" instead of leveraging "leverage".
    45  
    46  That said, don’t feel like you have to write for localization or for
    47  English-as-a-second-language (ESL) speakers specifically. Assume you are writing
    48  for an ordinary speaker of English with a basic university education. If your
    49  prose is simple, clear, and straightforward it will translate readily.
    50  
    51  One way to think about this is to assume Docker’s users are generally university
    52  educated and read at at least a "16th" grade level (meaning they have a
    53  university degree). You can use a [readability
    54  tester](https://readability-score.com/) to help guide your judgement. For
    55  example, the readability score for the phrase "Containers should be ephemeral"
    56  is around the 13th grade level (first year at university), and so is acceptable.
    57  
    58  In all cases, we prefer clear, concise communication over stilted, formal
    59  language. Don't feel like you have to write documentation that "sounds like
    60  technical writing."
    61  
    62  ### Metaphor and figurative language
    63  
    64  One exception to the "don’t write directly for ESL" rule is to avoid the use of
    65  metaphor or other
    66  [figurative language](http://en.wikipedia.org/wiki/Literal_and_figurative_language) to
    67  describe things. There are too many cultural and social issues that can prevent
    68  a reader from correctly interpreting a metaphor.
    69  
    70  ## Specific conventions
    71  
    72  Below are some specific recommendations (and a few deviations) from AP style
    73  that we use in our docs.
    74  
    75  ### Contractions
    76  
    77  As long as your prose does not become too slangy or informal, it's perfectly
    78  acceptable to use contractions in our documentation. Make sure to use
    79  apostrophes correctly.
    80  
    81  ### Use of dashes in a sentence.
    82  
    83  Dashes refers to the en dash (–) and the em dash (—). Dashes can be used to
    84  separate parenthetical material.
    85  
    86  Usage Example: This is an example of a Docker client – which uses the Big Widget
    87  to run – and does x, y, and z.
    88  
    89  Use dashes cautiously and consider whether commas or parentheses would work just
    90  as well. We always emphasize short, succinct sentences.
    91  
    92  More info from the always handy [Grammar Girl site](http://www.quickanddirtytips.com/education/grammar/dashes-parentheses-and-commas).
    93  
    94  ### Pronouns
    95  
    96  It's okay to use first and second person pronouns, especially if it lets you avoid a passive construction. Specifically, always use "we" to
    97  refer to Docker and "you" to refer to the user. For example, "We built the
    98  `exec` command so you can resize a TTY session." That said, in general, try to write simple, imperative sentences that avoid the use of pronouns altogether. Say "Now, enter your SSH key" rather than "You can now enter your SSH key."
    99  
   100  As much as possible, avoid using gendered pronouns ("he" and "she", etc.).
   101  Either recast the sentence so the pronoun is not needed or, less preferably,
   102  use "they" instead. If you absolutely can't get around using a gendered pronoun,
   103  pick one and stick to it. Which one you choose is up to you. One common
   104  convention is to use the pronoun of the author's gender, but if you prefer to
   105  default to "he" or "she", that's fine too.
   106  
   107  ### Capitalization 
   108  
   109  #### In general
   110  
   111  Only proper nouns should be capitalized in body text. In general, strive to be
   112  as strict as possible in applying this rule. Avoid using capitals for emphasis
   113  or to denote "specialness".
   114  
   115  The word "Docker" should always be capitalized when referring to either the
   116  company or the technology. The only exception is when the term appears in a code
   117  sample.
   118  
   119  #### Starting sentences
   120  
   121  Because code samples should always be written exactly as they would appear
   122  on-screen, you should avoid starting sentences with a code sample.
   123  
   124  #### In headings
   125  
   126  Headings take sentence capitalization, meaning that only the first letter is
   127  capitalized (and words that would normally be capitalized in a sentence, e.g.,
   128  "Docker"). Do not use Title Case (i.e., capitalizing every word) for headings. Generally, we adhere to [AP style
   129  for titles](http://www.quickanddirtytips.com/education/grammar/capitalizing-titles).
   130  
   131  ### Periods
   132  
   133  We prefer one space after a period at the end of a sentence, not two. 
   134  
   135  See [lists](#lists) below for how to punctuate list items.
   136  
   137  ### Abbreviations and acronyms
   138  
   139  * Exempli gratia (e.g.) and id est ( i.e.): these should always have periods and
   140  are always followed by a comma.
   141  
   142  * Acronyms are pluralized by simply adding "s", e.g., PCs, OSs.
   143  
   144  * On first use on a given page, the complete term should be used, with the
   145  abbreviation or acronym in parentheses. E.g., Red Hat Enterprise Linux (RHEL).
   146  The exception is common, non-technical acronyms like AKA or ASAP. Note that
   147  acronyms other than i.e. and e.g. are capitalized.
   148  
   149  * Other than "e.g." and "i.e." (as discussed above), acronyms do not take
   150  periods, PC not P.C.
   151  
   152  
   153  ### Lists
   154  
   155  When writing lists, keep the following in mind:
   156  
   157  Use bullets when the items being listed are independent of each other and the
   158  order of presentation is not important.
   159  
   160  Use numbers for steps that have to happen in order or if you have mentioned the
   161  list in introductory text. For example, if you wrote "There are three config
   162  settings available for SSL, as follows:", you would number each config setting
   163  in the subsequent list.
   164  
   165  In all lists, if an item is a complete sentence, it should end with a
   166  period. Otherwise, we prefer no terminal punctuation for list items.
   167  Each item in a list should start with a capital.
   168  
   169  ### Numbers
   170  
   171  Write out numbers in body text and titles from one to ten. From 11 on, use numerals.
   172  
   173  ### Notes
   174  
   175  Use notes sparingly and only to bring things to the reader's attention that are
   176  critical or otherwise deserving of being called out from the body text. Please
   177  format all notes as follows:
   178  
   179      > **Note:**
   180      > One line of note text
   181      > another line of note text
   182  
   183  ### Avoid excess use of "i.e."
   184  
   185  Minimize your use of "i.e.". It can add an unnecessary interpretive burden on
   186  the reader. Avoid writing "This is a thing, i.e., it is like this". Just
   187  say what it is: "This thing is …"
   188  
   189  ### Preferred usages
   190  
   191  #### Login vs. log in. 
   192  
   193  A "login" is a noun (one word), as in "Enter your login". "Log in" is a compound
   194  verb (two words), as in "Log in to the terminal".
   195  
   196  ### Oxford comma
   197  
   198  One way in which we differ from AP style is that Docker’s docs use the [Oxford
   199  comma](http://en.wikipedia.org/wiki/Serial_comma) in all cases. That’s our
   200  position on this controversial topic, we won't change our mind, and that’s that!
   201  
   202  ### Code and UI text styling
   203  
   204  We require `code font` styling (monospace, sans-serif) for all text that refers
   205  to a command or other input or output from the CLI. This includes file paths
   206  (e.g., `/etc/hosts/docker.conf`). If you enclose text in backticks (`) markdown
   207  will style the text as code. 
   208  
   209  Text from a CLI should be quoted verbatim, even if it contains errors or its
   210  style contradicts this guide. You can add "(sic)" after the quote to indicate
   211  the errors are in the quote and are not errors in our docs.
   212  
   213  Text taken from a GUI (e.g., menu text or button text) should appear in "double
   214  quotes". The text should take the exact same capitalisation, etc. as appears in
   215  the GUI. E.g., Click "Continue" to save the settings.
   216  
   217  Text that refers to a keyboard command or hotkey is capitalized (e.g., Ctrl-D).
   218  
   219  When writing CLI examples, give the user hints by making the examples resemble
   220  exactly what they see in their shell: 
   221  
   222  * Indent shell examples by 4 spaces so they get rendered as code blocks.
   223  * Start typed commands with `$ ` (dollar space), so that they are easily
   224    differentiated from program output.
   225  * Program output has no prefix.
   226  * Comments begin with # (hash space).
   227  * In-container shell commands, begin with `$$ ` (dollar dollar space).
   228  
   229  Please test all code samples to ensure that they are correct and functional so
   230  that users can successfully cut-and-paste samples directly into the CLI.
   231  
   232  ## Pull requests
   233  
   234  The pull request (PR) process is in place so that we can ensure changes made to
   235  the docs are the best changes possible. A good PR will do some or all of the
   236  following:
   237  
   238  * Explain why the change is needed
   239  * Point out potential issues or questions
   240  * Ask for help from experts in the company or the community
   241  * Encourage feedback from core developers and others involved in creating the
   242    software being documented.
   243  
   244  Writing a PR that is singular in focus and has clear objectives will encourage
   245  all of the above. Done correctly, the process allows reviewers (maintainers and
   246  community members) to validate the claims of the documentation and identify
   247  potential problems in communication or presentation. 
   248  
   249  ### Commit messages
   250  
   251  In order to write clear, useful commit messages, please follow these
   252  [recommendations](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message).
   253  
   254  ## Links
   255  
   256  For accessibility and usability reasons, avoid using phrases such as "click
   257  here" for link text. Recast your sentence so that the link text describes the
   258  content of the link, as we did in the
   259  ["Commit messages" section](#commit-messages) above.
   260  
   261  You can use relative links (../linkeditem) to link to other pages in Docker's
   262  documentation.
   263  
   264  ## Graphics
   265  
   266  When you need to add a graphic, try to make the file-size as small as possible.
   267  If you need help reducing file-size of a high-resolution image, feel free to
   268  contact us for help.
   269  Usually, graphics should go in the same directory as the .md file that
   270  references them, or in a subdirectory for images if one already exists.
   271  
   272  The preferred file format for graphics is PNG, but GIF and JPG are also
   273  acceptable. 
   274  
   275  If you are referring to a specific part of the UI in an image, use
   276  call-outs (circles and arrows or lines) to highlight what you’re referring to.
   277  Line width for call-outs should not exceed five pixels. The preferred color for
   278  call-outs is red.
   279  
   280  Be sure to include descriptive alt-text for the graphic. This greatly helps
   281  users with accessibility issues.
   282  
   283  Lastly, be sure you have permission to use any included graphics.