From bd3934a49aa9fbf34883f1eb5e0dc1312ab0780a Mon Sep 17 00:00:00 2001 From: Duncan Lock Date: Sun, 5 May 2013 09:09:40 -0700 Subject: [PATCH] Updated readme to reflect current behavior; removed old code --- .../better_figures_and_images.py | 12 +----------- better_figures_and_images/readme.rst | 8 ++++---- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/better_figures_and_images/better_figures_and_images.py b/better_figures_and_images/better_figures_and_images.py index 40737f2..fa4498a 100644 --- a/better_figures_and_images/better_figures_and_images.py +++ b/better_figures_and_images/better_figures_and_images.py @@ -6,7 +6,7 @@ This plugin: - Adds a style="width: ???px; height: auto;" to each image in the content - Also adds the width of the contained image to any parent div.figures. - - If RESPONSIVE_IMAGES == True, adds style="max-width: 100%; height: auto;" instead + - If RESPONSIVE_IMAGES == True, adds style="width: ???px; max-width: 100%; height: auto;" instead - Corrects alt text: if alt == image filename, set alt = '' TODO: Need to add a test.py for this plugin. @@ -27,16 +27,6 @@ def content_object_init(instance): content = instance._content soup = BeautifulSoup(content) - # if '` tags in the content, by checking +- Adds a `style="width: ???px; height: auto;"` attribute to any `` tags in the content, by checking the dimensions of the image file and adding the appropriate `style="width: ???px; height: auto;"` to the `` tag. - Also finds any `div class="figures"` tags in the content, that contain images and adds the same style to them too. -- If RESPONSIVE_IMAGES setting is true, it adds `style="max-width: 100%; height: auto;"` instead. +- If RESPONSIVE_IMAGES setting is true, it adds `style="width: ???px; max-width: 100%; height: auto;"` instead. - Corrects Alt text: If an img alt attribute = the image filename, it sets it to "" @@ -38,8 +38,8 @@ into output like this: or this, if RESPONSIVE_IMAGES = True: -
- +
+

This is the caption of the figure.