Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

style guide update#940

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
daniel-demelo wants to merge3 commits intorealpython:master
base:master
Choose a base branch
Loading
fromdaniel-demelo:style-guide-update
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 81 additions & 32 deletionsdocs/notes/styleguide.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
.. _guide-style-guide:

=====================
#####################
The Guide Style Guide
=====================
#####################

.. image:: /_static/photos/33573755856_7f43d43adf_k_d.jpg

Expand All@@ -13,14 +13,18 @@ appropriate.

The Guide is written as :ref:`restructuredtext-ref`.

.. note:: Parts of The Guide may not yet match this style guide. Feel free
to update those parts to be in sync with The Guide Style Guide
.. note::
Parts of The Guide may not yet match this style guide. Feel free
to update those parts to be in sync with The Guide Style Guide.

.. note:: On any page of the rendered HTML you can click "Show Source" to
see how authors have styled the page.
.. note::
On any page of the rendered HTML you can click "Show Source" to
see how authors have styled the page.


*********
Relevancy
---------
*********

Strive to keep any contributions relevant to the :ref:`purpose of The Guide
<about-ref>`.
Expand All@@ -36,43 +40,79 @@ Strive to keep any contributions relevant to the :ref:`purpose of The Guide
resources, and describe why it's useful to Python.
* When in doubt, ask.


**********
Whitespace
**********

Indentation
===========

4 spaces, no tabs.

Blank lines
===========

* Two blank lines before *chapter title* and *page title*.
* One blank line before all other headings.
* One blank line after all headings.
* One blank line before and after a directive, *except for notes, no blank
lines after it*.

.. code-block:: reStructuredText

Text...

.. note::
My note.


********
Headings
--------
********

Use the following styles for headings.

Chapter title:

.. code-block:: rest

#########
Chapter 1
#########
#############
H1:Chapter 1
#############

Page title:

.. code-block:: rest

===================
Time is an Illusion
===================
***********************
H2:Time is an Illusion
***********************

Section headings:

.. code-block:: rest

Lunchtime Doubly So
-------------------
H3:Lunchtime Doubly So
=======================

Sub section headings:

.. code-block:: rest

Very Deep
~~~~~~~~~
H4: Very Deep
-------------

Further information on headings formatting can be found on `Style guide for Sphinx-based documentations`_
or `Sphinx reStructuredText Primer`_.

.. _Style guide for Sphinx-based documentations: https://documentation-style-guide-sphinx.readthedocs.io/en/latest/style-guide.html#headings
.. _Sphinx reStructuredText Primer: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#sections


*****
Prose
-----
*****

Wrap text lines at 78 characters. Where necessary, lines may exceed 78
characters, especially if wrapping would make the source text more difficult
Expand All@@ -85,8 +125,10 @@ from 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.

Expand DownExpand Up@@ -122,29 +164,33 @@ Python examples:
def get_answer():
return 42


******************
Externally Linking
------------------
******************

* Prefer labels for well known subjects (ex: proper nouns) when linking:

.. code-block:: rest
.. code-block:: rest

Sphinx_ is used to document Python.
Sphinx_ is used to document Python.

.. _Sphinx: http://sphinx.pocoo.org
.. _Sphinx: http://sphinx.pocoo.org

* Prefer to use descriptive labels with inline links instead of leaving bare
links:

.. code-block:: rest
.. code-block:: rest

Read the `Sphinx Tutorial <http://sphinx.pocoo.org/tutorial.html>`_
Read the `Sphinx Tutorial <http://sphinx.pocoo.org/tutorial.html>`_

* Avoid using labels such as "click here", "this", etc. preferring
descriptive labels (SEO worthy) instead.


********************************
Linking to Sections in The Guide
--------------------------------
********************************

To cross-reference other parts of this documentation, use the `:ref:
<http://sphinx.pocoo.org/markup/inline.html#cross-referencing-arbitrary-locations>`_
Expand All@@ -157,10 +203,12 @@ 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 appropriate `admonitions directives
<http://sphinx.pocoo.org/rest.html#directives>`_ when making notes.
Expand All@@ -180,8 +228,10 @@ Warnings:

.. warning:: DON'T PANIC


*****
TODOs
-----
*****

Please mark any incomplete areas of The Guide with a `todo directive
<http://sphinx.pocoo.org/ext/todo.html?highlight=todo#directive-todo>`_. To
Expand All@@ -192,5 +242,4 @@ documents or large incomplete sections.

.. todo::
Learn the Ultimate Answer to the Ultimate Question
of Life, The Universe, and Everything

of Life, The Universe, and Everything.

[8]ページ先頭

©2009-2025 Movatter.jp