Skip to content

Commit 4c0df65

Browse files
committed
Add new image() classes
1 parent 516cca6 commit 4c0df65

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

plugins/dltj_plugin/dltj_plugin.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def robustlink(
4141

4242

4343
def 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" '

0 commit comments

Comments
 (0)