Added link to GH source code to documentation

This commit is contained in:
Pavel Penev
2025-01-07 20:29:42 +02:00
committed by Gustas
parent 04b61a20ea
commit 22d3b5e5a1

View File

@@ -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.