From 149d4c9578a4fec1e6a99161a084eaebe0b7df6d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 3 Sep 2025 13:49:08 +0200 Subject: support a path prefix for the hover card placeholder png --- scripts/generate_boss_html.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'scripts/generate_boss_html.py') diff --git a/scripts/generate_boss_html.py b/scripts/generate_boss_html.py index 7f023b34..12eadea3 100755 --- a/scripts/generate_boss_html.py +++ b/scripts/generate_boss_html.py @@ -17,7 +17,7 @@ NAMES = {"kraken": "The Kraken", "tyrant": "The Tyrant"} DESCS = { "kraken": "Face the evil of the sea. Overcome the kraken, the fierce epicenter of the ozean, which employs creatures of the depth to stop your offense.
Since the kraken does not move and can not win it is the perfect boss to start.", - "tyrant": "" # TODO + "tyrant": "" # TODO } TEMPLATE = """ @@ -146,7 +146,7 @@ code { padding: .2em .4em; font-size: 85%; margin: 0; - white-space: pre-wrap; + white-space: pre-wrap; } pre { margin: 0; @@ -242,6 +242,7 @@ def ai_instruction(name: str, rules, lang: str) -> str: def gen_startdeck_ul(map_def: dict, lang: str) -> str: + """Generate the HTML for the hoverable startdeck listing""" if 'start_deck_list' in map_def: dl = map_def["start_deck_list"].splitlines() else: @@ -249,10 +250,10 @@ def gen_startdeck_ul(map_def: dict, lang: str) -> str: s = "" for card in dl: - cardFmt = "" + card_fmt = "" parts = card.split() if len(parts) > 1: - cardFmt = f'{parts[0]} ' + card_fmt = f'{parts[0]} ' c = parts[1] else: c = card @@ -262,9 +263,15 @@ def gen_startdeck_ul(map_def: dict, lang: str) -> str: c, lang, path_prefix='../') hlink = generate_card_hover_links.gen_hoverable_link( - c, lambda _: c, gen_link_target, '../latex-build/', lang) - cardFmt += hlink - s += f'\n
  • {cardFmt}
  • ' + c, + lambda _: c, + gen_link_target, + '../latex-build/', + lang, + placeholder_png_prefix='../') + + card_fmt += hlink + s += f'\n
  • {card_fmt}
  • ' return f'' -- cgit v1.2.3