emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Dynerman <david@block-party.net>
To: emacs-orgmode@gnu.org
Subject: Only evaluate code blocks interactively, but export results
Date: Sat, 4 Apr 2015 12:03:14 -0500	[thread overview]
Message-ID: <0119590B-CC3F-4CAF-85E6-E736C6755AB2@block-party.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

Hi all,

I’m trying to accomplish the following:

1) I have an org-babel python block in my code that produces a figure file
2) I’d like to include the resulting figure HTML export of my org file
3) The code takes a bit to run, so I don’t want to execute the code block during each HTML export

What I have so far:

#+NAME: my_python_function
#+HEADER: :var some python vars
#+BEGIN_SRC python :results value file
  my python code
#+END_SRC

#+CALL: my_python_function(some python vars=values) :results value file :exports results
#+CAPTION: Here is a figure
#+LABEL: fig:an_amazing_figure
#+ATTR_HTML: :height 200em
#+RESULTS:
[[file:output_file]]

This block works when I export to HTML (e.g. the code runs, and the figure is placed in the appropriate figure with the appropriate caption).

Question: How can I modify this so that the code is only executed when I run C-c C-c on the +CALL line, but still have the figure in the exported HTML?

I tried adding :eval no-export to the code and to the +CALL line, but then the resulting HTML doesn’t contain the figure (it outputs “nil”, presumably because the CALL line is trying to call it, but the code is refusing to run because of the no-export line)

I’ve been digging around this for a few hours, any help would be appreciated.

Thanks,
David

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

             reply	other threads:[~2015-04-04 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 17:03 David Dynerman [this message]
2015-04-04 17:15 ` Only evaluate code blocks interactively, but export results Thomas S. Dye
2015-04-04 18:55   ` David Dynerman
2015-04-05 18:00     ` Charles C. Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0119590B-CC3F-4CAF-85E6-E736C6755AB2@block-party.net \
    --to=david@block-party.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).