Merge pull request #770 from krOoze/pretty_ext_contacts

Pretty contacts in extension appendices
This commit is contained in:
Jon Leech 2018-09-03 06:02:40 -07:00 committed by GitHub
commit 0b4801a3f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 2 deletions

View File

@ -247,8 +247,19 @@ class Extension:
write('*Contact*::', file=fp) write('*Contact*::', file=fp)
contacts = self.contact.split(',') contacts = self.contact.split(',')
for c in contacts: for contact in contacts:
write(' * ' + c, file=fp) contactWords = contact.strip().split()
name = ' '.join(contactWords[:-1])
handle = contactWords[-1]
if handle.startswith('gitlab:'):
prettyHandle = 'icon:gitlab[alt=GitLab, role="red"]' + handle.replace('gitlab:@', '')
elif handle.startswith('@'):
trackerLink = 'https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=' + self.name + ':%20&body=' + handle + '%20'
prettyHandle = trackerLink + '[icon:github[alt=GitHub, role="black"]' + handle[1:] + ']'
else:
prettyHandle = handle
write(' * ' + name + ' ' + prettyHandle, file=fp)
fp.close() fp.close()