feat: update-toc handles files in root directory
This commit is contained in:
parent
769fe66263
commit
73651fce79
1 changed files with 12 additions and 8 deletions
|
@ -51,16 +51,16 @@ class TocBuilder:
|
|||
bname_split = os.path.splitext(bname)
|
||||
dname = os.path.dirname(rel_path)
|
||||
|
||||
# skip files in docs/ root
|
||||
# if dname == "":
|
||||
# continue
|
||||
|
||||
# skip files starting with '_'
|
||||
#if bname_split[0][0] == '_':
|
||||
if self.is_masked(rel_path):
|
||||
print("Found {} which is masked. Ignoring".format(fn))
|
||||
continue
|
||||
|
||||
# skip files in docs/ root
|
||||
# if dname == "":
|
||||
# continue
|
||||
|
||||
# skip index files
|
||||
if bname_split[0] == 'index':
|
||||
print("Found {} which is an index file. Ignoring".format(fn))
|
||||
|
@ -91,7 +91,11 @@ class TocBuilder:
|
|||
else:
|
||||
lines.append(" - \"%s\":" % dname)
|
||||
|
||||
lines.append(" - %s" % f)
|
||||
if dname != "":
|
||||
lines.append(" - %s" % f)
|
||||
else:
|
||||
lines.append(" - %s" % f)
|
||||
|
||||
return lines
|
||||
|
||||
class FileInjector:
|
||||
|
|
Loading…
Reference in a new issue