Add and use html_image_rows()
This commit is contained in:
parent
5156e8752b
commit
e193700ee4
@ -34,9 +34,8 @@ from wireviz.wv_colors import get_color_hex, translate_color
|
|||||||
from wireviz.wv_gv_html import (
|
from wireviz.wv_gv_html import (
|
||||||
html_bgcolor,
|
html_bgcolor,
|
||||||
html_bgcolor_attr,
|
html_bgcolor_attr,
|
||||||
html_caption,
|
|
||||||
html_colorbar,
|
html_colorbar,
|
||||||
html_image,
|
html_image_rows,
|
||||||
html_line_breaks,
|
html_line_breaks,
|
||||||
nested_html_table,
|
nested_html_table,
|
||||||
remove_links,
|
remove_links,
|
||||||
@ -203,8 +202,7 @@ class Harness:
|
|||||||
translate_color(connector.color, self.options.color_mode) if connector.color else None,
|
translate_color(connector.color, self.options.color_mode) if connector.color else None,
|
||||||
html_colorbar(connector.color)],
|
html_colorbar(connector.color)],
|
||||||
'<!-- connector table -->' if connector.style != 'simple' else None,
|
'<!-- connector table -->' if connector.style != 'simple' else None,
|
||||||
[html_image(connector.image)],
|
*html_image_rows(connector.image)]
|
||||||
[html_caption(connector.image)]]
|
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
rows.extend(get_additional_component_table(self, connector))
|
rows.extend(get_additional_component_table(self, connector))
|
||||||
@ -326,8 +324,7 @@ class Harness:
|
|||||||
translate_color(cable.color, self.options.color_mode) if cable.color else None,
|
translate_color(cable.color, self.options.color_mode) if cable.color else None,
|
||||||
html_colorbar(cable.color)],
|
html_colorbar(cable.color)],
|
||||||
'<!-- wire table -->',
|
'<!-- wire table -->',
|
||||||
[html_image(cable.image)],
|
*html_image_rows(cable.image)]
|
||||||
[html_caption(cable.image)]]
|
|
||||||
# fmt: on
|
# fmt: on
|
||||||
|
|
||||||
rows.extend(get_additional_component_table(self, cable))
|
rows.extend(get_additional_component_table(self, cable))
|
||||||
|
|||||||
@ -64,6 +64,12 @@ def html_colorbar(color: Color) -> str:
|
|||||||
return html_bgcolor(color, ' width="4"') if color else None
|
return html_bgcolor(color, ' width="4"') if color else None
|
||||||
|
|
||||||
|
|
||||||
|
def html_image_rows(image):
|
||||||
|
from wireviz.wv_bom import make_list
|
||||||
|
|
||||||
|
return sum([[[html_image(i)], [html_caption(i)]] for i in make_list(image)], [])
|
||||||
|
|
||||||
|
|
||||||
def html_image(image):
|
def html_image(image):
|
||||||
from wireviz.DataClasses import Image
|
from wireviz.DataClasses import Image
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user