Commit 8f807537 authored by Matthieu Boileau's avatar Matthieu Boileau

Warn if empty no notebooks found

parent bb826c49
......@@ -11,7 +11,7 @@ from .mydoit import MyDoitHelp, ClassTaskLoader
def get_help_epilog() -> str:
"""Instanciate a minimal nbcourse to return help string"""
course = NbCourse()
course = NbCourse(help=True)
loader = ClassTaskLoader(course)
return MyDoitHelp(task_loader=loader).get_help()
......
......@@ -64,7 +64,7 @@ class NbCourse:
}]
}
def __init__(self, user_conf=None):
def __init__(self, user_conf=None, help=False):
"""Build from user_conf"""
self.conf = self._get_config(user_conf)
self.conf['template_path'] = Path(self.conf['theme']['dir'],
......@@ -81,7 +81,8 @@ class NbCourse:
nbcourse_libdir = Path(__file__).parents[1]
self.conf['reveal_path'] = nbcourse_libdir / Path('reveal.js')
self.notebooks = tuple(self.conf['nb']['path'].glob('*-*.ipynb'))
if not help and not self.notebooks:
log.warning("No notebooks found! Check 'nb:dir:' field in nbcourse.yml file.")
if self.conf['book']['file']:
self.titlepage_path = self.conf['pages']['path'] / \
self.conf['book']['titlepage']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment