Skip to content

Commit 4cf2aec

Browse files
committed
Remove no-thebelab option
1 parent 75944fd commit 4cf2aec

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

jupyter_sphinx/execute.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ class JupyterCell(Directive):
131131
If provided, the cell output will not be displayed in the output.
132132
code-below : bool
133133
If provided, the code will be shown below the cell output.
134-
no-thebelab : bool
135-
If provided, thebelab will be disabled for this cell
136134
raises : comma separated list of exception types
137135
If provided, a comma-separated list of exception type names that
138136
the cell may raise. If one of the listed execption types is raised
@@ -155,7 +153,6 @@ class JupyterCell(Directive):
155153
'hide-code': directives.flag,
156154
'hide-output': directives.flag,
157155
'code-below': directives.flag,
158-
'no-thebelab': directives.flag,
159156
'raises': csv_option,
160157
'stderr': directives.flag,
161158
}
@@ -190,7 +187,6 @@ def run(self):
190187
hide_code=('hide-code' in self.options),
191188
hide_output=('hide-output' in self.options),
192189
code_below=('code-below' in self.options),
193-
no_thebelab=('no-thebelab' in self.options),
194190
raises=self.options.get('raises'),
195191
stderr=('stderr' in self.options),
196192
)]
@@ -332,8 +328,7 @@ def apply(self):
332328
if not doctree.traverse(JupyterCellNode):
333329
return
334330

335-
any_thebelab = any(not cell['no_thebelab'] for cell in doctree.traverse(JupyterCellNode))
336-
if thebe_config and any_thebelab:
331+
if thebe_config:
337332
# Add the button at the bottom if it is not present
338333
if not doctree.traverse(ThebeButtonNode):
339334
doctree.append(ThebeButtonNode())
@@ -545,7 +540,7 @@ def cell_output_to_nodes(cell, data_priority, dir, thebe_config):
545540

546541

547542
def attach_outputs(output_nodes, node, thebe_config, cm_language):
548-
if thebe_config and not node.attributes['no_thebelab']:
543+
if thebe_config:
549544
source = node.children[0]
550545

551546
thebe_source = ThebeSourceNode(hide_code=node.attributes['hide_code'],

tests/test_execute.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ def test_basic(doctree):
6161
assert cell.attributes['code_below'] is False
6262
assert cell.attributes['hide_code'] is False
6363
assert cell.attributes['hide_output'] is False
64-
assert cell.attributes['no_thebelab'] is False
6564
assert cell.children[0].rawsource.strip() == "2 + 2"
6665
assert cell.children[1].rawsource.strip() == "4"
6766

@@ -328,11 +327,6 @@ def test_thebe_button_manual(doctree):
328327

329328
def test_thebe_button_none(doctree):
330329
config = "jupyter_sphinx_thebelab_config = {\"dummy\": True}"
331-
source = """
332-
.. jupyter-execute::
333-
:no-thebelab:
334-
335-
1 + 1
336-
"""
330+
source = "No Jupyter cells"
337331
tree = doctree(source, config)
338332
assert len(tree.traverse(ThebeButtonNode)) == 0

0 commit comments

Comments
 (0)