Skip to content

Commit 41e945a

Browse files
authored
add location to wraning
1 parent 56753bc commit 41e945a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jupyter_sphinx/execute.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def apply(self):
206206
# Write certain cell outputs (e.g. images) to separate files, and
207207
# modify the metadata of the associated cells in 'notebook' to
208208
# include the path to the output file.
209-
write_notebook_output(notebook, output_dir, file_name)
209+
write_notebook_output(notebook, output_dir, file_name, self.env.docname)
210210

211211
try:
212212
cm_language = notebook.metadata.language_info.codemirror_mode.name
@@ -239,7 +239,7 @@ def execute_cells(kernel_name, cells, execute_kwargs):
239239
return notebook
240240

241241

242-
def write_notebook_output(notebook, output_dir, notebook_name):
242+
def write_notebook_output(notebook, output_dir, notebook_name, location=None):
243243
"""Extract output from notebook cells and write to files in output_dir.
244244
245245
This also modifies 'notebook' in-place, adding metadata to each cell that
@@ -263,8 +263,7 @@ def write_notebook_output(notebook, output_dir, notebook_name):
263263
ext = ".txt"
264264
js.logger.warning(
265265
"Notebook code has no file extension metadata, " "defaulting to `.txt`",
266-
# TODO correct location
267-
# location=document.settings.env.docname,
266+
location=location,
268267
)
269268
contents = "\n\n".join(cell.source for cell in notebook.cells)
270269
with open(os.path.join(output_dir, notebook_name + ext), "w",

0 commit comments

Comments
 (0)