File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ def robustlink(
4141
4242
4343def image (
44+ fig_class : str = None ,
4445 div_float : str = None ,
4546 width : str = None ,
4647 localsrc : str = None ,
@@ -49,10 +50,13 @@ def image(
4950 alt : str = None ,
5051 ahref : str = None ,
5152 localhref : str = None ,
53+ picclass : str = None ,
54+ imgclass : str = None ,
5255) -> str :
5356 """Output HTML of an image inside a <figure> tag
5457
5558 Args:
59+ fig_class (str, optional): Class(es) to add to the surrounding figure tag.
5660 div_float (str, optional): Float the figure 'left' or 'right'. Defaults to None.
5761 width (str, optional): width of the figure tag. Defaults to None.
5862 localsrc (str, optional): path to image file relative to `assets/images/`. Defaults to None.
@@ -67,6 +71,9 @@ def image(
6771 """
6872 alt = alt or ""
6973 output : str = "<figure "
74+ if fig_class :
75+ output += f'class="{ fig_class } " '
76+ elif div_float :
7077 output += f'class="image-{ div_float } " '
7178 if width :
7279 output += f'style="width:{ width } px" '
You can’t perform that action at this time.
0 commit comments