commit 8048342251d73ff2b850f87aa0b3f70856e894ab
parent a45ee87383aeb6a5279b63eca8a035c169d0f9b6
Author: Oleh Krehel <ohwoeowho@gmail.com>
Date: Fri, 1 Nov 2013 09:08:33 +0100
org-download.el (org-download-image-width): new custom variable.
* org-download.el (org-download-image): changes behavior according to `org-download-image-width'
Fixes #1, Fixes #3.
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/org-download.el b/org-download.el
@@ -112,6 +112,11 @@ Set this to \"\" if you don't want time stamps."
(const :tag "gm" "gm import %s"))
:group 'org-download)
+(defcustom org-download-image-width 0
+ "When non-zero add #+attr_html: :width tag to the image."
+ :type 'integer
+ :group 'org-download)
+
(defun org-download-get-heading (lvl)
"Return the heading of the current entry's LVL level parent."
(save-excursion
@@ -247,9 +252,12 @@ The screenshot tool is determined by `org-download-sceenshot-method'."
(if (looking-back "^[ \t]+")
(delete-region (match-beginning 0) (match-end 0))
(newline))
- (insert (format "#+DOWNLOADED: %s @ %s\n [[%s]]"
+ (insert (format "#+DOWNLOADED: %s @ %s\n%s [[%s]]"
link
(format-time-string "%Y-%m-%d %H:%M:%S")
+ (if (= org-download-image-width 0)
+ ""
+ (format "#+attr_html: :width %dpx\n" org-download-image-width))
filename))
(org-display-inline-images))))