Skip to content

Commit 635f948

Browse files
committed
added lineno-start directive, fix for #110
1 parent 970097e commit 635f948

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

doc/source/index.rst

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ produces:
177177

178178
You may also add *line numbers* to the source code with ``:linenos:``::
179179

180-
.. jupyter-execute::
181-
:linenos:
180+
.. jupyter-execute::
181+
:linenos:
182182

183-
print('A')
184-
print('B')
185-
print('C')
183+
print('A')
184+
print('B')
185+
print('C')
186186

187187
produces:
188188

@@ -193,6 +193,26 @@ produces:
193193
print('B')
194194
print('C')
195195

196+
197+
To add *line numbers from a specific line* to the source code, use the
198+
``lineno-start`` directive::
199+
200+
.. jupyter-execute::
201+
:lineno-start: 7
202+
203+
print('A')
204+
print('B')
205+
print('C')
206+
207+
produces:
208+
209+
.. jupyter-execute::
210+
:lineno-start: 7
211+
212+
print('A')
213+
print('B')
214+
print('C')
215+
196216
You may also emphasize particular lines in the source code with ``:emphasize-lines:``::
197217

198218
.. jupyter-execute::
@@ -379,4 +399,5 @@ jupyter_sphinx_linenos
379399

380400
jupyter_sphinx_continue_linenos
381401

382-
Whether to show continuous line numbering in all ``jupyter-execute`` sources.
402+
Whether to continue line numbering from previous cell in all ``jupyter-execute``
403+
sources.

0 commit comments

Comments
 (0)