Skip to content

Commit 3689986

Browse files
authored
Better indentation examples (#1858)
1 parent 4feadc5 commit 3689986

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
#. list item 1
2-
#. list item 2
1+
|...|...|...|...
2+
#. List item 1.
3+
Paragraph continues.
34

4-
* nested list item
5+
Second paragraph.
6+
7+
#. List item 2.
8+
9+
* Nested list item.
510

611
.. code-block:: bash
712
8-
# this is a code block inside a nested list item
13+
# this code block is in a nested list item
914
10-
* another nested list item
15+
* Another nested list item.
16+
|...|...|...|...

doc/contributing/docs/markup.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,27 @@ 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+
Note that you have to use two or three spaces instead of one.
71+
It is allowed in rST markup:
72+
73+
.. code-block:: rst
74+
75+
|...|...|...|...
76+
* unordered list
77+
#. ordered list
78+
.. directive::
79+
|...|...|...|...
80+
7081
Example:
7182

7283
.. literalinclude:: _includes/indentation.rst
7384
:language: rst
7485

7586
Resulting output:
7687

77-
.. include:: _includes/indentation.rst
88+
.. include:: _includes/indentation.rst
89+
:start-line: 1
90+
:end-line: -1
7891

7992
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8093
Code snippets

0 commit comments

Comments
 (0)