feat: Mask doc if its ancestor name starts with '_'
This commit is contained in:
parent
60b6b83b2a
commit
e7f57b4d91
1 changed files with 10 additions and 1 deletions
|
@ -28,6 +28,14 @@ class TocBuilder:
|
||||||
f1.close()
|
f1.close()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def is_masked(self, rel_path):
|
||||||
|
parts = rel_path.split('/')[::-1]
|
||||||
|
for part in parts:
|
||||||
|
if part[0] == '_':
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def lookup(self):
|
def lookup(self):
|
||||||
md_files = []
|
md_files = []
|
||||||
for root, dirs, files in os.walk(self.root_path):
|
for root, dirs, files in os.walk(self.root_path):
|
||||||
|
@ -47,7 +55,8 @@ class TocBuilder:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# skip files starting with '_'
|
# skip files starting with '_'
|
||||||
if bname_split[0][0] == '_':
|
#if bname_split[0][0] == '_':
|
||||||
|
if self.is_masked(rel_path):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# skip index files
|
# skip index files
|
||||||
|
|
Loading…
Reference in a new issue