[docs] Generate JSON file with supported boards

This commit is contained in:
Kuba Szczodrzyński
2022-12-06 21:33:48 +01:00
parent ec4e946643
commit 665ab22de5
2 changed files with 28 additions and 0 deletions

17
docs/build_json.py Normal file
View File

@@ -0,0 +1,17 @@
import json
from ltchiptool import Board
from update_docs import board_obj_sort
boards = map(Board, Board.get_list())
boards = list(sorted(boards, key=board_obj_sort))
for i, board in enumerate(boards):
boards[i] = dict(
name=board.name,
title=board.title,
vendor=board.vendor,
mcu=board.family.short_name,
)
with open("boards.json", "w") as f:
json.dump(boards, f)