8000 minor #5064 Updated documentation standards (code examples and Englis… · symfony/symfony-docs@dc01076 · GitHub
[go: up one dir, main page]

Skip to content

Commit dc01076

Browse files
committed
minor #5064 Updated documentation standards (code examples and English use) (javiereguiluz)
This PR was merged into the 2.3 branch. Discussion ---------- Updated documentation standards (code examples and English use) | Q | A | ------------- | --- | Doc fix? | no | New docs? | yes | Applies to | all | Fixed tickets | - This PR includes two changes: * Recommendations to create better code examples. * Detailed explanation about our English usage and what to do in case of disputes. Commits ------- e5b6145 Improved the URL of the English reference dictionary b96abbb Reworded the paragraph about enforcing an English reference 9c44351 Rewords, tweaks and fixes 598e522 Updated documentation standards (code examples and English use)
2 parents 65dd03b + e5b6145 commit dc01076

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

contributing/documentation/standards.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Sphinx
88
------
99

1010
* The following characters are chosen for different heading levels: level 1
11-
is ``=``, level 2 ``-``, level 3 ``~``, level 4 ``.`` and level 5 ``"``;
11+
is ``=`` (equal sign), level 2 ``-`` (dash), level 3 ``~`` (tilde), level 4
12+
``.`` (dot) and level 5 ``"`` (double quote);
1213
* Each line should break approximately after the first word that crosses the
1314
72nd character (so most lines end up being 72-78 characters);
1415
* The ``::`` shorthand is *preferred* over ``.. code-block:: php`` to begin a PHP
@@ -50,6 +51,12 @@ Code Examples
5051

5152
* The code follows the :doc:`Symfony Coding Standards </contributing/code/standards>`
5253
as well as the `Twig Coding Standards`_;
54+
* The code examples should look real for a web application context. Avoid abstract
55+
or puerile examples (``foo``, ``bar``, ``demo``, etc.);
56+
* The code should follow the :doc:`Symfony Best Practices </best_practices/introduction>`.
57+
Unless the example requires to use a custom bundle, make sure to always use the
58+
``AppBundle`` bundle to store your code;
59+
* Use ``Acme`` when the code requires a vendor name;
5360
* To avoid horizontal scrolling on code blocks, we prefer to break a line
5461
correctly if it crosses the 85th character;
5562
* When you fold one or more lines of code, place ``...`` in a comment at the point
@@ -140,8 +147,12 @@ Files and Directories
140147
English Language Standards
141148
--------------------------
142149

143-
* **English Dialect**: use the United States English dialect, commonly called
144-
`American English`_.
150+
Symfony documentation uses the United States English dialect, commonly called
151+
`American English`_. The `American English Oxford Dictionary`_ is used as the
152+
vocabulary reference.
153+
154+
In addition, documentation follows these rules:
155+
145156
* **Section titles**: use a variant of the title case, where the first
146157
word is always capitalized and all other words are capitalized, except for
147158
the closed-class words (read Wikipedia article about `headings and titles`_).
@@ -164,6 +175,7 @@ English Language Standards
164175
.. _`the Sphinx documentation`: http://sphinx-doc.org/rest.html#source-code
165176
.. _`Twig Coding Standards`: http://twig.sensiolabs.org/doc/coding_standards.html
166177
.. _`American English`: http://en.wikipedia.org/wiki/American_English
178+
.. _`American English Oxford Dictionary`: http://www.oxforddictionaries.com/definition/american_english/
167179
.. _`headings and titles`: http://en.wikipedia.org/wiki/Letter_case#Headings_and_publication_titles
168180
.. _`Serial (Oxford) Commas`: http://en.wikipedia.org/wiki/Serial_comma
169181
.. _`nosism`: http://en.wikipedia.org/wiki/Nosism

0 commit comments

Comments
 (0)
0