Skip to content

Commit 4428d87

Browse files
author
kuyan
committed
Highlight examples as ReStructuredText.
1 parent 6753406 commit 4428d87

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

docs/notes/styleguide.rst

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,32 @@ Headings
3939

4040
Use the following styles for headings.
4141

42-
Chapter title::
42+
Chapter title:
43+
44+
.. code-block:: rest
4345
4446
#########
4547
Chapter 1
4648
#########
4749
48-
Page title::
50+
Page title:
51+
52+
.. code-block:: rest
4953
5054
===================
5155
Time is an Illusion
5256
===================
5357
54-
Section headings::
58+
Section headings:
59+
60+
.. code-block:: rest
5561
5662
Lunchtime Doubly So
5763
-------------------
5864
59-
Sub section headings::
65+
Sub section headings:
66+
67+
.. code-block:: rest
6068
6169
Very Deep
6270
~~~~~~~~~
@@ -74,7 +82,9 @@ Code Examples
7482

7583
Wrap all code examples at 70 characters to avoid horizontal scrollbars.
7684

77-
Command line examples::
85+
Command line examples:
86+
87+
.. code-block:: rest
7888
7989
.. code-block:: console
8090
@@ -83,15 +93,19 @@ Command line examples::
8393
8494
Be sure to include the ``$`` prefix before each line.
8595

86-
Python interpreter examples::
96+
Python interpreter examples:
97+
98+
.. code-block:: rest
8799
88100
Label the example::
89101
90102
.. code-block:: python
91103
92104
>>> import this
93105
94-
Python examples::
106+
Python examples:
107+
108+
.. code-block:: rest
95109
96110
Descriptive title::
97111
@@ -103,16 +117,20 @@ Python examples::
103117
Externally Linking
104118
------------------
105119

106-
* Prefer labels for well known subjects (ex: proper nouns) when linking::
120+
* Prefer labels for well known subjects (ex: proper nouns) when linking:
121+
122+
.. code-block:: rest
107123
108-
Sphinx_ is used to document Python.
124+
Sphinx_ is used to document Python.
109125
110-
.. _Sphinx: http://sphinx.pocoo.org
126+
.. _Sphinx: http://sphinx.pocoo.org
111127
112128
* Prefer to use descriptive labels with inline links instead of leaving bare
113-
links::
129+
links:
130+
131+
.. code-block:: rest
114132
115-
Read the `Sphinx Tutorial <http://sphinx.pocoo.org/tutorial.html>`_
133+
Read the `Sphinx Tutorial <http://sphinx.pocoo.org/tutorial.html>`_
116134
117135
* Avoid using labels such as "click here", "this", etc. preferring
118136
descriptive labels (SEO worthy) instead.
@@ -124,7 +142,9 @@ To cross-reference other parts of this documentation, use the `:ref:
124142
<http://sphinx.pocoo.org/markup/inline.html#cross-referencing-arbitrary-locations>`_
125143
keyword and labels.
126144

127-
To make reference labels more clear and unique, always add a ``-ref`` suffix::
145+
To make reference labels more clear and unique, always add a ``-ref`` suffix:
146+
147+
.. code-block:: rest
128148
129149
.. _some-section-ref:
130150
@@ -137,14 +157,18 @@ Notes and Warnings
137157
Make use of the appropriate `admonitions directives
138158
<http://sphinx.pocoo.org/rest.html#directives>`_ when making notes.
139159

140-
Notes::
160+
Notes:
161+
162+
.. code-block:: rest
141163
142164
.. note::
143165
The Hitchhiker’s Guide to the Galaxy has a few things to say
144166
on the subject of towels. A towel, it says, is about the most
145167
massively useful thing an interstellar hitch hiker can have.
146168
147-
Warnings::
169+
Warnings:
170+
171+
.. code-block:: rest
148172
149173
.. warning:: DON'T PANIC
150174
@@ -156,7 +180,7 @@ Please mark any incomplete areas of The Guide with a `todo directive
156180
avoid cluttering the :ref:`todo-list-ref`, use a single ``todo`` for stub
157181
documents or large incomplete sections.
158182

159-
::
183+
.. code-block:: rest
160184
161185
.. todo::
162186
Learn the Ultimate Answer to the Ultimate Question

0 commit comments

Comments
 (0)