Added link to GH source code to documentation
This commit is contained in:
@@ -64,8 +64,17 @@ def format_docs(version, collectionName, types, relatedEnums):
|
||||
for currentType in typesByNamespace[namespace]:
|
||||
print(f'\n### {currentType["Name"]}')
|
||||
|
||||
description = ""
|
||||
if currentType["Description"]:
|
||||
print(f'**{currentType["Description"]}**')
|
||||
description = currentType["Description"]
|
||||
|
||||
sourceUrl = ""
|
||||
if currentType["Filename"]:
|
||||
sourceUrl = f"https://github.com/OpenRA/OpenRA/blob/{version}/{currentType["Filename"]}"
|
||||
description = f"{description} [GitHub]({sourceUrl})"
|
||||
|
||||
if description:
|
||||
print(f'**{description}**')
|
||||
|
||||
if "InheritedTypes" in currentType and currentType["InheritedTypes"]:
|
||||
inheritedTypes = [t for t in currentType["InheritedTypes"] if t not in ['TraitInfo', 'Warhead']] # Remove blacklisted types.
|
||||
|
||||
Reference in New Issue
Block a user