@@ -63,7 +63,7 @@ def update_var(varname, func, fn=None, code=None):
6363# %% ../nbs/api/02_maker.ipynb
6464class ModuleMaker :
6565 "Helper class to create exported library from notebook source cells"
66- def __init__ (self , dest , name , nb_path , is_new = True , parse = True ):
66+ def __init__ (self , dest , name , nb_path , is_new = True , parse = True , solo_nb = False ):
6767 dest ,nb_path = Path (dest ),Path (nb_path )
6868 store_attr ()
6969 self .fname = dest / (name .replace ('.' ,'/' ) + ".py" )
@@ -208,8 +208,8 @@ def make(self:ModuleMaker, cells, all_cells=None, lib_path=None):
208208 f .write (_retr_mdoc (cells ))
209209 f .write (f"# AUTOGENERATED! DO NOT EDIT! File to edit: { self .dest2nb } ." )
210210 if last_future > 0 : write_cells (cells [:last_future ], self .hdr , f )
211- if self .parse : f .write (f"\n \n # %% auto 0\n __all__ = { all_str } " )
212- write_cells (cells [last_future :], self .hdr , f , cell_number = get_config ().cell_number )
211+ if self .parse and not self . solo_nb : f .write (f"\n \n # %% auto 0\n __all__ = { all_str } " )
212+ write_cells (cells [last_future :], self .hdr , f , cell_number = get_config ().cell_number , solo_nb = self . solo_nb )
213213 f .write ('\n ' )
214214
215215# %% ../nbs/api/02_maker.ipynb
0 commit comments