I suspect what you want is a post-save hook that calls nbconvert. For example:
import io
from nbcovert import export, HTMLExporter
def script_post_save(model, os_path, contents_manager, **kwargs):
"""convert notebooks to HTML after save with nbconvert"""
if model['type'] != 'notebook':
return
global _exporter
if _exporter is None:
_exporter = HTMLExporter(parent=contents_manager)
base, ext = os.path.splitext(os_path)
# your rename logic goes here
html_fname = base + '.html'
html, resources = _exporter.from_filename(os_path)
with io.open(html_fname, 'w', encoding='utf-8') as f:
f.write(html)
c.FileContentsManager.post_save_hook = script_post_save
-Min
--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/487c5080-c4cc-45a2-90f1-7b5066f663e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.