Skip to content

Commit

Permalink
tocfix
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Oct 13, 2019
1 parent 3dc496f commit b46d85d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jupyter_book/toc.py
Expand Up @@ -54,11 +54,12 @@ def _filename_to_title(filename, split_char='_'):
return title


def _list_supported_files(directory, exclude=["LICENSE.md"]):
def _list_supported_files(directory, exclude=["LICENSE.md"], rglob=False):
glob = directory.rglob if rglob is True else directory.glob
supported_files = [
ipath for suffix in SUPPORTED_FILE_SUFFIXES
for ipath in directory.glob(f"*{suffix}")
if ipath.name not in exclude
for ipath in glob(f"*{suffix}")
if (ipath.name not in exclude) and ('ipynb_checkpoints' not in str(ipath))
]
return supported_files

Expand Down Expand Up @@ -95,7 +96,7 @@ def build_toc(content_folder, filename_split_char='_'):
if (sub.is_dir() and '.ipynb_checkpoints' not in sub.name)])

for subdir in subdirectories:
ipaths = _list_supported_files(subdir)
ipaths = _list_supported_files(subdir, rglob=True)
if len(ipaths) == 0:
continue

Expand Down

0 comments on commit b46d85d

Please sign in to comment.