Skip to content

Commit

Permalink
Replace underscore with space on dir name display
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-psb committed Feb 20, 2024
1 parent 32e29bd commit 7b8560c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pulp_docs/utils/aggregation.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ def _get_tree(_path):
filename = str(Path(entry.path).relative_to(self.tmpdir))
children.append(filename)
elif entry.is_dir():
sub_section = {entry.name.title(): _get_tree(entry)}
dir_title = self.normalize_title(entry.name)
sub_section = {dir_title: _get_tree(entry)}
children.append(sub_section)
return children

result = _get_tree(basepath)
return result

def normalize_title(self, raw_title: str):
return raw_title.replace("_", " ").title()

def repo_grouping(
self,
template_str: str,
Expand Down

0 comments on commit 7b8560c

Please sign in to comment.