Skip to content

Commit 0a1bf0f

Browse files
committed
Add and use html_image_rows()
1 parent 5156e87 commit 0a1bf0f

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/wireviz/Harness.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@
3434
from wireviz.wv_gv_html import (
3535
html_bgcolor,
3636
html_bgcolor_attr,
37-
html_caption,
3837
html_colorbar,
39-
html_image,
38+
html_image_rows,
4039
html_line_breaks,
4140
nested_html_table,
4241
remove_links,
@@ -203,8 +202,7 @@ def create_graph(self) -> Graph:
203202
translate_color(connector.color, self.options.color_mode) if connector.color else None,
204203
html_colorbar(connector.color)],
205204
'<!-- connector table -->' if connector.style != 'simple' else None,
206-
[html_image(connector.image)],
207-
[html_caption(connector.image)]]
205+
*html_image_rows(connector.image)]
208206
# fmt: on
209207

210208
rows.extend(get_additional_component_table(self, connector))
@@ -326,8 +324,7 @@ def create_graph(self) -> Graph:
326324
translate_color(cable.color, self.options.color_mode) if cable.color else None,
327325
html_colorbar(cable.color)],
328326
'<!-- wire table -->',
329-
[html_image(cable.image)],
330-
[html_caption(cable.image)]]
327+
*html_image_rows(connector.image)]
331328
# fmt: on
332329

333330
rows.extend(get_additional_component_table(self, cable))

src/wireviz/wv_gv_html.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ def html_colorbar(color: Color) -> str:
6464
return html_bgcolor(color, ' width="4"') if color else None
6565

6666

67+
def html_image_rows(image):
68+
from wireviz.wv_bom import make_list
69+
70+
return sum([[[html_image(i)], [html_caption(i)]] for i in make_list(image)], [])
71+
72+
6773
def html_image(image):
6874
from wireviz.DataClasses import Image
6975

0 commit comments

Comments
 (0)