Skip to content

Commit

Permalink
Update instance.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lzehl authored Mar 28, 2024
1 parent 6d16962 commit 5ae6d08
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pipeline/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _build_single_instance_link(self, instanceReference:Dict) -> str:
# get instance identity and create instance heading
instance_id = instanceReference["@id"]
instance_type = instance_id.split("/")[4]
instance_heading = instance_id.split("/")[-1].casefold()
instance_heading = instance_id.split("/")[-1]

# build type plurals
instance_type_plural = self._build_plurals(instance_type)
Expand All @@ -71,7 +71,8 @@ def _build_single_instance_link(self, instanceReference:Dict) -> str:
page_heading = instance_type

# create link and return RST hyperlink
link = os.path.join(link_dir, f"{page_heading}.html#{self._replace_multi(instance_heading, ['_', '.'], '-')}")
instance_heading = self._replace_multi(instance_heading, ['_', '.'], '-').casefold()
link = os.path.join(link_dir, f"{page_heading}.html#{instance_heading}")
return f"`{instance_id.split('/')[-1]} <{link}>`_"

def _build_multi_instance_links(self, instanceReferenceList:List) -> str:
Expand Down

0 comments on commit 5ae6d08

Please sign in to comment.