diff --git a/packaging/format-docs.py b/packaging/format-docs.py index e530a12cbb..dc65690140 100644 --- a/packaging/format-docs.py +++ b/packaging/format-docs.py @@ -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.