def _save_notebook(self, os_path, nb):
        """Save a notebook to an os_path."""
        with self.atomic_writing(os_path, encoding='utf-8') as f:
            if ftdetect(os_path) == 'notebook':
                nbformat.write(nb, f, version=nbformat.NO_CONVERT)
            elif ftdetect(os_path) == 'markdown':
                nbjson = nbformat.writes(nb, version=nbformat.NO_CONVERT)
                markdown = convert(nbjson,
                                   informat='notebook',
                                   outformat='markdown',
                                   strip_outputs=self.strip_outputs)
                f.write(markdown)
def _save_notebook ( self , os_path , nb ) : with self . atomic_writing ( os_path , encoding = 'utf-8' ) as f : if ftdetect ( os_path ) == 'notebook' : nbformat . write ( nb , f , version = nbformat . NO_CONVERT ) elif ftdetect ( os_path ) == 'markdown' : nbjson = nbformat . writes ( nb , version = nbformat . NO_CONVERT ) markdown = convert ( nbjson , informat = 'notebook' , outformat = 'markdown' , strip_outputs = self . strip_outputs ) f . write ( markdown )
Save a notebook to an os_path.