Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/source/extending/savehooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ A post-save hook to make a script equivalent whenever the notebook is saved
def script_post_save(model, os_path, contents_manager, **kwargs):
"""convert notebooks to Python script after save with nbconvert

replaces `ipython notebook --script`
replaces `jupyter notebook --script`
"""
from nbconvert.exporters.script import ScriptExporter

Expand All @@ -69,7 +69,6 @@ A post-save hook to make a script equivalent whenever the notebook is saved
log = contents_manager.log

base, ext = os.path.splitext(os_path)
py_fname = base + '.py'
script, resources = _script_exporter.from_filename(os_path)
script_fname = base + resources.get('output_extension', '.txt')
log.info("Saving script /%s", to_api_path(script_fname, contents_manager.root_dir))
Expand Down