Skip to content

Commit 7b8560c

Browse files
committed
Replace underscore with space on dir name display
1 parent 32e29bd commit 7b8560c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pulp_docs/utils/aggregation.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ def _get_tree(_path):
4545
filename = str(Path(entry.path).relative_to(self.tmpdir))
4646
children.append(filename)
4747
elif entry.is_dir():
48-
sub_section = {entry.name.title(): _get_tree(entry)}
48+
dir_title = self.normalize_title(entry.name)
49+
sub_section = {dir_title: _get_tree(entry)}
4950
children.append(sub_section)
5051
return children
5152

5253
result = _get_tree(basepath)
5354
return result
5455

56+
def normalize_title(self, raw_title: str):
57+
return raw_title.replace("_", " ").title()
58+
5559
def repo_grouping(
5660
self,
5761
template_str: str,

0 commit comments

Comments
 (0)