From mboxrd@z Thu Jan 1 00:00:00 1970 From: thorne Subject: Emacs lisp code export difference between `org-export-region-as-html' and `org-export-as-html' Date: Mon, 24 Sep 2012 00:34:17 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG2FI-000233-Fm for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 02:34:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TG2FH-0006kI-18 for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 02:34:20 -0400 Received: from mail-lb0-f169.google.com ([209.85.217.169]:63428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TG2FG-0006kE-PN for emacs-orgmode@gnu.org; Mon, 24 Sep 2012 02:34:18 -0400 Received: by lbbgj10 with SMTP id gj10so6377271lbb.0 for ; Sun, 23 Sep 2012 23:34:17 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Can I use babel to generate html to be exported in a #+BEGIN_HTML ... section using `org-export-region-as-html'? I ask because the behaviour I am seeing is different depending on whether I use that function or `org-export-as-html'. The former function exports the html code to show the html code, whereas the later exports the html code directly as html. To concretize that a bit, I have a pair of functions that look like this (have I misunderstood they way the export is supposed to work?) -- (defun embed-pdf-function (pdf-file) (concat "\n")) (defun embed-pdf (pdf-file) (interactive "MFile name: ") (insert (concat "#+BEGIN_SRC emacs-lisp :exports results :results html\n" "(embed-pdf-function \"" pdf-file "\")\n" "#+END_SRC"))) When I call the first in an org buffer and give it "foo.pdf" as an argument, it inserts something that looks like this: #+BEGIN_SRC emacs-lisp :exports results :results html (embed-pdf-function "foo.pdf") #+END_SRC When I use `org-export-as-html' in that buffer I end up with an html file that includes this, which IS what I would want: But, when I instead use `org-export-region-as-html' in a program (because I am hoping to get the results as a string, rather than in a buffer) using something like this -- (org-export-region-as-html (point-min) (point-max) t 'string) -- the result I get in the html looks like this:
<iframe src="http://docs.google.com/gview?url=http://example.net/foo.pdf&embedded=true"
style="width:25em; height:38em;" frameborder="0"></iframe>
Which of course is not the iframe I was hoping for, but is the code to render the code for it in html. Should the region export function work the way I am hoping at all? -- can it be made to do so? ( I also have the following set globally, if it is relevant: (setq org-confirm-babel-evaluate nil) (setq org-export-babel-evaluate t) and -- M-x org-version RET ==> "Org-mode version 7.8.11" )