Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sanbrock committed Jun 15, 2023
1 parent 1af3a42 commit 8c0881d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions dev_tools/docs/nxdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,16 @@ def get_first_parent_ref(self, path, tag):
):
return ""

parent_display_name = (
f"{parent_def_name[1:]}/.../{parent_path_segments[-1]}"
if len(parent_path_segments) > 1
else f"{parent_def_name[1:]}/{parent_path_segments[-1]}"
)
if tag == "attribute":
pos_of_right_slash = parent_path.rfind("/")
parent_path = (
parent_path[:pos_of_right_slash]
+ "@"
+ parent_path[pos_of_right_slash + 1 :]
)
parent_display_name = f"{parent_def_name[1:]}{parent_path}"
return (
f"<:abbr:`parent (parent definition: {parent_def_name[1:]}"
+ f"/{parent_path_segments[-1]})`:ref:`🔗 <{parent_def_name}{parent_path}-{tag}>`>"
f"<:abbr:`parent (parent definition: {parent_display_name})"
+ f"`:ref:`🔗 </{parent_display_name}-{tag}>`>"
)
return ""

0 comments on commit 8c0881d

Please sign in to comment.