Skip to content

Commit

Permalink
Merge pull request #19 from Wolfy76700/docs
Browse files Browse the repository at this point in the history
Improved Wiki
  • Loading branch information
Wolfy76700 authored Mar 18, 2024
2 parents d481763 + 88ecdde commit 0c87180
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/merge-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ on:
push:
branches:
- main
- docs
jobs:
generate_doc:
name: Generate the documentation from the JSON Schemas
Expand Down
18 changes: 12 additions & 6 deletions .utilities/generate_controller_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ def process_controller(path, level = 1):
with open(f"{path}/config.json", "rt", encoding="utf-8") as json_file:
controller = json.loads(json_file.read())
image_url = f"https://raw.githubusercontent.com/Wolfy76700/ControllerDatabase/main/{path}/image.png"
result = f"{'#'*level} {controller['name']}\n\n![{controller['name']}]({image_url})\n\n"
result = f"{'#'*level} {controller['name']}\n"
result += f"""
<picture>
<img src="{image_url}" alt="{controller['name']}" height="250">
</picture>
"""
if controller.get("source"):
result += f"*More information: {controller.get('source')}*\n\n"
result += f"""{'#'*(level+1)} Functions
Expand All @@ -88,7 +94,9 @@ def process_controller(path, level = 1):
for variant in controller.get("variants"):
result += f"""{'#'*(level+2)} {variant['name']}
![{variant['name']}](https://raw.githubusercontent.com/Wolfy76700/ControllerDatabase/main/{path}/{variant['image']})
<picture>
<img src="https://raw.githubusercontent.com/Wolfy76700/ControllerDatabase/main/{path}/{variant['image']}" alt="{variant['name']}" height="150"/>
</picture>
"""
result += f"</details>\n\n"
Expand All @@ -103,10 +111,9 @@ def process_manufacturer(path, level=1):
list_folders.sort()
if not list_folders:
return("")
result = f"{'#'*level} {manufacturer['name']}\n\n<details>\n\n"
result = f"{'#'*level} {manufacturer['name']}\n\n"
for folder in list_folders:
result += process_controller(folder.replace("\\", "/"), level+1)
result += "</details>\n\n"
return(result)

def process_category(path, level=1):
Expand All @@ -116,10 +123,9 @@ def process_category(path, level=1):
list_folders.sort()
if not list_folders:
return("")
result = f"{'#'*level} {category['name']}\n\n*{category['desc']}*\n\n<details>\n\n"
result = f"{'#'*level} {category['name']}\n\n*{category['desc']}*\n\n"
for folder in list_folders:
result += process_manufacturer(folder.replace("\\", "/"), level+1)
result += "</details>\n\n"
return(result)

def process_all():
Expand Down
Binary file modified leverless/keybox/fusion/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified leverless/keybox/fusion/mirror.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c87180

Please sign in to comment.