From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: export to single html file (like reveal_single_file:t) in regular html export Date: Sat, 26 Nov 2016 07:56:13 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42303) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAcWl-00079x-4Z for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 07:56:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAcWg-0006PJ-AB for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 07:56:23 -0500 Received: from mail-qt0-x236.google.com ([2607:f8b0:400d:c0d::236]:33218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cAcWg-0006P8-65 for emacs-orgmode@gnu.org; Sat, 26 Nov 2016 07:56:18 -0500 Received: by mail-qt0-x236.google.com with SMTP id p16so85631041qta.0 for ; Sat, 26 Nov 2016 04:56:17 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Xebar Saram Cc: org mode Here is some code lightly modified from a comment by Evgeny here: http://kitchingroup.cheme.cmu.edu/blog/2016/10/29/Sending-html-emails-from-org-mode-with-org-mime/ It seems to do what you want. Of course, I only tested it with one image, one time, so I hope it works for you too! It assumes png, but it would not be too hard to generalize. #+BEGIN_SRC emacs-lisp (defun org-image-data-uri (path) (let ((data (with-temp-buffer (insert-file-contents path) (buffer-string)))) (concat ""))) (defun my-link (link contents info) (let ((type (org-element-property :type link)) (path (org-element-property :path link))) (if (and (string= type "file") (f-ext? path "png")) (org-image-data-uri path) (org-html-link link contents info)))) (org-export-define-derived-backend 'my-html 'html :translate-alist '((link . my-link))) (browse-url (org-export-to-file 'my-html "embedded-image.html")) #+END_SRC Xebar Saram writes: > ping anyone :) gotta prepare new assignments for students next week :) > > On Sat, Nov 19, 2016 at 7:46 AM, Xebar Saram wrote: > >> Hi all >> >> i love the option in org revel (reveal_single_file:t) that allows me to >> export a presentation to my students with image support embedded in the >> html file./ >> >> ive searched for a way to do it in the normal org to html exporter with no >> success. any clue how that can be done? >> >> best >> >> Z >> -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu