Skip to content

Commit

Permalink
Added link to GH source code to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
penev92 authored and PunkPun committed Jan 11, 2025
1 parent 04b61a2 commit 22d3b5e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packaging/format-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 22d3b5e

Please sign in to comment.