Skip to content

Commit 57c7f36

Browse files
committed
rst highlighting and better explanation of skip (#170)
1 parent e6279a0 commit 57c7f36

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

docs/src/examples.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ particularly in the reference documentation itself:
4545

4646
.. autolink-examples:: lib.Knight
4747

48-
Such a table is generated with :rst:dir:`autolink-examples`::
48+
Such a table is generated with :rst:dir:`autolink-examples`:
49+
50+
.. code-block:: rst
4951
5052
.. autolink-examples:: lib.Knight
5153
@@ -60,14 +62,18 @@ The import can be hidden instead.
6062
6163
lib.Knight().taunt()
6264
63-
The previous block is produced with :rst:dir:`autolink-preface`::
65+
The previous block is produced with :rst:dir:`autolink-preface`:
66+
67+
.. code-block:: rst
6468
6569
.. autolink-preface:: import lib
6670
.. code:: python
6771
6872
lib.Knight().taunt()
6973
70-
A multiline preface can be written in the content portion of the directive::
74+
A multiline preface can be written in the content portion of the directive:
75+
76+
.. code-block:: rst
7177
7278
.. autolink-preface::
7379
@@ -96,7 +102,9 @@ the previous left off.
96102
print(knight.taunt())
97103
knight.scratch()
98104
99-
This was achieved with :rst:dir:`autolink-concat`::
105+
This was achieved with :rst:dir:`autolink-concat`:
106+
107+
.. code-block:: rst
100108
101109
.. autolink-concat:: section
102110
.. code:: python
@@ -124,7 +132,9 @@ and preventing it from being included in further sources with concatenation.
124132
import lib
125133
lib.Knight()
126134
127-
Which is done via :rst:dir:`autolink-skip`::
135+
Which is done via :rst:dir:`autolink-skip`:
136+
137+
.. code-block:: rst
128138
129139
.. autolink-skip::
130140
.. code:: python
@@ -196,7 +206,9 @@ Reference tables across intersphinx work too:
196206
It seems that the reference type information is more important
197207
for Sphinx when dealing with external modules,
198208
likely because the references cannot be resolved dynamically.
199-
Please specify a ``type`` in :rst:dir:`autolink-examples`::
209+
Please specify a ``type`` in :rst:dir:`autolink-examples`:
210+
211+
.. code-block:: rst
200212
201213
.. autolink-examples:: numpy.linspace
202214
:type: func

docs/src/reference.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ Directives
128128
Skip sphinx-codeautolink functionality.
129129
``level``, if specified, must be one of:
130130

131-
- "next" - next block (default)
131+
- "next" - next encountered block (default)
132132
- "section" - blocks until the next title
133133
- "file" - all blocks in the current file
134134
- "off" - turn skipping off
@@ -137,6 +137,9 @@ Directives
137137
it is not processed (e.g. non-Python blocks) to avoid placement confusion.
138138
Skipped blocks are ignored in block concatenation as well, and concatenation
139139
is resumed without breaks after skipping is over.
140+
"Next" doesn't need to be specified right before the block that would consume
141+
it. For e.g. literal blocks the skip directive would be inserted before the
142+
preceding paragraph.
140143

141144
CSS class
142145
---------

0 commit comments

Comments
 (0)