Skip to content

Commit dd80fb0

Browse files
author
quantra
committed
lazy_srcset.py docstrings updated
1 parent a91032f commit dd80fb0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lazy_srcset/templatetags/lazy_srcset.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ def srcset(*args, **kwargs):
102102
The first arg must be an ImageField or subclass or a path to an image discoverable by static files.
103103
104104
args can provide image sizes in vw for each breakpoint, if not provided 100vw is assumed. These are integers
105-
which are used to calculate generated image sizes. They must be in vw. Sorry no calc() etc allowed.
105+
which are used to calculate generated image sizes. They must be in vw. Sorry no calc() etc. allowed. Don't try
106+
too hard here! Close is good enough.
106107
107-
kwargs can be used to provide this and breakpoints to use
108+
kwargs can be used to provide this and breakpoints to use.
108109
109-
A kwarg with the key format can be used to set the output format for generated images
110-
111-
If the first arg is a key from LAZY_SRCSET_BREAKPOINTS this will be used otherwise the default will be used.
110+
If the second arg is a key from ``settings.LAZY_SRCSET`` this will be used otherwise the default config will be
111+
used.
112112
113113
Example usage (where image is a file-like e.g. ImageField or a string representing a path to a static file):
114114
@@ -124,9 +124,11 @@ def srcset(*args, **kwargs):
124124
125125
{% srcset image "custom_breakpoints" 25 50 quality=50 %}
126126
127+
{% srcset image "custom_breakpoints" 25 50 max_width=1920 quality=50 %}
128+
127129
{% srcset image 1920=25 1024=50 %}
128130
129-
{% srcset image 1920=25 1024=50 max_width=2560 quality=50 %}
131+
{% srcset image 1920=25 1024=50 max_width=1920 quality=50 %}
130132
131133
"""
132134
args = list(args)

0 commit comments

Comments
 (0)