fs = L(Path(p) for p in ('styles.css', 'index.ipynb', '01_core.ipynb', 'sub/02_x.ipynb'))
test_eq(fs.filter(_keep_file, file_glob='', file_re=''), fs)
test_eq(fs.filter(_keep_file, file_glob='index.ipynb', file_re=''), [Path('styles.css'), Path('index.ipynb')])
test_eq(fs.filter(_keep_file, file_glob='', file_re=r'^0'), [Path('styles.css'), Path('01_core.ipynb'), Path('sub/02_x.ipynb')])serve
A parallel ipynb processor (experimental)
_keep_file implements proc_nbs’s notebook scoping: file_glob/file_re restrict which notebooks are processed, while other files (styles, images, yml) are always kept, since any render may reference them.
proc_nbs
def proc_nbs(
path:str='', # Path to notebooks
n_workers:int=4, # Number of workers
force:bool=False, # Ignore cache and build all
file_glob:str='', # Only process notebooks matching glob (other files are always included)
file_re:str='', # Only process notebooks matching regex (other files are always included)
symlinks:bool=False, # Follow symlinks?
folder_re:str=None, # Only enter folders matching regex
skip_file_glob:str=None, # Skip files matching glob
skip_file_re:str='^[_.]', # Skip files matching regex
skip_folder_re:str='^[_.]', # Skip folders matching regex
):Process notebooks in path for docs rendering