From 4f7ce6890416fa8d660561f7eeecd082d91f136d Mon Sep 17 00:00:00 2001 From: Matthew Tretter Date: Mon, 3 Dec 2012 21:11:52 -0500 Subject: [PATCH] Add documentation for generateimage --- imagekit/templatetags/imagekit.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/imagekit/templatetags/imagekit.py b/imagekit/templatetags/imagekit.py index 3169481..a1731a5 100644 --- a/imagekit/templatetags/imagekit.py +++ b/imagekit/templatetags/imagekit.py @@ -78,6 +78,28 @@ def generateimage(parser, token): """ Creates an image based on the provided arguments. + By default:: + + {% generateimage 'myapp:thumbnail' from=mymodel.profile_image %} + + generates an ```` tag:: + + + + You can add additional attributes to the tag using "with". For example, + this:: + + {% generateimage 'myapp:thumbnail' from=mymodel.profile_image with alt="Hello!" %} + + will result in the following markup:: + + Hello! + + For more flexibility, ``generateimage`` also works as an assignment tag:: + + {% generateimage 'myapp:thumbnail' from=mymodel.profile_image as th %} + + """ varname = None