Skip to content

Commit

Permalink
Simplify parse_filename a little
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Oct 1, 2023
1 parent b8597e4 commit eb2279e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sphinx_js/typedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ def populate_index(self, root: "IndexType") -> "Converter":
return self

def _parse_filepath(self, path: str) -> list[str]:
if not path:
return []
entries = ["."] + path.split("/")
entries[-1] = entries[-1].rpartition(".")[0]
p = Path(path)
if p.name:
p = p.with_suffix("")
entries = ["."] + list(p.parts)
for i in range(len(entries) - 1):
entries[i] += "/"
return entries
Expand Down

0 comments on commit eb2279e

Please sign in to comment.