Skip to content

Commit

Permalink
Merge pull request #417 from yarikoptic/enh-contributors
Browse files Browse the repository at this point in the history
Make contributor records to be hyperlink if email or URL
  • Loading branch information
rcpeene authored Jul 2, 2024
2 parents e1c551b + bf53465 commit 4894bd2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions databook_utils/insert_authors_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,16 @@ def run(self):

line_block = nodes.line_block()
for property in properties[1:]:
if property != "":
if not property:
continue
elif property.startswith("https://") or property.startswith("http://"):
link_node = nodes.reference(text=property, refuri=property)
line_block.append(link_node)
elif "@" in property:
mailto_link = f"mailto:{property}"
email_node = nodes.reference(text=property, refuri=mailto_link)
line_block.append(email_node)
else:
line_block.append(nodes.line(text=property))
line_block.append(nodes.line(text=""))

Expand All @@ -153,4 +162,4 @@ def setup(app):
'version': '0.1',
'parallel_read_safe': True,
'parallel_write_safe': True,
}
}

0 comments on commit 4894bd2

Please sign in to comment.