fix: Make sure watch works for tocupdate target

This commit is contained in:
Glenn Y. Rolland 2021-06-27 23:44:08 +02:00
parent 73651fce79
commit 2193ca202d
3 changed files with 4 additions and 4 deletions

View file

@ -93,9 +93,9 @@ watch: ## run development server
watch-tocupdate-internal:
while inotifywait -q -e move -e modify -e create -e attrib -e delete -e moved_to -r docs ; do \
sleep 0.2 ; \
sleep 2 ; \
$(MAKE) images ; \
pipenv run ./scripts/update-toc $(DOCS_DIR) ; \
$(MAKE) tocupdate ; \
done
watch-docs-internal:

View file

@ -1,3 +1,3 @@
docs: make watch-docs-internal
slides: make watch-slides-internal
toc: make tocupdate
toc: make watch-tocupdate-internal

View file

@ -83,7 +83,7 @@ class TocBuilder:
bname_split = os.path.splitext(bname)
dname = os.path.dirname(f)
if lastdir != dname:
if lastdir != dname and dname != "":
lastdir = dname
title = self.__get_title(os.path.join(self.root_path, dname, 'index.md'))
if title is not None: