diff --git a/jupytext/nbextension/jupytext.js b/jupytext/nbextension/jupytext.js index 151758f8a..1814d0a8a 100644 --- a/jupytext/nbextension/jupytext.js +++ b/jupytext/nbextension/jupytext.js @@ -33,6 +33,16 @@ define([ "use strict"; var show_notebook_settings_dialog = function () { + if (!('jupytext' in Jupyter.notebook.metadata)) + Jupyter.notebook.metadata.jupytext = {}; + + var jpmd = Jupyter.notebook.metadata.jupytext; + + var notebook_path = Jupyter.notebook.notebook_path; + var notebook_ext = notebook_path.split('.').pop().toLowerCase(); + var script_ext = Jupyter.notebook.metadata.language_info.file_extension; + var script_language = Jupyter.notebook.metadata.language_info.name; + script_language = script_language[0].toUpperCase() + script_language.substr(1); var modal = $('