fix: Make sure watch works for tocupdate target
This commit is contained in:
parent
73651fce79
commit
2193ca202d
3 changed files with 4 additions and 4 deletions
4
Makefile
4
Makefile
|
@ -93,9 +93,9 @@ watch: ## run development server
|
||||||
|
|
||||||
watch-tocupdate-internal:
|
watch-tocupdate-internal:
|
||||||
while inotifywait -q -e move -e modify -e create -e attrib -e delete -e moved_to -r docs ; do \
|
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 ; \
|
$(MAKE) images ; \
|
||||||
pipenv run ./scripts/update-toc $(DOCS_DIR) ; \
|
$(MAKE) tocupdate ; \
|
||||||
done
|
done
|
||||||
|
|
||||||
watch-docs-internal:
|
watch-docs-internal:
|
||||||
|
|
2
Procfile
2
Procfile
|
@ -1,3 +1,3 @@
|
||||||
docs: make watch-docs-internal
|
docs: make watch-docs-internal
|
||||||
slides: make watch-slides-internal
|
slides: make watch-slides-internal
|
||||||
toc: make tocupdate
|
toc: make watch-tocupdate-internal
|
||||||
|
|
|
@ -83,7 +83,7 @@ class TocBuilder:
|
||||||
bname_split = os.path.splitext(bname)
|
bname_split = os.path.splitext(bname)
|
||||||
dname = os.path.dirname(f)
|
dname = os.path.dirname(f)
|
||||||
|
|
||||||
if lastdir != dname:
|
if lastdir != dname and dname != "":
|
||||||
lastdir = dname
|
lastdir = dname
|
||||||
title = self.__get_title(os.path.join(self.root_path, dname, 'index.md'))
|
title = self.__get_title(os.path.join(self.root_path, dname, 'index.md'))
|
||||||
if title is not None:
|
if title is not None:
|
||||||
|
|
Loading…
Reference in a new issue