Skip to content

Commit

Permalink
(rv) More docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
ahyangyi committed Dec 7, 2023
1 parent 039ca3c commit bd3a653
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions road_vehicle/docgen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,25 @@ def gen_docs(string_manager, rosters):
|-------|------|""",
file=f,
)
for entry in roster.entries:
for entry in sorted(roster.entries, key=lambda x: x.variant.introduction_date):
entry = entry.variant.get_variants()[0]
name = get_translation(string_manager["STR_RV_" + entry.translation_name + "_NAME"], 0x7F)
print(f"| {entry._props['introduction_date'].year} | {name}", file=f)
if entry.techclass in ["bus", "articulated_bus", "2decker", "coach"]:
name = get_translation(string_manager["STR_RV_" + entry.translation_name + "_NAME"], 0x7F)
print(f"| {entry._props['introduction_date'].year} | {name}", file=f)

print(
f"""
# Lorries
| Year | Name |
|-------|------|""",
file=f,
)
for entry in sorted(roster.entries, key=lambda x: x.variant.introduction_date):
entry = entry.variant.get_variants()[0]
if entry.techclass in ["l_truck", "m_truck", "h_truck"]:
name = get_translation(string_manager["STR_RV_" + entry.translation_name + "_NAME"], 0x7F)
print(f"| {entry._props['introduction_date'].year} | {name}", file=f)

prefix = f"docs/road_vehicle/vehicles"
os.makedirs(os.path.join(prefix, "img"), exist_ok=True)
Expand Down

0 comments on commit bd3a653

Please sign in to comment.