From 22d3b5e5a1d809f2ef158ddb2b6b6a20c9ad12dc Mon Sep 17 00:00:00 2001 From: Pavel Penev Date: Tue, 7 Jan 2025 20:29:42 +0200 Subject: [PATCH] Added link to GH source code to documentation --- packaging/format-docs.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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.