Skip to content

Commit 2bee9c0

Browse files
committed
renamed continue_linenos as continue-linenos for consistency
1 parent e68d30f commit 2bee9c0

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

doc/source/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,15 @@ produces:
193193
print('B')
194194
print('C')
195195

196-
You may also *continue line numbers* from the previous cell with ``:continue_linenos:``::
196+
You may also *continue line numbers* from the previous cell with ``:continue-linenos:``::
197197

198198
.. jupyter-execute::
199199
:linenos:
200200

201201
print('A')
202202

203203
.. jupyter-execute::
204-
:continue_linenos:
204+
:continue-linenos:
205205

206206
print('B')
207207
print('C')
@@ -214,7 +214,7 @@ produces:
214214
print('A')
215215

216216
.. jupyter-execute::
217-
:continue_linenos:
217+
:continue-linenos:
218218

219219
print('B')
220220
print('C')

jupyter_sphinx/execute.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class JupyterCell(Directive):
154154
'hide-output': directives.flag,
155155
'code-below': directives.flag,
156156
'linenos': directives.flag,
157-
'continue_linenos': directives.flag,
157+
'continue-linenos': directives.flag,
158158
'raises': csv_option,
159159
'stderr': directives.flag,
160160
}
@@ -190,7 +190,7 @@ def run(self):
190190
hide_output=('hide-output' in self.options),
191191
code_below=('code-below' in self.options),
192192
linenos=('linenos' in self.options),
193-
continue_linenos=('continue_linenos' in self.options),
193+
continue_linenos=('continue-linenos' in self.options),
194194
raises=self.options.get('raises'),
195195
stderr=('stderr' in self.options),
196196
)]
@@ -398,7 +398,7 @@ def apply(self):
398398

399399
# Add line numbers to code cells if linenos directive is set.
400400
# Continue line numbers from previous cell with line numbers
401-
# if continue_linenos directive is set.
401+
# if continue-linenos directive is set.
402402
linenostart = 1
403403
for node in nodes:
404404
source = node.children[0]

tests/test_execute.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_continue_linenos(doctree):
149149
2 + 2
150150
151151
.. jupyter-execute::
152-
:continue_linenos:
152+
:continue-linenos:
153153
154154
3 + 3
155155
'''
@@ -162,7 +162,7 @@ def test_continue_linenos(doctree):
162162
assert 'highlight_args' not in cell0.children[0].attributes
163163
assert cell0.children[0].rawsource.strip() == "2 + 2"
164164
assert cell0.children[1].rawsource.strip() == "4"
165-
# :continue_linenos:
165+
# :continue-linenos:
166166
assert cell1.attributes['linenos'] is False
167167
assert cell1.attributes['continue_linenos']
168168
assert 'highlight_args' not in cell1.attributes
@@ -183,7 +183,7 @@ def test_continue_linenos(doctree):
183183
'cell1' # should restart with line number 1
184184
185185
.. jupyter-execute::
186-
:continue_linenos:
186+
:continue-linenos:
187187
188188
'cell2' # should be line number 2
189189
@@ -192,12 +192,12 @@ def test_continue_linenos(doctree):
192192
'cell3' # no line number directive
193193
194194
.. jupyter-execute::
195-
:continue_linenos:
195+
:continue-linenos:
196196
197197
'cell4' # should restart at line number 1
198198
199199
.. jupyter-execute::
200-
:continue_linenos:
200+
:continue-linenos:
201201
202202
'cell5' # should continue with line number 2
203203
'''
@@ -211,16 +211,16 @@ def test_continue_linenos(doctree):
211211
# :linenos:
212212
assert cell1.children[0].attributes["linenos"]
213213
assert "highlight_args" not in cell1.children[0].attributes
214-
# :continue_linenos:
214+
# :continue-linenos:
215215
assert cell2.children[0].attributes["linenos"]
216216
assert cell2.children[0].attributes["highlight_args"]["linenostart"] == 2
217217
# (No line number directive)
218218
assert "linenos" not in cell3.children[0].attributes
219219
assert "highlight_args" not in cell3.children[0].attributes
220-
# :continue_linenos:
220+
# :continue-linenos:
221221
assert cell4.children[0].attributes["linenos"]
222222
assert cell4.children[0].attributes["highlight_args"]["linenostart"] == 1
223-
# :continue_linenos:
223+
# :continue-linenos:
224224
assert cell5.children[0].attributes["linenos"]
225225
assert cell5.children[0].attributes["highlight_args"]["linenostart"] == 2
226226

0 commit comments

Comments
 (0)