The Guide Style Guide¶

Como toda documentação, ter um formato consistente ajuda a fazer o documento mais claro. Com o objetivo de fazer O Guia ser de mais fácil digestão, todas as contribuições devem seguir as regras de estilo descritas aqui onde necessário.
The Guide is written asreStructuredText.
Nota
Parts of The Guide may not yet match this style guide. Feel freeto update those parts to be in sync with The Guide Style Guide
Nota
On any page of the rendered HTML you can click “Show Source” tosee how authors have styled the page.
Relevancy¶
Strive to keep any contributions relevant to thepurpose of The Guide.
- Avoid including too much information on subjects that don’t directlyrelate to Python development.
- Prefer to link to other sources if the information is already out there.Be sure to describe what and why you are linking.
- Citereferences where needed.
- If a subject isn’t directly relevant to Python, but useful in conjunctionwith Python (e.g., Git, GitHub, Databases), reference by linking to usefulresources, and describe why it’s useful to Python.
- When in doubt, ask.
Headings¶
Use the following styles for headings.
Chapter title:
#########Chapter 1#########
Page title:
*******************Time is an Illusion*******************
Section headings:
Lunchtime Doubly So===================
Sub section headings:
Very Deep---------
Prose¶
Wrap text lines at 78 characters. Where necessary, lines may exceed 78characters, especially if wrapping would make the source text more difficultto read.
Use Standard American English, not British English.
Use of theserial comma(also known as the Oxford comma) is 100% non-optional. Any attempt tosubmit content with a missing serial comma will result in permanent banishmentfrom this project, due to complete and total lack of taste.
Banishment? Is this a joke? Hopefully we will never have to find out.
Code Examples¶
Wrap all code examples at 70 characters to avoid horizontal scrollbars.
Command line examples:
..code-block::console$ runcommand --help$ ls ..
Be sure to include the$
prefix before each line for Unix console examples.
For Windows console examples, usedoscon
orpowershell
instead ofconsole
, and omit the$
prefix.
Python interpreter examples:
Label the example::..code-block:: python >>> import this
Python examples:
Descriptive title::..code-block::pythondefget_answer():return42
Externally Linking¶
Prefer labels for well known subjects (e.g. proper nouns) when linking:
Sphinx_ is used to document Python..._Sphinx: https://www.sphinx-doc.org
Prefer to use descriptive labels with inline links instead of leaving barelinks:
Read the`Sphinx Tutorial<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_
Avoid using labels such as “click here”, “this”, etc., preferringdescriptive labels (SEO worthy) instead.
Linking to Sections in The Guide¶
To cross-reference other parts of this documentation, use the:ref:keyword and labels.
To make reference labels more clear and unique, always add a-ref
suffix:
.._some-section-ref:Some Section------------
Notes and Warnings¶
Make use of the appropriateadmonitions directives when making notes.
Notes:
..note:: The Hitchhiker’s Guide to the Galaxy has a few things to say on the subject of towels. A towel, it says, is about the most massively useful thing an interstellar hitch hiker can have.
Warnings:
..warning:: DON'T PANIC
TODOs¶
Please mark any incomplete areas of The Guide with atodo directive. Toavoid cluttering theLista de tarefas, use a singletodo
for stubdocuments or large incomplete sections.
..todo:: Learn the Ultimate Answer to the Ultimate Question of Life, The Universe, and Everything