Skip to content

Commit f6714fe

Browse files
committed
Better indentation examples
1 parent 472ec1d commit f6714fe

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
#. list item 1
2-
#. list item 2
1+
|...|...|...|...
2+
#. List item 1.
33

4-
* nested list item
4+
Second paragraph in the list item.
5+
6+
#. List item 2.
7+
8+
* Nested list item.
59

610
.. code-block:: bash
711
8-
# this is a code block inside a nested list item
12+
# this code block is in a nested list item
913
10-
* another nested list item
14+
* Another nested list item.
15+
|...|...|...|...

doc/contributing/docs/markup.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,30 @@ It's best if all indents are multiples of 4 spaces, even in lists. Otherwise
6767
the document is not consistent. Also, it is much easier to put indents
6868
with tabs than manually.
6969

70+
To make 4-space indents, add two or three spaces instead of one.
71+
It is allowed in rST markup.
72+
73+
.. code-block:: rst
74+
75+
|...|...|...|...
76+
.. directive::
77+
.. nested-directive::
78+
1. numbered list
79+
#. autonumbered list
80+
* bullet list
81+
* next level list
82+
|...|...|...|...
83+
7084
Example:
7185

7286
.. literalinclude:: _includes/indentation.rst
7387
:language: rst
7488

7589
Resulting output:
7690

77-
.. include:: _includes/indentation.rst
91+
.. include:: _includes/indentation.rst
92+
:start-line: 1
93+
:end-line: -1
7894

7995
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8096
Code snippets

0 commit comments

Comments
 (0)